Index: trunk/extensions/FlaggedRevs/specialpages/OldReviewedPages_body.php |
— | — | @@ -213,8 +213,9 @@ |
214 | 214 | 'diff=cur&oldid='.intval($row->stable).'&diffonly=0' ); |
215 | 215 | # Show quality level if there are several |
216 | 216 | if ( FlaggedRevs::qualityVersions() ) { |
217 | | - $quality = $row->quality ? |
218 | | - wfMsgHtml( 'revreview-lev-quality' ) : wfMsgHtml( 'revreview-lev-basic' ); |
| 217 | + $quality = $row->quality |
| 218 | + ? wfMsgHtml( 'revreview-lev-quality' ) |
| 219 | + : wfMsgHtml( 'revreview-lev-basic' ); |
219 | 220 | $quality = " <b>[{$quality}]</b>"; |
220 | 221 | } |
221 | 222 | # Is anybody watching? |
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php |
— | — | @@ -173,19 +173,26 @@ |
174 | 174 | |
175 | 175 | public function formatRow( $row ) { |
176 | 176 | global $wgLang, $wgUser, $wgMemc; |
177 | | - |
178 | | - $css = $stxt = $quality = $underReview = ''; |
179 | | - $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
| 177 | + $css = $quality = $tags = $underReview = ''; |
| 178 | + |
| 179 | + $title = Title::newFromRow( $row ); |
180 | 180 | $link = $this->skin->makeKnownLinkObj( $title ); |
181 | 181 | $review = $this->skin->makeKnownLinkObj( $title, |
182 | 182 | wfMsg( 'oldreviewed-diff' ), |
183 | | - 'diff=cur&oldid='.intval($row->stable).'&diffonly=0' ); |
| 183 | + 'diff=cur&oldid=' . intval($row->stable) . '&diffonly=0' ); |
184 | 184 | # Show quality level if there are several |
185 | 185 | if ( FlaggedRevs::qualityVersions() ) { |
186 | | - $quality = $row->quality ? |
187 | | - wfMsgHtml( 'revreview-lev-quality' ) : wfMsgHtml( 'revreview-lev-basic' ); |
| 186 | + $quality = $row->quality |
| 187 | + ? wfMsgHtml( 'revreview-lev-quality' ) |
| 188 | + : wfMsgHtml( 'revreview-lev-basic' ); |
188 | 189 | $quality = " <b>[{$quality}]</b>"; |
189 | 190 | } |
| 191 | + # What are the tags? |
| 192 | + $dbTags = self::getRevisionTags( $title->getArticleID(), $row->stable ); |
| 193 | + if ( $dbTags ) { |
| 194 | + $tags = htmlspecialchars( implode( ', ', $dbTags ) ); |
| 195 | + $tags = ' <b>' . wfMsgHtml( 'parentheses', $tags ) . '</b>'; |
| 196 | + } |
190 | 197 | # Is anybody watching? |
191 | 198 | if ( !$this->including() && $wgUser->isAllowed( 'unreviewedpages' ) ) { |
192 | 199 | $uw = UnreviewedPages::usersWatching( $title ); |
— | — | @@ -222,32 +229,34 @@ |
223 | 230 | } |
224 | 231 | $key = wfMemcKey( 'stableDiffs', 'underReview', $row->stable, $row->page_latest ); |
225 | 232 | # Show if a user is looking at this page |
226 | | - if ( ( $val = $wgMemc->get( $key ) ) ) { |
227 | | - $underReview = " <b class='fr-under-review'>" . |
228 | | - wfMsgHtml( 'oldreviewedpages-viewing' ) . '</b>'; |
| 233 | + if ( $wgMemc->get( $key ) ) { |
| 234 | + $underReview = ' <span class="fr-under-review">' . |
| 235 | + wfMsgHtml( 'oldreviewedpages-viewing' ) . '</span>'; |
229 | 236 | } |
230 | 237 | |
231 | | - return( "<li{$css}>{$link} {$stxt} ({$review}) <i>{$age}</i>" . |
232 | | - "{$quality}{$watching}{$underReview}</li>" ); |
| 238 | + return( "<li{$css}>{$link} ({$review}) <i>{$age}</i>" . |
| 239 | + "{$quality}{$tags}{$watching}{$underReview}</li>" ); |
233 | 240 | } |
234 | 241 | |
235 | 242 | /** |
236 | | - * Get the timestamp of the next revision |
237 | | - * |
238 | | - * @param integer $revision Revision ID. Get the revision that was after this one. |
239 | | - * @param integer $page, page ID |
| 243 | + * Get the tags of the revisions of a page after a certain rev |
| 244 | + * @param integer $pageId, page ID |
| 245 | + * @param integer $revId, rev ID |
240 | 246 | */ |
241 | | - protected function getNextRevisionTimestamp( $revision, $page ) { |
| 247 | + protected static function getRevisionTags( $pageId, $revId ) { |
| 248 | + $tags = array(); |
242 | 249 | $dbr = wfGetDB( DB_SLAVE ); |
243 | | - |
244 | | - return $dbr->selectField( 'revision', 'rev_timestamp', |
245 | | - array( |
246 | | - 'rev_page' => $page, |
247 | | - 'rev_id > ' . intval( $revision ) |
248 | | - ), |
249 | | - __METHOD__, |
250 | | - array( 'ORDER BY' => 'rev_id' ) |
| 250 | + $res = $dbr->select( |
| 251 | + array( 'revision', 'change_tag' ), |
| 252 | + 'DISTINCT(ct_tag)', // unique tags |
| 253 | + array( 'rev_page' => $pageId, 'rev_id > ' . intval($revId), |
| 254 | + 'rev_id = ct_rev_id' ), |
| 255 | + __METHOD__ |
251 | 256 | ); |
| 257 | + foreach( $res as $row ) { |
| 258 | + $tags[] = $row->ct_tag; |
| 259 | + } |
| 260 | + return $tags; |
252 | 261 | } |
253 | 262 | |
254 | 263 | protected static function getLineClass( $hours, $uw ) { |
— | — | @@ -293,7 +302,8 @@ |
294 | 303 | $conds = $this->mConds; |
295 | 304 | $tables = array( 'revision', 'change_tag', 'page' ); |
296 | 305 | $fields = array( 'page_namespace' , 'page_title', 'page_latest' ); |
297 | | - $ctIndex = $wgOldChangeTagsIndex ? 'ct_rev_id' : 'change_tag_rev_tag'; |
| 306 | + $ctIndex = $wgOldChangeTagsIndex ? |
| 307 | + 'ct_rev_id' : 'change_tag_rev_tag'; |
298 | 308 | # Show outdated "stable" pages |
299 | 309 | if ( $this->level < 0 ) { |
300 | 310 | $fields[] = 'fp_stable AS stable'; |
— | — | @@ -308,7 +318,8 @@ |
309 | 319 | $conds['ct_tag'] = $this->tag; |
310 | 320 | } |
311 | 321 | $conds[] = 'page_id = fp_page_id'; |
312 | | - $useIndex = array( 'flaggedpages' => 'fp_pending_since', 'change_tag' => $ctIndex ); |
| 322 | + $useIndex = array( |
| 323 | + 'flaggedpages' => 'fp_pending_since', 'change_tag' => $ctIndex ); |
313 | 324 | # Filter by category |
314 | 325 | if ( $this->category != '' ) { |
315 | 326 | array_unshift( $tables, 'categorylinks' ); // order matters |
— | — | @@ -331,8 +342,8 @@ |
332 | 343 | $conds[] = 'rev_id > fpp_rev_id'; |
333 | 344 | $conds[] = 'rev_id = ct_rev_id'; |
334 | 345 | $conds['ct_tag'] = $this->tag; |
335 | | - $useIndex = array( 'flaggedpage_pending' => 'fpp_quality_pending', |
336 | | - 'change_tag' => $ctIndex ); |
| 346 | + $useIndex = array( |
| 347 | + 'flaggedpage_pending' => 'fpp_quality_pending', 'change_tag' => $ctIndex ); |
337 | 348 | # Filter by review level |
338 | 349 | $conds['fpp_quality'] = $this->level; |
339 | 350 | # Filter by category |