Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| SHA1 Hash: | 012d5e4f2355e78ac5af5044ec96390730a1bef4 |
|---|---|
| Date: | 2010-03-18 10:39:31 |
| User: | drh |
| Comment: | Show only non-empty wiki pages in the list of all wiki pages. A rebuild is required after updating in order for this feature to work. |
Tags And Properties
- bgcolor=#c0ffc0 inherited from [c3d7df650b]
- branch=experimental inherited from [c3d7df650b] branch timeline
- sym-experimental inherited from [c3d7df650b]
Changes
[hide diffs]Changes to src/manifest.c
@@ -1080,11 +1080,14 @@
if( m.type==CFTYPE_WIKI ){
char *zTag = mprintf("wiki-%s", m.zWikiTitle);
int tagid = tag_findid(zTag, 1);
int prior;
char *zComment;
- tag_insert(zTag, 1, 0, rid, m.rDate, rid);
+ char zLength[40];
+ while( isspace(m.zWiki[0]) ) m.zWiki++;
+ sqlite3_snprintf(sizeof(zLength), zLength, "%d", strlen(m.zWiki));
+ tag_insert(zTag, 1, zLength, rid, m.rDate, rid);
free(zTag);
prior = db_int(0,
"SELECT rid FROM tagxref"
" WHERE tagid=%d AND mtime<%.17g"
" ORDER BY mtime DESC",
Changes to src/wiki.c
@@ -645,25 +645,42 @@
}
/*
** WEBPAGE: wcontent
**
+** all=1 Show deleted pages
+**
** List all available wiki pages with date created and last modified.
*/
void wcontent_page(void){
Stmt q;
+ int showAll = P("all")!=0;
+
login_check_credentials();
if( !g.okRdWiki ){ login_needed(); return; }
style_header("Available Wiki Pages");
+ if( showAll ){
+ style_submenu_element("Active", "Only Active Pages", "%s/wcontent", g.zTop);
+ }else{
+ style_submenu_element("All", "All", "%s/wcontent?all=1", g.zTop);
+ }
@ <ul>
db_prepare(&q,
- "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname GLOB 'wiki-*'"
+ "SELECT"
+ " substr(tagname, 6),"
+ " (SELECT value FROM tagxref WHERE tagid=tag.tagid ORDER BY mtime DESC)"
+ " FROM tag WHERE tagname GLOB 'wiki-*'"
" ORDER BY lower(tagname)"
);
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
- @ <li><a href="%s(g.zBaseURL)/wiki?name=%T(zName)">%h(zName)</a></li>
+ int size = db_column_int(&q, 1);
+ if( size>0 ){
+ @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)">%h(zName)</a></li>
+ }else if( showAll ){
+ @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)"><s>%h(zName)</s></a></li>
+ }
}
db_finalize(&q);
@ </ul>
style_footer();
}