* Some cleanups
This commit is contained in:
parent
0570fdb1db
commit
479008a3f7
8 changed files with 27 additions and 20 deletions
|
|
@ -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;">' .
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -10,9 +10,17 @@
|
|||
*/
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue