From a8b64191b100b9d5ba57cc742e2edd4683362c97 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Tue, 1 Jun 2004 21:50:32 +0000 Subject: [PATCH] based on QueryPage, fixed query to really return all categories --- includes/SpecialCategories.php | 74 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/includes/SpecialCategories.php b/includes/SpecialCategories.php index 1a3efca0cc..34ebc6a832 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; - - $sk = $wgUser->getSkin() ; - $sc = "Special:Categories" ; - - # 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 .= "
  1. " ; - $r .= $sk->makeKnownLinkObj ( $title, $title->getText() ) ; - $r .= "
  2. \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 .= "
  1. " ; - $r .= $sk->makeBrokenLinkObj( $title, $title->getText() ) ; - $r .= "
  2. \n" ; - } - wfFreeResult ( $res ) ; - $r .= "
\n" ; - - $wgOut->addHTML ( $r ) ; + list( $limit, $offset ) = wfCheckLimits(); + + $cap = new CategoriesPage(); + + return $cap->doQuery( $offset, $limit ); } ?> -- 2.20.1