9a28301a4fb930916b173da507b489d502b7f733
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 = $wgContLang->convert( $nt->getText() );
46 $plink = $this->isCached() ?
47 $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) :
48 $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
50 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
51 $wgLang->formatNum( $result->value
) );
52 return wfSpecialList($plink, $nlinks);
59 function wfSpecialWantedCategories() {
60 list( $limit, $offset ) = wfCheckLimits();
62 $wpp = new WantedCategoriesPage();
64 $wpp->doQuery( $offset, $limit );