8 * A querypage to list the most wanted categories - implements Special:Wantedcategories
10 * @ingroup SpecialPage
12 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
13 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
14 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
16 class WantedCategoriesPage
extends WantedQueryPage
{
19 return 'Wantedcategories';
23 $dbr = wfGetDB( DB_SLAVE
);
24 list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' );
25 $name = $dbr->addQuotes( $this->getName() );
30 " . NS_CATEGORY
. " as namespace,
34 LEFT JOIN $page ON cl_to = page_title AND page_namespace = ". NS_CATEGORY
."
35 WHERE page_title IS NULL
40 function formatResult( $skin, $result ) {
41 global $wgLang, $wgContLang;
43 $nt = Title
::makeTitle( $result->namespace, $result->title
);
44 $text = htmlspecialchars( $wgContLang->convert( $nt->getText() ) );
46 $plink = $this->isCached() ?
47 $skin->link( $nt, $text ) :
56 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
57 $wgLang->formatNum( $result->value
) );
58 return wfSpecialList($plink, $nlinks);
65 function wfSpecialWantedCategories() {
66 list( $limit, $offset ) = wfCheckLimits();
68 $wpp = new WantedCategoriesPage();
70 $wpp->doQuery( $offset, $limit );