This is giving me a syntax error. It looks gross this way, but I can't think of any...
[lhc/web/wiklou.git] / includes / SpecialUnwatchedpages.php
index d37ce07..b1883e9 100644 (file)
@@ -1,22 +1,13 @@
 <?php
 /**
- * A special page that displays a list of pages that are not on anyones watchlist
- *
- * @package MediaWiki
- * @subpackage SpecialPage
+ * A special page that displays a list of pages that are not on anyones watchlist.
+ * Implements Special:Unwatchedpages
  *
+ * @addtogroup SpecialPage
  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
  */
-
-/* */
-require_once 'QueryPage.php';
-
-/**
- * @package MediaWiki
- * @subpackage SpecialPage
- */
 class UnwatchedpagesPage extends QueryPage {
 
        function getName() { return 'Unwatchedpages'; }
@@ -24,8 +15,9 @@ class UnwatchedpagesPage extends QueryPage {
        function isSyndicated() { return false; }
 
        function getSQL() {
-               $dbr =& wfGetDB( DB_SLAVE );
-               extract( $dbr->tableNames( 'page', 'watchlist' ) );
+               $dbr = wfGetDB( DB_SLAVE );
+               list( $page, $watchlist ) = $dbr->tableNamesN( 'page', 'watchlist' );
+               $mwns = NS_MEDIAWIKI;
                return
                        "
                        SELECT
@@ -35,10 +27,10 @@ class UnwatchedpagesPage extends QueryPage {
                                page_namespace as value
                        FROM $page
                        LEFT JOIN $watchlist ON wl_namespace = page_namespace AND page_title = wl_title
-                       WHERE wl_title IS NULL AND page_is_redirect = 0
+                       WHERE wl_title IS NULL AND page_is_redirect = 0 AND page_namespace<>$mwns
                        ";
        }
-       
+
        function sortDescending() { return false; }
 
        function formatResult( $skin, $result ) {
@@ -46,11 +38,11 @@ class UnwatchedpagesPage extends QueryPage {
 
                $nt = Title::makeTitle( $result->namespace, $result->title );
                $text = $wgContLang->convert( $nt->getPrefixedText() );
-               
-               $plink = $skin->makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) );
-               $wlink = $skin->makeKnownLinkObj( $nt, '(' . wfMsg( 'watch' ) . ')', 'action=watch' );
-               
-               return $plink . ' ' . $wlink;
+
+               $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
+               $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
+
+               return wfSpecialList( $plink, $wlink );
        }
 }
 
@@ -59,10 +51,10 @@ class UnwatchedpagesPage extends QueryPage {
  */
 function wfSpecialUnwatchedpages() {
        global $wgUser, $wgOut;
-       
+
        if ( ! $wgUser->isAllowed( 'unwatchedpages' ) )
                return $wgOut->permissionRequired( 'unwatchedpages' );
-       
+
        list( $limit, $offset ) = wfCheckLimits();
 
        $wpp = new UnwatchedpagesPage();
@@ -70,4 +62,4 @@ function wfSpecialUnwatchedpages() {
        $wpp->doQuery( $offset, $limit );
 }
 
-?>
+