diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php
index 1a3efca0cce..34ebc6a832f 100644
--- a/includes/SpecialCategories.php
+++ b/includes/SpecialCategories.php
@@ -1,45 +1,43 @@
makeLink( $wgLang->getNsText( NS_CATEGORY ).":".$result->title, $result->title );
+ }
+}
+
function wfSpecialCategories()
{
- global $wgUser, $wgOut , $wgLang;
+ list( $limit, $offset ) = wfCheckLimits();
- $sk = $wgUser->getSkin() ;
- $sc = "Special:Categories" ;
+ $cap = new CategoriesPage();
- # List all existant categories.
- # Note: this list could become *very large*
- $r = "
\n" ;
- $sql = "SELECT cur_title FROM cur WHERE cur_namespace=".Namespace::getCategory() ;
- $res = wfQuery ( $sql, DB_READ ) ;
- while ( $x = wfFetchObject ( $res ) ) {
- $title =& Title::makeTitle( NS_CATEGORY, $x->cur_title );
- $r .= "- " ;
- $r .= $sk->makeKnownLinkObj ( $title, $title->getText() ) ;
- $r .= "
\n" ;
- }
- wfFreeResult ( $res ) ;
- $r .= "
\n" ;
-
- $r .= "
\n" ;
-
- # Links to category pages that haven't been created.
- # FIXME: This could be slow if there are a lot, but the title index should
- # make it reasonably snappy since we're using an index.
- $cat = wfStrencode( $wgLang->getNsText( NS_CATEGORY ) );
- $sql = "SELECT DISTINCT bl_to FROM brokenlinks WHERE bl_to LIKE \"{$cat}:%\"" ;
- $res = wfQuery ( $sql, DB_READ ) ;
- $r .= "\n" ;
- while ( $x = wfFetchObject ( $res ) ) {
- $title = Title::newFromDBkey( $x->bl_to );
- $r .= "- " ;
- $r .= $sk->makeBrokenLinkObj( $title, $title->getText() ) ;
- $r .= "
\n" ;
- }
- wfFreeResult ( $res ) ;
- $r .= "
\n" ;
-
- $wgOut->addHTML ( $r ) ;
+ return $cap->doQuery( $offset, $limit );
}
?>