Tweak script to allow just reporting of the number of inactive accounts
[mediawiki.git] / includes / SpecialUnwatchedpages.php
blob43b712e10185c0e0039cb70c6221312a01d78d8c
1 <?php
2 /**
3 * A special page that displays a list of pages that are not on anyones watchlist
5 * @package MediaWiki
6 * @subpackage SpecialPage
8 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
9 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
10 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
13 /* */
14 require_once 'QueryPage.php';
16 /**
17 * @package MediaWiki
18 * @subpackage SpecialPage
20 class UnwatchedpagesPage extends QueryPage {
22 function getName() { return 'Unwatchedpages'; }
23 function isExpensive() { return true; }
24 function isSyndicated() { return false; }
26 function getSQL() {
27 $dbr =& wfGetDB( DB_SLAVE );
28 extract( $dbr->tableNames( 'page', 'watchlist' ) );
29 return
31 SELECT
32 'Unwatchedpages' as type,
33 page_namespace as namespace,
34 page_title as title,
35 page_namespace as value
36 FROM $page
37 LEFT JOIN $watchlist ON wl_namespace = page_namespace AND page_title = wl_title
38 WHERE wl_title IS NULL AND page_is_redirect = 0
42 function sortDescending() { return false; }
44 function formatResult( $skin, $result ) {
45 global $wgContLang;
47 $nt = Title::makeTitle( $result->namespace, $result->title );
48 $text = $wgContLang->convert( $nt->getPrefixedText() );
50 $plink = $skin->makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) );
52 return $plink;
56 /**
57 * constructor
59 function wfSpecialUnwatchedpages() {
60 global $wgUser, $wgOut;
62 if ( ! $wgUser->isAllowed( 'unwatchedpages' ) )
63 return $wgOut->permissionRequired( 'unwatchedpages' );
65 list( $limit, $offset ) = wfCheckLimits();
67 $wpp = new UnwatchedpagesPage();
69 $wpp->doQuery( $offset, $limit );