3 * @addtogroup SpecialPage
5 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
6 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
7 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
11 * implements Special:Mostcategories
12 * @addtogroup SpecialPage
14 class MostcategoriesPage
extends QueryPage
{
16 function getName() { return 'Mostcategories'; }
17 function isExpensive() { return true; }
18 function isSyndicated() { return false; }
21 $dbr = wfGetDB( DB_SLAVE
);
22 list( $categorylinks, $page) = $dbr->tableNamesN( 'categorylinks', 'page' );
26 'Mostcategories' as type,
27 page_namespace as namespace,
31 LEFT JOIN $page ON cl_from = page_id
32 WHERE page_namespace = " . NS_MAIN
. "
38 function formatResult( $skin, $result ) {
40 $title = Title
::makeTitleSafe( $result->namespace, $result->title
);
41 if ( !$title instanceof Title
) { throw new MWException('Invalid title in database'); }
42 $count = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value
) );
43 $link = $skin->makeKnownLinkObj( $title, $title->getText() );
44 return wfSpecialList( $link, $count );
51 function wfSpecialMostcategories() {
52 list( $limit, $offset ) = wfCheckLimits();
54 $wpp = new MostcategoriesPage();
56 $wpp->doQuery( $offset, $limit );