* s~\t+$~~
[lhc/web/wiklou.git] / includes / SpecialWantedcategories.php
index a78fb08..b78e0ae 100644 (file)
@@ -35,24 +35,22 @@ class WantedCategoriesPage extends QueryPage {
                                cl_to as title,
                                COUNT(*) as value
                        FROM $categorylinks
-                       LEFT JOIN $page ON cl_to = page_title
-                       WHERE page_len IS NULL
+                       LEFT JOIN $page ON cl_to = page_title AND page_namespace = ". NS_CATEGORY ."
+                       WHERE page_title IS NULL
                        GROUP BY cl_to
                        ";
        }
-       
+
        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( NS_USER, $row->title ) );
-               $batch->execute( $wgLinkCache );
+                       $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+               $batch->execute();
 
                // Back to start for display
                if ( $db->numRows( $res ) > 0 )
@@ -65,11 +63,11 @@ class WantedCategoriesPage extends QueryPage {
 
                $nt = Title::makeTitle( $result->namespace, $result->title );
                $text = $wgContLang->convert( $nt->getText() );
-               
+
                $plink = $this->isCached() ?
                        $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) :
-                       $skin->makeBrokenLink( $nt->getText(), $text );
-               
+                       $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
+
                $nlinks = wfMsg( 'nlinks', $result->value );
                return "$plink ($nlinks)";
        }