r96 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95‎ | r96 | r97 >
Date:08:54, 8 February 2002
Author:vibber
Status:old
Tags:
Comment:
Keep WantedPages cache out of RecentChanges list
Modified paths:
  • /trunk/phpwiki/fpw/special_wantedpages.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/special_wantedpages.php
@@ -75,13 +75,14 @@
7676 global $doRefresh , $wikiRefreshThisPage , $wikiResourcesWarning , $wikiNoRefresh ;
7777 $pn = "Log:Most_Wanted" ;
7878 $minRefreshPeriod = 5*60; # Refuse to update more often than every 5 minutes
 79+ $timeOffset = 10000000; # Drop our date back a few months to keep us out of RecentChanges
7980 $ret = "<nowiki>" ;
8081
8182 $ret .= "<p align=center><font size='+1'><b><a href=\"" ;
8283 $ret .= wikiLink ( "special:WantedPages&doRefresh=yes" ) ;
8384 $ret .= "\">$wikiRefreshThisPage</a></b></font><br>$wikiResourcesWarning</p></nowiki>\n" ;
8485 if ( $doRefresh == "yes" ) {
85 - $timestamp = getMySQL ( "cur" , "UNIX_TIMESTAMP(cur_timestamp)" , "cur_title=\"$pn\"" ) ;
 86+ $timestamp = getMySQL ( "cur" , "UNIX_TIMESTAMP(cur_timestamp)" , "cur_title=\"$pn\"" ) + $timeOffset ;
8687 if ( ( $lastrefreshed = time() - $timestamp ) < $minRefreshPeriod ) {
8788 $ret .= "<p><i>" . str_replace ( array ( "$1", "$2" ) ,
8889 array ( round ( $lastrefreshed / 60 ) , round ( ( $minRefreshPeriod - $lastrefreshed ) / 60 ) ),
@@ -92,9 +93,7 @@
9394 $p = new wikiPage ;
9495 $p->setTitle ( $pn ) ;
9596 $p->ensureExistence () ;
96 - #$p->setEntry ( $o , "Refresh" , 0 , "System" , 1 , ",cur_timestamp=cur_timestamp" ) ; # Storing, don't show on RC
97 - $p->setEntry ( $o , "Refresh" , 0 , "System" , 1 , "" ) ; # Storing, don't show on RC
98 - $timestamp2 = getMySQL ( "cur" , "UNIX_TIMESTAMP(cur_timestamp)" , "cur_title=\"$pn\"" ) ;
 97+ $p->setEntry ( $o , "Refresh" , 0 , "System" , 1 , ",cur_timestamp=FROM_UNIXTIME(" . (time() - $timeOffset) . ")" ) ;
9998 return $ret;
10099 }
101100 }

Status & tagging log