more specific error message, using WikiError, if user trys to create account with...
[mediawiki.git] / includes / specials / SpecialWantedcategories.php
blob5e5a4f17e995da17abbdd130c22ce330374cf98a
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
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 {
18 function getName() {
19 return 'Wantedcategories';
22 function getSQL() {
23 $dbr = wfGetDB( DB_SLAVE );
24 list( $categorylinks, $page ) = $dbr->tableNamesN( 'categorylinks', 'page' );
25 $name = $dbr->addQuotes( $this->getName() );
26 return
28 SELECT
29 $name as type,
30 " . NS_CATEGORY . " as namespace,
31 cl_to as title,
32 COUNT(*) as value
33 FROM $categorylinks
34 LEFT JOIN $page ON cl_to = page_title AND page_namespace = ". NS_CATEGORY ."
35 WHERE page_title IS NULL
36 GROUP BY cl_to
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 ) :
48 $skin->link(
49 $nt,
50 $text,
51 array(),
52 array(),
53 array( 'broken' )
56 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
57 $wgLang->formatNum( $result->value ) );
58 return wfSpecialList($plink, $nlinks);
62 /**
63 * constructor
65 function wfSpecialWantedCategories() {
66 list( $limit, $offset ) = wfCheckLimits();
68 $wpp = new WantedCategoriesPage();
70 $wpp->doQuery( $offset, $limit );