r25115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25114‎ | r25115 | r25116 >
Date:09:28, 24 August 2007
Author:aaron
Status:old
Tags:
Comment:
*De-normalize stable rev id using page_ext_stable
*Change unreviewedpages query ('ORDER BY page_id' was still causing filesorts :( ) accordingly.
*Clean up $forUpdate
*Update some messages
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.pg.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.sql (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -236,8 +236,7 @@
237237 public static function getFlaggedRevText( $rev_id ) {
238238 $db = wfGetDB( DB_SLAVE );
239239 // Get the text from the flagged revisions table
240 - $result = $db->select(
241 - array('flaggedrevs','revision'),
 240+ $result = $db->select( array('flaggedrevs','revision'),
242241 array('fr_text'),
243242 array('fr_rev_id' => $rev_id, 'fr_rev_id = rev_id', 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
244243 __METHOD__,
@@ -257,8 +256,7 @@
258257 public static function getFlaggedRev( $rev_id ) {
259258 $db = wfGetDB( DB_SLAVE );
260259 // Skip deleted revisions
261 - $result = $db->select(
262 - array('flaggedrevs','revision'),
 260+ $result = $db->select( array('flaggedrevs','revision'),
263261 array('fr_namespace', 'fr_title', 'fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp'),
264262 array('fr_rev_id' => $rev_id, 'fr_rev_id = rev_id', 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
265263 __METHOD__ );
@@ -308,13 +306,13 @@
309307 }
310308
311309 /**
312 - * Get latest quality rev, if not, the latest reviewed one
 310+ * Get latest quality rev, if not, the latest reviewed one.
313311 * @param Title $title
314312 * @param bool $getText
315 - * @param bool $highPriority, use master DB?
 313+ * @param bool $forUpdate, use master DB and avoid using page_ext_stable?
316314 * @returns Row
317315 */
318 - public function getOverridingRev( $title=NULL, $getText=false, $highPriority=false ) {
 316+ public function getOverridingRev( $title=NULL, $getText=false, $forUpdate=false ) {
319317 if( is_null($title) )
320318 return null;
321319
@@ -322,25 +320,39 @@
323321 if( $getText )
324322 $selectColumns[] = 'fr_text';
325323
326 - $dbr = $highPriority ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
 324+ if( !$forUpdate ) {
 325+ $dbr = wfGetDB( DB_SLAVE );
 326+ // Skip deleted revisions
 327+ $result = $dbr->select( array('page', 'flaggedrevs', 'revision'),
 328+ $selectColumns,
 329+ array('page_namespace' => $title->getNamespace(), 'page_title' => $title->getDBkey(),
 330+ 'page_ext_stable = fr_rev_id', 'fr_rev_id = rev_id', 'fr_quality >= 1',
 331+ 'rev_page' => $title->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
 332+ __METHOD__,
 333+ array('LIMIT' => 1) );
 334+ if( !$row = $dbr->fetchObject($result) )
 335+ return null;
 336+
 337+ return $row;
 338+ }
 339+
 340+ $dbw = wfGetDB( DB_MASTER );
327341 // Look for quality revision
328 - $result = $dbr->select(
329 - array('flaggedrevs', 'revision'),
 342+ $result = $dbw->select( array('flaggedrevs', 'revision'),
330343 $selectColumns,
331344 array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), 'fr_quality >= 1',
332345 'fr_rev_id = rev_id', 'rev_page' => $title->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
333346 __METHOD__,
334347 array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) );
335348 // Do we have one? If not, try any reviewed revision...
336 - if( !$row = $dbr->fetchObject($result) ) {
337 - $result = $dbr->select(
338 - array('flaggedrevs', 'revision'),
 349+ if( !$row = $dbw->fetchObject($result) ) {
 350+ $result = $dbw->select( array('flaggedrevs', 'revision'),
339351 $selectColumns,
340352 array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(),
341353 'fr_rev_id = rev_id', 'rev_page' => $title->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
342354 __METHOD__,
343355 array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) );
344 - if( !$row = $dbr->fetchObject($result) )
 356+ if( !$row = $dbw->fetchObject($result) )
345357 return null;
346358 }
347359 return $row;
@@ -613,28 +625,20 @@
614626
615627 return true;
616628 }
617 -
618 - /**
619 - * Updates parser cache output to included needed versioning params.
 629+
 630+ /**
 631+ * @param Article $article
 632+ * @param Integer $rev_id, the stable version rev_id
 633+ * Updates the page_ext_stable and page_ext_reviewed fields
620634 */
621 - public static function maybeUpdateMainCache( $article, &$outputDone, &$pcache ) {
622 - global $wgUser, $action;
623 - // Only trigger on article view for content pages, not for protect/delete/hist
624 - if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' )
625 - return true;
626 - // User must have review rights
627 - if( !$wgUser->isAllowed( 'review' ) )
628 - return true;
629 -
630 - $parserCache =& ParserCache::singleton();
631 - $parserOutput = $parserCache->get( $article, $wgUser );
632 - if( $parserOutput ) {
633 - // Clear older, incomplete, cached versions
634 - // We need the IDs of templates and timestamps of images used
635 - if( !isset($parserOutput->mTemplateIds) || !isset($parserOutput->mImageSHA1Keys) )
636 - $article->mTitle->invalidateCache();
637 - }
638 - return true;
 635+ function updateArticleOn( $article, $rev_id ) {
 636+ $dbw = wfGetDB( DB_MASTER );
 637+ $dbw->update( 'page',
 638+ array('page_ext_stable' => $rev_id,
 639+ 'page_ext_reviewed' => ($article->getLatest() == $rev_id) ),
 640+ array('page_namespace' => $article->mTitle->getNamespace(),
 641+ 'page_title' => $article->mTitle->getDBkey() ),
 642+ __METHOD__ );
639643 }
640644
641645 public static function updateFromMove( $movePageForm, $oldtitle, $newtitle ) {
@@ -650,9 +654,9 @@
651655 /**
652656 * Clears cache for a page when revisiondelete is used
653657 */
654 - public static function articleLinksUpdate( $title ) {
 658+ public static function articleLinksUpdate( $title, $a=null, $b=null ) {
655659 global $wgUser, $wgParser;
656 -
 660+
657661 $article = new Article( $title );
658662 // Update the links tables as the stable version may now be the default page...
659663 $parserCache =& ParserCache::singleton();
@@ -672,14 +676,16 @@
673677 /**
674678 * Inject stable links on LinksUpdate
675679 */
676 - public function extraLinksUpdate( $linksUpdate ) {
 680+ public static function extraLinksUpdate( $linksUpdate ) {
 681+ global $wgFlaggedRevs;
 682+
677683 $fname = 'FlaggedRevs::extraLinksUpdate';
678684 wfProfileIn( $fname );
679685
680686 if( !$linksUpdate->mTitle->isContentPage() )
681687 return true;
682688 # Check if this page has a stable version
683 - $sv = $this->getOverridingRev( $linksUpdate->mTitle, true, true );
 689+ $sv = $wgFlaggedRevs->getOverridingRev( $linksUpdate->mTitle, true, true );
684690 if( !$sv )
685691 return true;
686692 # Parse the revision
@@ -688,6 +694,8 @@
689695 # Might as well update the stable cache while we're at it
690696 $article = new Article( $linksUpdate->mTitle );
691697 FlaggedRevs::updatePageCache( $article, $parserOutput );
 698+ # Update page fields
 699+ FlaggedRevs::updateArticleOn( $article, $sv->fr_rev_id );
692700 # Update the links tables to include these
693701 # We want the UNION of links between the current
694702 # and stable version. Therefore, we only care about
@@ -926,6 +934,8 @@
927935
928936 /**
929937 * Automatically review an edit and add a log entry in the review log.
 938+ * LinksUpdate was already called via edit operations, so the page
 939+ * fields will be up to date. This updates the stable version.
930940 */
931941 public static function autoReviewEdit( $article, $user, $text, $rev, $flags ) {
932942 global $wgParser, $parserCache, $wgFlaggedRevsAutoReview, $wgFlaggedRevs;
@@ -943,7 +953,8 @@
944954 'frt_value' => $value
945955 );
946956 }
947 - # Parse the text, we cannot rely on cache, may be out of date or not used
 957+ # Parse the text, we cannot rely on cache, may be out of date or not used.
 958+ # Also, we need the expanded text anyway.
948959 $options = new ParserOptions;
949960 $options->setTidy(true);
950961 $poutput = $wgParser->parse( $text, $article->mTitle, $options, true, true, $rev->getID() );
@@ -1015,6 +1026,8 @@
10161027
10171028 # Might as well save the stable cache
10181029 $wgFlaggedRevs->updatePageCache( $article, $poutput );
 1030+ # Update page fields
 1031+ FlaggedRevs::updateArticleOn( $article, $rev->getID() );
10191032 # Purge squid for this page only
10201033 $article->mTitle->purgeSquid();
10211034
@@ -1068,6 +1081,29 @@
10691082 }
10701083 return true;
10711084 }
 1085+
 1086+ /**
 1087+ * Updates parser cache output to included needed versioning params.
 1088+ */
 1089+ public static function maybeUpdateMainCache( $article, &$outputDone, &$pcache ) {
 1090+ global $wgUser, $action;
 1091+ // Only trigger on article view for content pages, not for protect/delete/hist
 1092+ if( !$article || !$article->exists() || !$article->mTitle->isContentPage() || $action !='view' )
 1093+ return true;
 1094+ // User must have review rights
 1095+ if( !$wgUser->isAllowed( 'review' ) )
 1096+ return true;
 1097+
 1098+ $parserCache =& ParserCache::singleton();
 1099+ $parserOutput = $parserCache->get( $article, $wgUser );
 1100+ if( $parserOutput ) {
 1101+ // Clear older, incomplete, cached versions
 1102+ // We need the IDs of templates and timestamps of images used
 1103+ if( !isset($parserOutput->mTemplateIds) || !isset($parserOutput->mImageSHA1Keys) )
 1104+ $article->mTitle->invalidateCache();
 1105+ }
 1106+ return true;
 1107+ }
10721108
10731109 #########
10741110
@@ -1612,17 +1648,52 @@
16131649 * Same params for the sake of inheritance
16141650 * @returns Row
16151651 */
1616 - function getOverridingRev( $title = NULL, $getText=false, $highPriority=false ) {
 1652+ function getOverridingRev( $title = NULL, $getText=false, $forUpdate=false ) {
16171653 global $wgTitle;
16181654
16191655 if( !is_null($title) && $title->getArticleID() != $wgTitle->getArticleID() )
16201656 return null; // wtf?
1621 -
1622 - if( !$row = $this->getLatestQualityRev( $getText ) ) {
1623 - if( !$row = $this->getLatestStableRev( $getText ) ) {
1624 - return null;
 1657+
 1658+ if( !$forUpdate ) {
 1659+ if( !$row = $this->getLatestQualityRev( $getText ) ) {
 1660+ if( !$row = $this->getLatestStableRev( $getText ) ) {
 1661+ $this->stablefound = false;
 1662+ return null;
 1663+ }
16251664 }
 1665+ $this->stablefound = true;
 1666+ $this->stablerev = $row;
 1667+ return $row;
16261668 }
 1669+ // Cached results available?
 1670+ if( isset($this->stablefound) ) {
 1671+ return ( $this->stablefound ) ? $this->stablerev : null;
 1672+ }
 1673+
 1674+ $selectColumns = array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp');
 1675+ if( $getText )
 1676+ $selectColumns[] = 'fr_text';
 1677+
 1678+ $dbw = wfGetDB( DB_MASTER );
 1679+ // Skip deleted revisions
 1680+ $result = $dbw->select( array('page', 'flaggedrevs', 'revision'),
 1681+ $selectColumns,
 1682+ array('page_namespace' => $wgTitle->getNamespace(), 'page_title' => $wgTitle->getDBkey(),
 1683+ 'page_ext_stable = fr_rev_id', 'fr_rev_id = rev_id', 'fr_quality >= 1',
 1684+ 'rev_page' => $wgTitle->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
 1685+ __METHOD__,
 1686+ array('LIMIT' => 1) );
 1687+
 1688+ // Do we have one?
 1689+ if( $row = $dbw->fetchObject($result) ) {
 1690+ $this->stablefound = true;
 1691+ $this->stablerev = $row;
 1692+ return $row;
 1693+ } else {
 1694+ $this->stablefound = false;
 1695+ return null;
 1696+ }
 1697+
16271698 return $row;
16281699 }
16291700
@@ -1636,8 +1707,8 @@
16371708 function getLatestQualityRev( $getText=false ) {
16381709 global $wgTitle;
16391710 // Cached results available?
1640 - if( isset($this->stablefound) ) {
1641 - return ( $this->stablefound ) ? $this->stablerev : null;
 1711+ if( isset($this->qualityfound) ) {
 1712+ return ( $this->qualityfound ) ? $this->qualityrev : null;
16421713 }
16431714
16441715 $selectColumns = array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp');
@@ -1646,8 +1717,7 @@
16471718
16481719 $dbr = wfGetDB( DB_SLAVE );
16491720 // Skip deleted revisions
1650 - $result = $dbr->select(
1651 - array('flaggedrevs', 'revision'),
 1721+ $result = $dbr->select( array('flaggedrevs', 'revision'),
16521722 $selectColumns,
16531723 array('fr_namespace' => $wgTitle->getNamespace(), 'fr_title' => $wgTitle->getDBkey(), 'fr_quality >= 1',
16541724 'fr_rev_id = rev_id', 'rev_page' => $wgTitle->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
@@ -1656,11 +1726,11 @@
16571727
16581728 // Do we have one?
16591729 if( $row = $dbr->fetchObject($result) ) {
1660 - $this->stablefound = true;
1661 - $this->stablerev = $row;
 1730+ $this->qualityfound = true;
 1731+ $this->qualityrev = $row;
16621732 return $row;
16631733 } else {
1664 - $this->stablefound = false;
 1734+ $this->qualityfound = false;
16651735 return null;
16661736 }
16671737 }
@@ -1686,8 +1756,7 @@
16871757
16881758 $dbr = wfGetDB( DB_SLAVE );
16891759 // Skip deleted revisions
1690 - $result = $dbr->select(
1691 - array('flaggedrevs', 'revision'),
 1760+ $result = $dbr->select( array('flaggedrevs', 'revision'),
16921761 $selectColumns,
16931762 array('fr_namespace' => $wgTitle->getNamespace(), 'fr_title' => $wgTitle->getDBkey(),
16941763 'fr_rev_id = rev_id', 'rev_page' => $wgTitle->getArticleID(), 'rev_deleted & '.Revision::DELETED_TEXT.' = 0'),
@@ -1764,7 +1833,11 @@
17651834 # Adds table link references to include ones from the stable version
17661835 $wgHooks['LinksUpdateConstructed'][] = array($wgFlaggedArticle, 'extraLinksUpdate');
17671836 # If a stable version is hidden, move to the next one if possible, and update things
 1837+# Check on undelete/delete too
 1838+$wgHooks['ArticleUndelete'][] = array($wgFlaggedArticle, 'articleLinksUpdate');
 1839+$wgHooks['ArticleDelete'][] = array($wgFlaggedArticle, 'articleLinksUpdate');
17681840 $wgHooks['ArticleRevisionVisiblityUpdates'][] = array($wgFlaggedArticle, 'articleLinksUpdate');
 1841+$wgHooks['ArticleMergeComplete'][] = array($wgFlaggedArticle, 'articleLinksUpdate');
17691842 # Update our table NS/Titles when things are moved
17701843 $wgHooks['SpecialMovepageAfterMove'][] = array($wgFlaggedArticle, 'updateFromMove');
17711844 # Parser hooks, selects the desired images/templates
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.sql
@@ -61,3 +61,10 @@
6262 INDEX (fi_rev_id,fi_name,fi_img_timestamp),
6363 INDEX (fi_rev_id,fi_name,fi_img_sha1)
6464 ) TYPE=InnoDB;
 65+
 66+-- Add page_ext_stable column, similar to page_latest
 67+-- Add page_ext_upd columns, a boolean for up to date stable versions
 68+ALTER TABLE /*$wgDBprefix*/page
 69+ ADD page_ext_reviewed bool NULL,
 70+ ADD page_ext_stable int(10) NULL,
 71+ ADD INDEX ext_namespace_reviewed (page_namespace,page_is_redirect,page_ext_reviewed,page_id);
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage_body.php
@@ -10,7 +10,7 @@
1111 {
1212
1313 function Revisionreview() {
14 - SpecialPage::SpecialPage('Revisionreview', 'review');
 14+ SpecialPage::SpecialPage( 'Revisionreview', 'review' );
1515 }
1616
1717 function execute( $par ) {
@@ -279,7 +279,7 @@
280280 */
281281 function approveRevision( $rev=NULL, $notes='' ) {
282282 global $wgUser, $wgFlaggedRevsWatch, $wgParser;
283 -
 283+ // Skip null edits
284284 if( is_null($rev) )
285285 return false;
286286 // Get the page this corresponds to
@@ -299,8 +299,7 @@
300300 'frt_value' => $value
301301 );
302302 }
303 -
304 - // Hack, our template version pointers
 303+ // Our template version pointers
305304 $tmpset = $templates = array();
306305 $templateMap = explode('#',trim($this->templateParams) );
307306 foreach( $templateMap as $template ) {
@@ -324,7 +323,7 @@
325324 'ft_tmp_rev_id' => $rev_id
326325 );
327326 }
328 - // Hack, our image version pointers
 327+ // Our image version pointers
329328 $imgset = $images = array();
330329 $imageMap = explode('#',trim($this->imageParams) );
331330 foreach( $imageMap as $image ) {
@@ -353,7 +352,7 @@
354353
355354 $dbw = wfGetDB( DB_MASTER );
356355 $dbw->begin();
357 - // Update our versioning pointers
 356+ // Update our versioning params
358357 if( !empty( $tmpset ) ) {
359358 $dbw->replace( 'flaggedtemplates', array( array('ft_rev_id','ft_namespace','ft_title') ), $tmpset,
360359 __METHOD__ );
@@ -430,7 +429,7 @@
431430 $dbw = wfGetDB( DB_MASTER );
432431 // Delete from table
433432 $dbw->delete( 'flaggedrevs', array( 'fr_rev_id' => $row->fr_rev_id ) );
434 - // Wipe versioning pointers
 433+ // Wipe versioning params
435434 $dbw->delete( 'flaggedtemplates', array( 'ft_rev_id' => $row->fr_rev_id ) );
436435 $dbw->delete( 'flaggedimages', array( 'fi_rev_id' => $row->fr_rev_id ) );
437436 // And the flags...
@@ -765,8 +764,8 @@
766765 function getName() {
767766 return 'UnreviewedPages';
768767 }
769 -
770 - function isExpensive( ) { return true; }
 768+ # Note: updateSpecialPages doesn't support extensions, but this is fast anyway
 769+ function isExpensive( ) { return false; }
771770 function isSyndicated() { return false; }
772771
773772 function getPageHeader( ) {
@@ -777,40 +776,29 @@
778777 global $wgContentNamespaces;
779778
780779 list($page,$flaggedrevs,$categorylinks) = $dbr->tableNamesN('page','flaggedrevs','categorylinks');
 780+ # Must be a content page...
 781+ if( is_null($namespace) || !in_array($namespace,$wgContentNamespaces) ) {
 782+ $where = 'page_namespace IN(' . implode(',',$wgContentNamespaces) . ') ';
 783+ } else {
 784+ $where = "page_namespace={$namespace} ";
 785+ }
 786+ # No redirects
 787+ $where .= "AND page_is_redirect=0 ";
781788 # We don't like filesorts, so the query methods here will be very different
782789 if( !$showOutdated ) {
783 - # Must be a content page...
784 - if( is_null($namespace) || !in_array($namespace,$wgContentNamespaces) ) {
785 - $ns = 'page_namespace IN(' . implode(',',$wgContentNamespaces) . ')';
786 - } else {
787 - $ns = "page_namespace={$namespace}";
788 - }
789 - $where = "$ns AND fr_rev_id IS NULL AND page_is_redirect=0";
790 - $sql = "SELECT page_namespace AS ns,page_title AS title,page_len FROM $page ";
791 - if( $category ) {
792 - $category = str_replace( ' ', '_', $dbr->strencode($category) );
793 - $where .= " AND cl_from IS NOT NULL";
794 - $sql .= "LEFT JOIN $categorylinks ON (cl_from = page_id AND cl_to = '{$category}') ";
795 - }
796 - $sql .= "LEFT JOIN $flaggedrevs ON (page_namespace = fr_namespace AND page_title = fr_title)
797 - WHERE ($where) ";
 790+ $where .= "AND page_ext_reviewed IS NULL";
798791 } else {
799 - # Must be a content page...
800 - if( is_null($namespace) || !in_array($namespace,$wgContentNamespaces) ) {
801 - $ns = 'fr_namespace IN(' . implode(',',$wgContentNamespaces) . ')';
802 - } else {
803 - $ns = "fr_namespace={$namespace}";
804 - }
805 - $where = "$ns AND page_is_redirect=0";
806 - $sql = "SELECT fr_namespace AS ns,fr_title AS title,page_len,MAX(fr_rev_id) as oldid FROM $flaggedrevs ";
807 - $sql .= "LEFT JOIN $page ON (fr_namespace = page_namespace AND fr_title = page_title) ";
808 - if( $category ) {
809 - $category = str_replace( ' ', '_', $dbr->strencode($category) );
810 - $where .= " AND cl_from IS NOT NULL";
811 - $sql .= "LEFT JOIN $categorylinks ON (cl_from = page_id AND cl_to = '{$category}') ";
812 - }
813 - $sql .= "WHERE ($where) GROUP BY fr_namespace,fr_title HAVING MAX(page_latest) > MAX(fr_rev_id)";
 792+ $where .= "AND page_ext_reviewed = 0";
814793 }
 794+ $sql = "SELECT page_namespace AS ns,page_title AS title,page_len,page_ext_stable FROM $page ";
 795+ # Filter by category
 796+ if( $category ) {
 797+ $category = str_replace( ' ', '_', $dbr->strencode($category) );
 798+ $where .= " AND cl_from IS NOT NULL";
 799+ $sql .= "LEFT JOIN $categorylinks ON (cl_from = page_id AND cl_to = '{$category}') ";
 800+ }
 801+ $sql .= "WHERE ($where) ";
 802+
815803 return $sql;
816804 }
817805
@@ -836,8 +824,9 @@
837825 else
838826 $stxt = ' <small>' . wfMsgHtml('historysize', $wgLang->formatNum( $size ) ) . '</small>';
839827 }
840 - if( isset($result->oldid) )
841 - $review = ' ('.$skin->makeKnownLinkObj( $title, wfMsg('unreviewed-diff'), "diff=cur&oldid={$result->oldid}" ).')';
 828+ if( $result->page_ext_stable )
 829+ $review = ' ('.$skin->makeKnownLinkObj( $title, wfMsg('unreviewed-diff'),
 830+ "diff=cur&oldid={$result->page_ext_stable}&editreview=1" ).')';
842831
843832 return( "{$link} {$stxt} {$review}" );
844833 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.i18n.php
@@ -114,11 +114,10 @@
115115
116116 'unreviewedpages' => 'Unreviewed pages',
117117 'viewunreviewed' => 'List unreviewed content pages',
118 - 'unreviewed-outdated' => 'Show only pages that have revisions made since the last review.',
 118+ 'unreviewed-outdated' => 'Show only pages that have unreviewed revisions made to the stable version.',
119119 'unreviewed-category' => 'Category:',
120 - 'unreviewed-diff' => 'Unreviewed changes',
121 - 'unreviewed-list' => 'This page lists articles that have not yet been reviewed or have unreviewed revisions. Note pages
122 - with out of date "quality" revisions will not be listed here if the current revision is "sighted".',
 120+ 'unreviewed-diff' => 'Changes',
 121+ 'unreviewed-list' => 'This page lists articles that have not yet been reviewed or have unreviewed revisions.',
123122 );
124123
125124 /* Arabic (Meno25) */
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.pg.sql
@@ -42,4 +42,9 @@
4343 CREATE INDEX fi_rev_name_time ON flaggedimages (fi_rev_id,fi_name,fi_img_timestamp);
4444 CREATE INDEX fi_rev_img_sha1 ON flaggedimages (fi_rev_id,fi_name,fi_img_sha1);
4545
 46+ALTER TABLE page
 47+ ADD page_ext_reviewed bool NULL,
 48+ ADD page_ext_stable int(10) NULL;
 49+CREATE INDEX ext_namespace_reviewed ON page (page_namespace,page_is_redirect,page_ext_reviewed,page_id);
 50+
4651 COMMIT;

Status & tagging log