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
12 require_once 'QueryPage.php';
16 * @subpackage SpecialPage
18 class MostcategoriesPage
extends QueryPage
{
20 function getName() { return 'Mostcategories'; }
21 function isExpensive() { return true; }
22 function isSyndicated() { return false; }
25 $dbr =& wfGetDB( DB_SLAVE
);
26 extract( $dbr->tableNames( 'categorylinks', 'page' ) );
30 'Mostcategories' as type,
31 page_namespace as namespace,
35 LEFT JOIN $page ON cl_from = page_id
36 WHERE page_namespace = " . NS_MAIN
. "
42 function formatResult( $skin, $result ) {
45 $nt = Title
::makeTitle( $result->namespace, $result->title
);
46 $text = $wgContLang->convert( $nt->getPrefixedText() );
48 $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
50 $nl = wfMsg( 'ncategories', $result->value
);
51 $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ), $nl, 'article=' . $nt->getPrefixedURL() );
53 return "{$plink} ({$nlink})";
60 function wfSpecialMostcategories() {
61 list( $limit, $offset ) = wfCheckLimits();
63 $wpp = new MostcategoriesPage();
65 $wpp->doQuery( $offset, $limit );