- $use_index = $dbr->useIndexClause( $x );
- $sql = "SELECT
- page_namespace,page_title,rev_comment, page_id,
- rev_user,rev_user_text,rev_timestamp,rev_minor_edit,rev_id,page_is_new,wl_notificationtimestamp
- FROM $watchlist,$page,$revision $use_index
- WHERE wl_user=$uid
- $andHideOwn
- AND $z
- AND wl_title=page_title
- AND page_latest=rev_id
- $docutoff
- ORDER BY rev_timestamp DESC";
-
+ $sql = "SELECT
+ rc_namespace page_namespace,rc_title page_title,
+ rc_comment rev_comment, rc_cur_id page_id,
+ rc_user rev_user,rc_user_text rev_user_text,
+ rc_timestamp rev_timestamp,rc_minor rev_minor_edit,
+ rc_this_oldid rev_id,
+ rc_last_oldid,
+ rc_new page_is_new,wl_notificationtimestamp
+ FROM $watchlist,$recentchanges,$page
+ WHERE wl_user=$uid
+ AND wl_namespace=rc_namespace
+ AND wl_title=rc_title
+ AND rc_timestamp > '$cutoff'
+ AND rc_cur_id=page_id
+ $andHideOwn
+ $andHideBotsOptional
+ ORDER BY rc_timestamp DESC";