[Home]WikiPatches/ChangesSinceLastVisit

UseModWiki | WikiPatches | RecentChanges | Preferences

This patch allows a user to show changes since his last visit. The information is stored in a cookie and kann be addressed at wiki.pl?action=rc&sincelastvisit=1 If you don't have a cookie already it showes changes for the last 30 days.

Try it at http://koeln.ccc.de/~drt/wiki.cgi?action=rc&sincelastvisit=1

 Hacked by the teenagemutantninjaheroecoders - http://c0re.jp/
 --- wiki.cgi.orig      Wed Aug 29 14:37:51 2001
 +++ wiki.cgi   Wed Aug 29 15:53:23 2001
 @@ -463,6 +463,14 @@
    $fullHtml .= &WikiToHTML($Text{'text'});
    $fullHtml .= "<hr>\n"  if (!&GetParam('embed', $EmbedWiki));
    if (($id eq $RCName) || (T($RCName) eq $id) || (T($id) eq $RCName)) {
 +
 +    if (&GetParam("sincelastvisit", 0)) {
 +        my $cookie1 = $q->cookie(-name       => $CookieName . "-RC",
 +                                 -value   => time(),
 +                                 -expires => '+60d');
 +        print "Set-Cookie: $cookie1\r\n";
 +    }
 +
      print $fullHtml;
      &DoRc();
      print "<hr>\n"  if (!&GetParam('embed', $EmbedWiki));
 @@ -492,7 +500,10 @@
    my $starttime = 0;
    my $showbar = 0;
  
 -  if (&GetParam("from", 0)) {
 +  if (&GetParam("sincelastvisit", 0)) {
 +    $starttime = $q->cookie($CookieName."-RC");
 +
 +  } elsif (&GetParam("from", 0)) {
      $starttime = &GetParam("from", 0);
      print "<h2>" . Ts('Updates since %s', &TimeToText($starttime))
            . "</h2>\n"; 
Get it at http://c0re.jp/c0de/misc/usemod-0.92-changessincelastvisit.patch



This doesn't work (at least in 1.0) because it prints the cookie after the header has been sent.


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 23, 2007 12:25 pm by MarkusLude (diff)
Search: