r12521 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12520‎ | r12521 | r12522 >
Date:15:59, 8 January 2006
Author:magnus_manske
Status:old
Tags:
Comment:
Fixing bug 2082: Related changes views (Special:Recentchangeslinked) do not indicate one's watched page
Modified paths:
  • /trunk/phase3/includes/SpecialRecentchangeslinked.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialRecentchangeslinked.php
@@ -62,8 +62,10 @@
6363 $cmq = 'AND rc_minor=0';
6464 } else { $cmq = ''; }
6565
66 - extract( $dbr->tableNames( 'recentchanges', 'categorylinks', 'pagelinks', 'revision', 'page' ) );
 66+ extract( $dbr->tableNames( 'recentchanges', 'categorylinks', 'pagelinks', 'revision', 'page' , "watchlist" ) );
6767
 68+ $uid = $wgUser->getID();
 69+
6870 // If target is a Category, use categorylinks and invert from and to
6971 if( $nt->getNamespace() == NS_CATEGORY ) {
7072 $catkey = $dbr->addQuotes( $nt->getDBKey() );
@@ -82,7 +84,9 @@
8385 rc_new,
8486 rc_patrolled,
8587 rc_type
 88+" . ($uid ? ",wl_user" : "") . "
8689 FROM $categorylinks, $recentchanges
 90+" . ($uid ? "LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") . "
8791 WHERE rc_timestamp > '{$cutoff}'
8892 {$cmq}
8993 AND cl_from=rc_cur_id
@@ -110,7 +114,9 @@
111115 rc_new,
112116 rc_patrolled,
113117 rc_type
114 - FROM $pagelinks, $recentchanges
 118+" . ($uid ? ",wl_user" : "") . "
 119+ FROM $pagelinks, $recentchanges
 120+" . ($uid ? " LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") . "
115121 WHERE rc_timestamp > '{$cutoff}'
116122 {$cmq}
117123 AND pl_namespace=rc_namespace
@@ -143,10 +149,12 @@
144150 if ( 0 == $count ) { break; }
145151 $obj = $dbr->fetchObject( $res );
146152 --$count;
 153+# print_r ( $obj ) ;
 154+# print "<br/>\n" ;
147155
148156 $rc = RecentChange::newFromRow( $obj );
149157 $rc->counter = $counter++;
150 - $s .= $list->recentChangesLine( $rc );
 158+ $s .= $list->recentChangesLine( $rc , !empty( $obj->wl_user) );
151159 --$limit;
152160 }
153161 $s .= $list->endRecentChangesList();

Status & tagging log