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 * @addtogroup SpecialPage
13 class MostcategoriesPage
extends QueryPage
{
15 function getName() { return 'Mostcategories'; }
16 function isExpensive() { return true; }
17 function isSyndicated() { return false; }
20 $dbr = wfGetDB( DB_SLAVE
);
21 list( $categorylinks, $page) = $dbr->tableNamesN( 'categorylinks', 'page' );
25 'Mostcategories' as type,
26 page_namespace as namespace,
30 LEFT JOIN $page ON cl_from = page_id
31 WHERE page_namespace = " . NS_MAIN
. "
37 function formatResult( $skin, $result ) {
39 $title = Title
::makeTitleSafe( $result->namespace, $result->title
);
40 $count = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value
) );
41 $link = $skin->makeKnownLinkObj( $title, $title->getText() );
42 return wfSpecialList( $link, $count );
49 function wfSpecialMostcategories() {
50 list( $limit, $offset ) = wfCheckLimits();
52 $wpp = new MostcategoriesPage();
54 $wpp->doQuery( $offset, $limit );