Diff
Not logged in

Differences From:

File src/timeline.c part of check-in [dfea940da8] - Refinements to the timeline for giving better information about wiki pages. by drh on 2007-10-09 02:35:22. [view]

To:

File src/timeline.c part of check-in [50a58adb76] - Many changes and bug fixes in the wiki processing. Moving toward a workable wiki system. The "Home" menu option now takes you to the wiki page whose name is the same as the Project Name. There is a "wcontent" page, but no link to it yet. Many other changes. by drh on 2007-10-10 21:15:17. [view]

@@ -234,8 +234,9 @@
 **    e=INTEGER      starting event id.                 dflt: nil
 **    u=NAME         show only events from user.        dflt: nil
 **    a              show events after and including.   dflt: false
 **    r              show only related events.          dflt: false
+**    y=TYPE         show only TYPE ('ci' or 'w')       dflt: nil
 */
 void page_timeline(void){
   Stmt q;
   char *zSQL;
@@ -246,8 +247,9 @@
   const char *zUser = P("u");
   int objid = atoi(PD("e","0"));
   int relatedEvents = P("r")!=0;
   int afterFlag = P("a")!=0;
+  const char *zType = P("y");
   int firstEvent;
   int lastEvent;
 
   /* To view the timeline, must have permission to read project data.
@@ -260,11 +262,14 @@
       db_exists("SELECT 1 FROM user"
                 " WHERE login='anonymous'"
                 "   AND cap LIKE '%%h%%'") ){
     @ <p><b>Note:</b> You will be able to access <u>much</u> more
-    @ historical information if <a href="%s(g.zBaseURL)/login">login</a>.</p>
+    @ historical information if <a href="%s(g.zTop)/login">login</a>.</p>
   }
   zSQL = mprintf("%s", timeline_query_for_www());
+  if( zType ){
+    zSQL = mprintf("%z AND event.type=%Q", zSQL, zType);
+  }
   if( zUser ){
     zSQL = mprintf("%z AND event.user=%Q", zSQL, zUser);
   }
   if( objid ){
@@ -387,36 +392,8 @@
   @ <input type="hidden" value="1" name="a">
   @ <input type="hidden" value="%d(nEntry)" name="n">
   @ <input type="submit" value="Previous %d(nEntry) Rows">
   @ </form>
-  style_footer();
-}
-
-
-/*
-** WEBPAGE: wlist
-**
-** Show the complete change history for a single wiki page.  The name
-** of the wiki is in g.zExtra
-*/
-void wlist_page(void){
-  Stmt q;
-  char *zTitle;
-  char *zSQL;
-  login_check_credentials();
-  if( !g.okHistory ){ login_needed(); return; }
-  zTitle = mprintf("History Of %h", g.zExtra);
-  style_header(zTitle);
-  free(zTitle);
-
-  zSQL = mprintf("%s AND event.objid IN "
-                 "  (SELECT rid FROM tagxref WHERE tagid="
-                       "(SELECT tagid FROM tag WHERE tagname='wiki-%q'))",
-                 timeline_query_for_www(), g.zExtra);
-  db_prepare(&q, zSQL);
-  free(zSQL);
-  www_print_timeline(&q, 0, 0, 0, 0);
-  db_finalize(&q);
   style_footer();
 }
 
 /*