3 * A special page that displays a list of pages that are not on anyones watchlist
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
15 * @subpackage SpecialPage
17 class UnwatchedpagesPage
extends QueryPage
{
19 function getName() { return 'Unwatchedpages'; }
20 function isExpensive() { return true; }
21 function isSyndicated() { return false; }
24 $dbr =& wfGetDB( DB_SLAVE
);
25 extract( $dbr->tableNames( 'page', 'watchlist' ) );
30 'Unwatchedpages' as type,
31 page_namespace as namespace,
33 page_namespace as value
35 LEFT JOIN $watchlist ON wl_namespace = page_namespace AND page_title = wl_title
36 WHERE wl_title IS NULL AND page_is_redirect = 0 AND page_namespace<>$mwns
40 function sortDescending() { return false; }
42 function formatResult( $skin, $result ) {
45 $nt = Title
::makeTitle( $result->namespace, $result->title
);
46 $text = $wgContLang->convert( $nt->getPrefixedText() );
48 $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
49 $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
51 return wfSpecialList( $plink, $wlink );
58 function wfSpecialUnwatchedpages() {
59 global $wgUser, $wgOut;
61 if ( ! $wgUser->isAllowed( 'unwatchedpages' ) )
62 return $wgOut->permissionRequired( 'unwatchedpages' );
64 list( $limit, $offset ) = wfCheckLimits();
66 $wpp = new UnwatchedpagesPage();
68 $wpp->doQuery( $offset, $limit );