* Some cleanups
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 15 Mar 2008 10:46:28 +0000 (10:46 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 15 Mar 2008 10:46:28 +0000 (10:46 +0000)
includes/SpecialAllpages.php
includes/SpecialMostlinked.php
includes/SpecialMostlinkedcategories.php
includes/SpecialMostlinkedtemplates.php
includes/SpecialShortpages.php
includes/SpecialWantedcategories.php
includes/SpecialWantedpages.php
includes/SpecialWhatlinkshere.php

index 9f5cf83..8375d07 100644 (file)
@@ -130,7 +130,7 @@ function showToplevel ( $namespace = NS_MAIN, $including = false ) {
                        $res = $dbr->select(
                                'page', /* FROM */
                                'page_title', /* WHAT */
-                               $where + array( $chunk),
+                               $where + array($chunk),
                                __METHOD__,
                                array ('LIMIT' => 2, 'OFFSET' => $this->maxPerPage - 1, 'ORDER BY' => 'page_title') );
 
@@ -174,7 +174,7 @@ function showToplevel ( $namespace = NS_MAIN, $including = false ) {
                $out .= $this->showline ( $inpoint, $outpoint, $namespace, false );
        }
        $out .= '</table>';
-       $nsForm = $this->namespaceForm ( $namespace, '', false );
+       $nsForm = $this->namespaceForm( $namespace, '', false );
 
        # Is there more?
        if ( $including ) {
@@ -319,7 +319,7 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) {
                        }
                }
 
-               $nsForm = $this->namespaceForm ( $namespace, $from );
+               $nsForm = $this->namespaceForm( $namespace, $from );
                $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
                $out2 .= '<tr valign="top"><td>' . $nsForm;
                $out2 .= '</td><td align="' . $align . '" style="font-size: smaller; margin-bottom: 1em;">' .
index 916f219..1827d96 100644 (file)
@@ -43,7 +43,7 @@ class MostlinkedPage extends QueryPage {
                if( $db->numRows( $res ) > 0 ) {
                        $linkBatch = new LinkBatch();
                        while( $row = $db->fetchObject( $res ) )
-                               $linkBatch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+                               $linkBatch->add( $row->namespace, $row->title );
                        $db->dataSeek( $res, 0 );
                        $linkBatch->execute();
                }
index c357c8f..9d7a968 100644 (file)
@@ -38,7 +38,7 @@ class MostlinkedCategoriesPage extends QueryPage {
        function preprocessResults( $db, $res ) {
                $batch = new LinkBatch;
                while ( $row = $db->fetchObject( $res ) )
-                       $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+                       $batch->add( $row->namespace, $row->title );
                $batch->execute();
 
                // Back to start for display
index b0f1b19..fb82ff4 100644 (file)
@@ -69,15 +69,14 @@ class SpecialMostlinkedtemplates extends QueryPage {
         * @param Database $dbr Database connection
         * @param int $res Result pointer
         */
-       public function preprocessResults( $dbr, $res ) {
+       public function preprocessResults( $db, $res ) {
                $batch = new LinkBatch();
-               while( $row = $dbr->fetchObject( $res ) ) {
-                       $title = Title::makeTitleSafe( $row->namespace, $row->title );
-                       $batch->addObj( $title );
+               while( $row = $db->fetchObject( $res ) ) {
+                       $batch->add( $row->namespace, $row->title );
                }
                $batch->execute();
-               if( $dbr->numRows( $res ) > 0 )
-                       $dbr->dataSeek( $res, 0 );
+               if( $db->numRows( $res ) > 0 )
+                       $db->dataSeek( $res, 0 );
        }
 
        /**
index 5aa3638..c698e23 100644 (file)
@@ -12,7 +12,7 @@
 class ShortPagesPage extends QueryPage {
 
        function getName() {
-               return "Shortpages";
+               return 'Shortpages';
        }
 
        /**
@@ -47,7 +47,7 @@ class ShortPagesPage extends QueryPage {
                if( $this->isCached() ) {
                        $batch = new LinkBatch();
                        while( $row = $db->fetchObject( $res ) )
-                               $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+                               $batch->add( $row->namespace, $row->title );
                        $batch->execute();
                        if( $db->numRows( $res ) > 0 )
                                $db->dataSeek( $res, 0 );
index 580cc6d..0f554db 100644 (file)
  */
 class WantedCategoriesPage extends QueryPage {
 
-       function getName() { return 'Wantedcategories'; }
-       function isExpensive() { return true; }
-       function isSyndicated() { return false; }
+       function getName() {
+               return 'Wantedcategories';
+       }
+
+       function isExpensive() {
+               return true;
+       }
+
+       function isSyndicated() {
+               return false;
+       }
 
        function getSQL() {
                $dbr = wfGetDB( DB_SLAVE );
@@ -40,7 +48,7 @@ class WantedCategoriesPage extends QueryPage {
        function preprocessResults( $db, $res ) {
                $batch = new LinkBatch;
                while ( $row = $db->fetchObject( $res ) )
-                       $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+                       $batch->add( $row->namespace, $row->title );
                $batch->execute();
 
                // Back to start for display
index 1fb8cdb..0600e99 100644 (file)
@@ -54,7 +54,7 @@ class WantedPagesPage extends QueryPage {
        function preprocessResults( $db, $res ) {
                $batch = new LinkBatch;
                while ( $row = $db->fetchObject( $res ) )
-                       $batch->addObj( Title::makeTitleSafe( $row->namespace, $row->title ) );
+                       $batch->add( $row->namespace, $row->title );
                $batch->execute();
 
                // Back to start for display
index f89cdcc..d5496d0 100644 (file)
@@ -25,9 +25,9 @@ class WhatLinksHerePage {
 
        private $namespace;
 
-       function WhatLinksHerePage( &$request, $par = null ) {
+       function WhatLinksHerePage( $request, $par = null ) {
                global $wgUser;
-               $this->request =& $request;
+               $this->request = $request;
                $this->skin = $wgUser->getSkin();
                $this->par = $par;
        }