From: Ævar Arnfjörð Bjarmason Date: Sat, 29 Oct 2005 02:47:49 +0000 (+0000) Subject: * brion, the preprocessResults() function you removed on the last commit is X-Git-Tag: 1.6.0~1279 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=f9a8da4df6551563ce70adea4d74c160897e1302;p=lhc%2Fweb%2Fwiklou.git * brion, the preprocessResults() function you removed on the last commit is there so that one large query gets run to check for the existance of pages rather than up to 500 individual queries, of course it didn't work but that's another issue alltogather.. --- diff --git a/includes/SpecialWantedcategories.php b/includes/SpecialWantedcategories.php index e21fd9972a..7a35703bba 100644 --- a/includes/SpecialWantedcategories.php +++ b/includes/SpecialWantedcategories.php @@ -43,6 +43,23 @@ class WantedCategoriesPage extends QueryPage { function sortDescending() { return true; } + /** + * Fetch user page links and cache their existence + */ + function preprocessResults( &$db, &$res ) { + global $wgLinkCache; + + $batch = new LinkBatch; + while ( $row = $db->fetchObject( $res ) ) + $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) ); + $batch->execute( $wgLinkCache ); + + // Back to start for display + if ( $db->numRows( $res ) > 0 ) + // If there are no rows we get an error seeking. + $db->dataSeek( $res, 0 ); + } + function formatResult( $skin, $result ) { global $wgContLang;