Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.php |
— | — | @@ -895,10 +895,18 @@ |
896 | 896 | else |
897 | 897 | $stxt = ' <small>' . wfMsgHtml('historysize', $wgLang->formatNum( $size ) ) . '</small>'; |
898 | 898 | } |
899 | | - $unwatched = is_null($result->wl_user) ? wfMsgHtml("unreviewed-unwatched") : ""; |
| 899 | + $unwatched = !self::isWatched( $title ) ? " ".wfMsgHtml("unreviewed-unwatched") : ""; |
900 | 900 | |
901 | 901 | return( "<li>{$link} {$stxt} {$review}{$unwatched}</li>" ); |
902 | 902 | } |
| 903 | + |
| 904 | + public static function isWatched( $title ) { |
| 905 | + $dbr = wfGetDB( DB_SLAVE ); |
| 906 | + $watched = $dbr->selectRow( 'watchlist', '1', |
| 907 | + array( 'wl_namespace' => $title->getNamespace(), 'wl_title' => $title->getDBKey() ), |
| 908 | + __METHOD__ ); |
| 909 | + return $watched; |
| 910 | + } |
903 | 911 | } |
904 | 912 | |
905 | 913 | /** |
— | — | @@ -985,8 +993,7 @@ |
986 | 994 | } |
987 | 995 | $options['LIMIT'] = intval( $limit ); |
988 | 996 | # Get table names |
989 | | - list($flaggedpages,$page,$categorylinks,$watchlist) = |
990 | | - $this->mDb->tableNamesN('flaggedpages','page','categorylinks','watchlist'); |
| 997 | + list($flaggedpages,$page,$categorylinks) = $this->mDb->tableNamesN('flaggedpages','page','categorylinks'); |
991 | 998 | # Are we filtering via category? |
992 | 999 | if( in_array('categorylinks',$tables) ) { |
993 | 1000 | $index = $this->mDb->useIndexClause('cl_sortkey'); // *sigh*... |
— | — | @@ -995,11 +1002,9 @@ |
996 | 1003 | $index = $this->mDb->useIndexClause('name_title'); // *sigh*... |
997 | 1004 | $fromClause = "$page $index"; |
998 | 1005 | } |
999 | | - $fields[] = 'wl_user'; |
1000 | 1006 | $sql = "SELECT ".implode(',',$fields). |
1001 | 1007 | " FROM $fromClause". |
1002 | 1008 | " LEFT JOIN $flaggedpages ON (fp_page_id=page_id)". |
1003 | | - " LEFT JOIN $watchlist ON (wl_namespace=page_namespace AND wl_title=page_title)". |
1004 | 1009 | " WHERE ".$this->mDb->makeList($conds,LIST_AND). |
1005 | 1010 | " ORDER BY ".$options['ORDER BY']." LIMIT ".$options['LIMIT']; |
1006 | 1011 | # Do query! |
— | — | @@ -1081,8 +1086,10 @@ |
1082 | 1087 | $hist = $this->skin->makeKnownLinkObj( $title, wfMsg('hist'), |
1083 | 1088 | "action=history" ); |
1084 | 1089 | $quality = $result->fp_quality ? wfMsgHtml('oldreviewedpages-quality') : wfMsgHtml('oldreviewedpages-stable'); |
| 1090 | + |
| 1091 | + $unwatched = !UnreviewedPages::isWatched( $title ) ? " ".wfMsgHtml("unreviewed-unwatched") : ""; |
1085 | 1092 | |
1086 | | - return( "<li>{$link} {$stxt} ({$review}) ({$hist}) <strong>[{$quality}]</strong></li>" ); |
| 1093 | + return( "<li>{$link} {$stxt} ({$review}) ({$hist}) <strong>[{$quality}]</strong>{$unwatched}</li>" ); |
1087 | 1094 | } |
1088 | 1095 | } |
1089 | 1096 | |