4 * @subpackage SpecialPage
6 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
7 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
8 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
13 * @subpackage SpecialPage
15 class MostcategoriesPage
extends QueryPage
{
17 function getName() { return 'Mostcategories'; }
18 function isExpensive() { return true; }
19 function isSyndicated() { return false; }
22 $dbr =& wfGetDB( DB_SLAVE
);
23 list( $categorylinks, $page) = $dbr->tableNamesN( 'categorylinks', 'page' );
27 'Mostcategories' as type,
28 page_namespace as namespace,
32 LEFT JOIN $page ON cl_from = page_id
33 WHERE page_namespace = " . NS_MAIN
. "
39 function formatResult( $skin, $result ) {
41 $title = Title
::makeTitleSafe( $result->namespace, $result->title
);
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 );