$cmq = 'AND rc_minor=0';
} else { $cmq = ''; }
- extract( $dbr->tableNames( 'recentchanges', 'categorylinks', 'pagelinks', 'revision', 'page' ) );
+ extract( $dbr->tableNames( 'recentchanges', 'categorylinks', 'pagelinks', 'revision', 'page' , "watchlist" ) );
+
+ $uid = $wgUser->getID();
// If target is a Category, use categorylinks and invert from and to
if( $nt->getNamespace() == NS_CATEGORY ) {
rc_new,
rc_patrolled,
rc_type
+" . ($uid ? ",wl_user" : "") . "
FROM $categorylinks, $recentchanges
+" . ($uid ? "LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") . "
WHERE rc_timestamp > '{$cutoff}'
{$cmq}
AND cl_from=rc_cur_id
rc_new,
rc_patrolled,
rc_type
- FROM $pagelinks, $recentchanges
+" . ($uid ? ",wl_user" : "") . "
+ FROM $pagelinks, $recentchanges
+" . ($uid ? " LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") . "
WHERE rc_timestamp > '{$cutoff}'
{$cmq}
AND pl_namespace=rc_namespace
if ( 0 == $count ) { break; }
$obj = $dbr->fetchObject( $res );
--$count;
+# print_r ( $obj ) ;
+# print "<br/>\n" ;
$rc = RecentChange::newFromRow( $obj );
$rc->counter = $counter++;
- $s .= $list->recentChangesLine( $rc );
+ $s .= $list->recentChangesLine( $rc , !empty( $obj->wl_user) );
--$limit;
}
$s .= $list->endRecentChangesList();