Didn't really mean to delete SpecialContributions.php back there, but now that
[mediawiki.git] / includes / SpecialCategories.php
blob89cff20a05a55301fdd9f845a5d38581306e71b4
1 <?php
2 /**
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
8 /**
10 * @package MediaWiki
11 * @subpackage SpecialPage
13 class CategoriesPage extends QueryPage {
15 function getName() {
16 return "Categories";
19 function isExpensive() {
20 return false;
23 function isSyndicated() { return false; }
25 function getPageHeader() {
26 return wfMsgWikiHtml( 'categoriespagetext' );
29 function getSQL() {
30 $NScat = NS_CATEGORY;
31 $dbr =& wfGetDB( DB_SLAVE );
32 $categorylinks = $dbr->tableName( 'categorylinks' );
33 $s= "SELECT 'Categories' as type,
34 {$NScat} as namespace,
35 cl_to as title,
36 1 as value,
37 COUNT(*) as count
38 FROM $categorylinks
39 GROUP BY 1,2,3,4";
40 return $s;
43 function sortDescending() {
44 return false;
47 function formatResult( $skin, $result ) {
48 global $wgLang;
49 $title = Title::makeTitle( NS_CATEGORY, $result->title );
50 $plink = $skin->makeLinkObj( $title, $title->getText() );
51 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
52 $wgLang->formatNum( $result->count ) );
53 return wfSpecialList($plink, $nlinks);
57 /**
60 function wfSpecialCategories() {
61 list( $limit, $offset ) = wfCheckLimits();
63 $cap = new CategoriesPage();
65 return $cap->doQuery( $offset, $limit );