<?php
/**
* Contain a class for special pages
- * @package MediaWiki
*/
/**
- * List of query page classes and their associated special pages, for periodic update purposes
+ * List of query page classes and their associated special pages,
+ * for periodic updates.
+ *
+ * DO NOT CHANGE THIS LIST without testing that
+ * maintenance/updateSpecialPages.php still works.
*/
global $wgQueryPages; // not redundant
$wgQueryPages = array(
// QueryPage subclass Special page name Limit (false for none, none for the default)
//----------------------------------------------------------------------------
- array( 'AncientPagesPage', 'Ancientpages' ),
- array( 'BrokenRedirectsPage', 'BrokenRedirects' ),
- array( 'CategoriesPage', 'Categories' ),
- array( 'DeadendPagesPage', 'Deadendpages' ),
- array( 'DisambiguationsPage', 'Disambiguations' ),
- array( 'DoubleRedirectsPage', 'DoubleRedirects' ),
- array( 'ListUsersPage', 'Listusers' ),
- array( 'ListredirectsPage', 'Listredirects' ),
- array( 'LonelyPagesPage', 'Lonelypages' ),
- array( 'LongPagesPage', 'Longpages' ),
- array( 'MostcategoriesPage', 'Mostcategories' ),
- array( 'MostimagesPage', 'Mostimages' ),
- array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ),
- array( 'MostlinkedPage', 'Mostlinked' ),
- array( 'MostrevisionsPage', 'Mostrevisions' ),
- array( 'NewPagesPage', 'Newpages' ),
- array( 'ShortPagesPage', 'Shortpages' ),
- array( 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ),
- array( 'UncategorizedPagesPage', 'Uncategorizedpages' ),
- array( 'UncategorizedImagesPage', 'Uncategorizedimages' ),
- array( 'UnusedCategoriesPage', 'Unusedcategories' ),
- array( 'UnusedimagesPage', 'Unusedimages' ),
- array( 'WantedCategoriesPage', 'Wantedcategories' ),
- array( 'WantedPagesPage', 'Wantedpages' ),
- array( 'UnwatchedPagesPage', 'Unwatchedpages' ),
- array( 'UnusedtemplatesPage', 'Unusedtemplates' ),
+ array( 'AncientPagesPage', 'Ancientpages' ),
+ array( 'BrokenRedirectsPage', 'BrokenRedirects' ),
+ array( 'DeadendPagesPage', 'Deadendpages' ),
+ array( 'DisambiguationsPage', 'Disambiguations' ),
+ array( 'DoubleRedirectsPage', 'DoubleRedirects' ),
+ array( 'ListredirectsPage', 'Listredirects' ),
+ array( 'LonelyPagesPage', 'Lonelypages' ),
+ array( 'LongPagesPage', 'Longpages' ),
+ array( 'MostcategoriesPage', 'Mostcategories' ),
+ array( 'MostimagesPage', 'Mostimages' ),
+ array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ),
+ array( 'MostlinkedPage', 'Mostlinked' ),
+ array( 'MostrevisionsPage', 'Mostrevisions' ),
+ array( 'NewPagesPage', 'Newpages' ),
+ array( 'ShortPagesPage', 'Shortpages' ),
+ array( 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ),
+ array( 'UncategorizedPagesPage', 'Uncategorizedpages' ),
+ array( 'UncategorizedImagesPage', 'Uncategorizedimages' ),
+ array( 'UnusedCategoriesPage', 'Unusedcategories' ),
+ array( 'UnusedimagesPage', 'Unusedimages' ),
+ array( 'WantedCategoriesPage', 'Wantedcategories' ),
+ array( 'WantedPagesPage', 'Wantedpages' ),
+ array( 'UnwatchedPagesPage', 'Unwatchedpages' ),
+ array( 'UnusedtemplatesPage', 'Unusedtemplates' ),
);
wfRunHooks( 'wgQueryPages', array( &$wgQueryPages ) );
* we factor out some of the functionality into a superclass, and let
* subclasses derive from it.
*
- * @package MediaWiki
*/
class QueryPage {
/**
* @var bool
*/
var $listoutput = false;
-
+
/**
* The offset and limit in use, as passed to the query() function
*
*/
function recache( $limit, $ignoreErrors = true ) {
$fname = get_class($this) . '::recache';
- $dbw =& wfGetDB( DB_MASTER );
- $dbr =& wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) );
+ $dbw = wfGetDB( DB_MASTER );
+ $dbr = wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) );
if ( !$dbw || !$dbr ) {
return false;
}
$sname = $this->getName();
$fname = get_class($this) . '::doQuery';
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE );
$wgOut->setSyndicated( $this->isSyndicated() );
}
$wgOut->addWikiText( $cacheNotice );
+
+ # If updates on this page have been disabled, let the user know
+ # that the data set won't be refreshed for now
+ global $wgDisableQueryPageUpdate;
+ if( is_array( $wgDisableQueryPageUpdate ) && in_array( $this->getName(), $wgDisableQueryPageUpdate ) ) {
+ $wgOut->addWikiText( wfMsg( 'querypage-no-updates' ) );
+ }
+
}
}
if($shownavigation) {
$wgOut->addHTML( $this->getPageHeader() );
+
+ # if list is empty, show it
+ if( $num == 0 ) {
+ $wgOut->addHTML( '<p>' . wfMsgHTML('specialpage-empty') . '</p>' );
+ return;
+ }
+
$top = wfShowingResults( $offset, $num);
$wgOut->addHTML( "<p>{$top}\n" );
$this->feedUrl() );
$feed->outHeader();
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_SLAVE );
$sql = $this->getSQL() . $this->getOrder();
$sql = $dbr->limitResult( $sql, $limit, 0 );
$res = $dbr->query( $sql, 'QueryPage::doFeed' );
* titles that match some criteria. It formats each result item as a link to
* that page.
*
- * @package MediaWiki
*/
class PageQueryPage extends QueryPage {