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
14 require_once 'QueryPage.php';
18 * @subpackage SpecialPage
20 class UnwatchedpagesPage
extends QueryPage
{
22 function getName() { return 'Unwatchedpages'; }
23 function isExpensive() { return true; }
24 function isSyndicated() { return false; }
27 $dbr =& wfGetDB( DB_SLAVE
);
28 extract( $dbr->tableNames( 'page', 'watchlist' ) );
32 'Unwatchedpages' as type,
33 page_namespace as namespace,
35 page_namespace as value
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 ) {
47 $nt = Title
::makeTitle( $result->namespace, $result->title
);
48 $text = $wgContLang->convert( $nt->getPrefixedText() );
50 $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
51 $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
53 return $plink . ' (' . $wlink . ')';
60 function wfSpecialUnwatchedpages() {
61 global $wgUser, $wgOut;
63 if ( ! $wgUser->isAllowed( 'unwatchedpages' ) )
64 return $wgOut->permissionRequired( 'unwatchedpages' );
66 list( $limit, $offset ) = wfCheckLimits();
68 $wpp = new UnwatchedpagesPage();
70 $wpp->doQuery( $offset, $limit );