*/ /** * A special page that list pages that have highest category count * * @ingroup SpecialPage */ class MostcategoriesPage extends QueryPage { function __construct( $name = 'Mostcategories' ) { parent::__construct( $name ); } function isExpensive() { return true; } function isSyndicated() { return false; } function getQueryInfo() { return array ( 'tables' => array ( 'categorylinks', 'page' ), 'fields' => array ( 'page_namespace AS namespace', 'page_title AS title', 'COUNT(*) AS value' ), 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces() ), 'options' => array ( 'HAVING' => 'COUNT(*) > 1', 'GROUP BY' => 'page_namespace, page_title' ), 'join_conds' => array ( 'page' => array ( 'LEFT JOIN', 'page_id = cl_from' ) ) ); } /** * @param $skin Skin * @param $result * @return string */ function formatResult( $skin, $result ) { global $wgLang; $title = Title::makeTitleSafe( $result->namespace, $result->title ); $count = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), $wgLang->formatNum( $result->value ) ); $link = $skin->link( $title ); return wfSpecialList( $link, $count ); } }