From f9a8da4df6551563ce70adea4d74c160897e1302 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 29 Oct 2005 02:47:49 +0000 Subject: [PATCH] * 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.. --- includes/SpecialWantedcategories.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; -- 2.20.1