array( 'DeadendPagesPage', 'Deadendpages' ),
array( 'DisambiguationsPage', 'Disambiguations' ),
array( 'DoubleRedirectsPage', 'DoubleRedirects' ),
- array( 'ListUsersPage', 'Listusers' ),
+ array( 'ListUsersPage', 'Listusers' ),
array( 'LonelyPagesPage', 'Lonelypages' ),
array( 'LongPagesPage', 'Longpages' ),
array( 'NewPagesPage', 'Newpages' ),
array( 'UncategorizedPagesPage', 'Uncategorizedpages'),
array( 'UnusedimagesPage', 'Unusedimages' ),
array( 'WantedPagesPage', 'Wantedpages' ),
+ array( 'MostlinkedPage', 'Mostlinked' ),
);
global $wgDisableCounters;
function getPageHeader( ) {
return '';
}
-
+
/**
* If using extra form wheely-dealies, return a set of parameters here
* as an associative array. They will be encoded and added to the paging
function linkParameters() {
return array();
}
-
+
/**
* Some special pages (for example SpecialListusers) might not return the
* current object formatted, but return the previous one instead.
}
$querycache = $dbr->tableName( 'querycache' );
-
+
if ( $ignoreErrors ) {
$ignoreW = $dbw->ignoreErrors( true );
$ignoreR = $dbr->ignoreErrors( true );
# Clear out any old cached data
$dbw->delete( 'querycache', array( 'qc_type' => $this->getName() ), $fname );
# Do query
- $res = $dbr->query( $this->getSQL() . $this->getOrder() . $dbr->limitResult( 1000,0 ), $fname );
+ $sql = $this->getSQL() . $this->getOrder();
+ $sql = $dbr->limitResult($sql, 1000,0);
+ $res = $dbr->query($sql, $fname);
$num = false;
if ( $res ) {
$num = $dbr->numRows( $res );
$wgOut->addWikiText( wfMsg( 'perfcached' ) );
}
}
-
- $res = $dbr->query( $sql . $this->getOrder() .
- $dbr->limitResult( $limit,$offset ), $fname );
+
+ $sql .= $this->getOrder();
+ $sql = $dbr->limitResult($sql, $limit, $offset);
+ $res = $dbr->query( $sql );
$num = $dbr->numRows($res);
-
+
+ $this->preprocessResults( $dbr, $res );
+
$sk = $wgUser->getSkin( );
if($shownavigation) {
$wgOut->addHTML( $this->getPageHeader() );
$top = wfShowingResults( $offset, $num);
$wgOut->addHTML( "<p>{$top}\n" );
-
+
# often disable 'next' link when we reach the end
if($num < $limit) { $atend = true; } else { $atend = false; }
-
+
$sl = wfViewPrevNext( $offset, $limit ,
$wgContLang->specialPage( $sname ),
wfArrayToCGI( $this->linkParameters() ), $atend );
$s .= "<li{$attr}>{$format}</li>\n";
}
}
-
+
$dbr->freeResult( $res );
$s .= '</ol>';
$wgOut->addHTML( $s );
return $num;
}
+ /**
+ * Do any necessary preprocessing of the result object
+ */
+ function preprocessResults( &$db, &$res ) {}
+
/**
* Similar to above, but packaging in a syndicated feed instead of a web page
*/
$feed->outHeader();
$dbr =& wfGetDB( DB_SLAVE );
- $sql = $this->getSQL() . $this->getOrder().$dbr->limitResult( 50, 0 );
+ $sql = $this->getSQL() . $this->getOrder();
+ $sql = $dbr->limitResult( $sql, 50, 0 );
$res = $dbr->query( $sql, 'QueryPage::doFeed' );
while( $obj = $dbr->fetchObject( $res ) ) {
$item = $this->feedResult( $obj );
if( !isset( $row->title ) ) {
return NULL;
}
- $title = Title::MakeTitle( IntVal( $row->namespace ), $row->title );
+ $title = Title::MakeTitle( intval( $row->namespace ), $row->title );
if( $title ) {
if( isset( $row->timestamp ) ) {
$date = $row->timestamp;