8 * A special page that displays a list of pages that are not on anyones watchlist.
9 * Implements Special:Unwatchedpages
11 * @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 UnwatchedpagesPage
extends QueryPage
{
18 function getName() { return 'Unwatchedpages'; }
19 function isExpensive() { return true; }
20 function isSyndicated() { return false; }
23 $dbr = wfGetDB( DB_SLAVE
);
24 list( $page, $watchlist ) = $dbr->tableNamesN( 'page', 'watchlist' );
29 'Unwatchedpages' as type,
30 page_namespace as namespace,
32 page_namespace as value
34 LEFT JOIN $watchlist ON wl_namespace = page_namespace AND page_title = wl_title
35 WHERE wl_title IS NULL AND page_is_redirect = 0 AND page_namespace<>$mwns
39 function sortDescending() { return false; }
41 function formatResult( $skin, $result ) {
44 $nt = Title
::makeTitle( $result->namespace, $result->title
);
45 $text = $wgContLang->convert( $nt->getPrefixedText() );
47 $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
48 $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
50 return wfSpecialList( $plink, $wlink );
57 function wfSpecialUnwatchedpages() {
58 global $wgUser, $wgOut;
60 if ( ! $wgUser->isAllowed( 'unwatchedpages' ) )
61 return $wgOut->permissionRequired( 'unwatchedpages' );
63 list( $limit, $offset ) = wfCheckLimits();
65 $wpp = new UnwatchedpagesPage();
67 $wpp->doQuery( $offset, $limit );