* brion, the preprocessResults() function you removed on the last commit is
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 29 Oct 2005 02:47:49 +0000 (02:47 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sat, 29 Oct 2005 02:47:49 +0000 (02:47 +0000)
  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

index e21fd99..7a35703 100644 (file)
@@ -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;