r10025 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10024‎ | r10025 | r10026 >
Date:09:59, 9 July 2005
Author:midom
Status:old
Tags:
Comment:
* add table name magic
* remove hardcoded number of days, use wgRCMaxAge
Modified paths:
  • /branches/REL1_4/phase3/includes/SpecialWatchlist.php (modified) (history)

Diff [purge]

Index: branches/REL1_4/phase3/includes/SpecialWatchlist.php
@@ -17,6 +17,7 @@
1818 function wfSpecialWatchlist() {
1919 global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc, $wgRequest;
2020 global $wgUseWatchlistCache, $wgWLCacheTimeout, $wgDBname;
 21+ global $wgRCMaxAge;
2122 $fname = "wfSpecialWatchlist";
2223
2324 $wgOut->setPagetitle( wfMsg( "watchlist" ) );
@@ -146,14 +147,14 @@
147148 # through the time-sorted page list checking for watched items.
148149
149150 # Up estimate of watched items by 15% to compensate for talk pages...
150 - if( $cutoff && ( $days <= 28 ) ) {
 151+ if( $cutoff && ( $days <= ( $wgRCMaxAge / 86400 ) ) ) {
151152 $docutoff = "AND rc_timestamp > '$cutoff'";
152153 $sql = "SELECT
153154 rc_namespace cur_namespace, rc_title cur_title, rc_comment cur_comment,
154155 rc_cur_id cur_id, rc_user cur_user,
155156 rc_user_text cur_user_text, rc_timestamp cur_timestamp,
156157 rc_minor cur_minor_edit, rc_new cur_is_new
157 - FROM watchlist,recentchanges
 158+ FROM $watchlist,$recentchanges
158159 WHERE wl_user=$uid AND wl_namespace=rc_namespace AND wl_title=rc_title AND rc_this_oldid=0
159160 $docutoff
160161 UNION SELECT
@@ -161,7 +162,7 @@
162163 rc_cur_id cur_id, rc_user cur_user,
163164 rc_user_text cur_user_text, rc_timestamp cur_timestamp,
164165 rc_minor cur_minor_edit, rc_new cur_is_new
165 - FROM watchlist,recentchanges
 166+ FROM $watchlist,$recentchanges
166167 WHERE wl_user=$uid AND wl_namespace+1=rc_namespace AND wl_title=rc_title AND rc_this_oldid=0
167168 $docutoff
168169 ORDER BY cur_timestamp DESC

Status & tagging log