Check-in [012d5e4f23]
Not logged in

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
Changes

Changes to src/manifest.c

1078 } 1078 } 1079 } 1079 } 1080 if( m.type==CFTYPE_WIKI ){ 1080 if( m.type==CFTYPE_WIKI ){ 1081 char *zTag = mprintf("wiki-%s", m.zWikiTitle); 1081 char *zTag = mprintf("wiki-%s", m.zWikiTitle); 1082 int tagid = tag_findid(zTag, 1); 1082 int tagid = tag_findid(zTag, 1); 1083 int prior; 1083 int prior; 1084 char *zComment; 1084 char *zComment; > 1085 char zLength[40]; > 1086 while( isspace(m.zWiki[0]) ) m.zWiki++; > 1087 sqlite3_snprintf(sizeof(zLength), zLength, "%d", strlen(m.zWiki)); 1085 tag_insert(zTag, 1, 0, rid, m.rDate, rid); | 1088 tag_insert(zTag, 1, zLength, rid, m.rDate, rid); 1086 free(zTag); 1089 free(zTag); 1087 prior = db_int(0, 1090 prior = db_int(0, 1088 "SELECT rid FROM tagxref" 1091 "SELECT rid FROM tagxref" 1089 " WHERE tagid=%d AND mtime<%.17g" 1092 " WHERE tagid=%d AND mtime<%.17g" 1090 " ORDER BY mtime DESC", 1093 " ORDER BY mtime DESC", 1091 tagid, m.rDate 1094 tagid, m.rDate 1092 ); 1095 );

Changes to src/wiki.c

642 @ %h(blob_str(&d)) 642 @ %h(blob_str(&d)) 643 @ </pre> 643 @ </pre> 644 style_footer(); 644 style_footer(); 645 } 645 } 646 646 647 /* 647 /* 648 ** WEBPAGE: wcontent 648 ** WEBPAGE: wcontent > 649 ** > 650 ** all=1 Show deleted pages 649 ** 651 ** 650 ** List all available wiki pages with date created and last modified. 652 ** List all available wiki pages with date created and last modified. 651 */ 653 */ 652 void wcontent_page(void){ 654 void wcontent_page(void){ 653 Stmt q; 655 Stmt q; > 656 int showAll = P("all")!=0; > 657 654 login_check_credentials(); 658 login_check_credentials(); 655 if( !g.okRdWiki ){ login_needed(); return; } 659 if( !g.okRdWiki ){ login_needed(); return; } 656 style_header("Available Wiki Pages"); 660 style_header("Available Wiki Pages"); > 661 if( showAll ){ > 662 style_submenu_element("Active", "Only Active Pages", "%s/wcontent", g.zTop); > 663 }else{ > 664 style_submenu_element("All", "All", "%s/wcontent?all=1", g.zTop); > 665 } 657 @ <ul> 666 @ <ul> 658 db_prepare(&q, 667 db_prepare(&q, > 668 "SELECT" > 669 " substr(tagname, 6)," > 670 " (SELECT value FROM tagxref WHERE tagid=tag.tagid ORDER BY mtime DESC)" 659 "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname GLOB 'wiki-*'" | 671 " FROM tag WHERE tagname GLOB 'wiki-*'" 660 " ORDER BY lower(tagname)" 672 " ORDER BY lower(tagname)" 661 ); 673 ); 662 while( db_step(&q)==SQLITE_ROW ){ 674 while( db_step(&q)==SQLITE_ROW ){ 663 const char *zName = db_column_text(&q, 0); 675 const char *zName = db_column_text(&q, 0); > 676 int size = db_column_int(&q, 1); > 677 if( size>0 ){ 664 @ <li><a href="%s(g.zBaseURL)/wiki?name=%T(zName)">%h(zName)</a></li> | 678 @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)">%h(zName)</a></li> > 679 }else if( showAll ){ > 680 @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)"><s>%h(zName)</s></a></li> > 681 } 665 } 682 } 666 db_finalize(&q); 683 db_finalize(&q); 667 @ </ul> 684 @ </ul> 668 style_footer(); 685 style_footer(); 669 } 686 } 670 687 671 /* 688 /*