* @package MediaWiki
*/
-/**
- *
- */
-require_once 'Feed.php';
-
/**
* List of query page classes and their associated special pages, for periodic update purposes
*/
array( 'WantedCategoriesPage', 'Wantedcategories' ),
array( 'WantedPagesPage', 'Wantedpages' ),
array( 'UnwatchedPagesPage', 'Unwatchedpages' ),
+ array( 'UnusedtemplatesPage', 'Unusedtemplates' ),
);
wfRunHooks( 'wgQueryPages', array( &$wgQueryPages ) );
* @var bool
*/
var $listoutput = false;
+
+ /**
+ * The offset and limit in use, as passed to the query() function
+ *
+ * @var integer
+ */
+ var $offset = 0;
+ var $limit = 0;
/**
* A mutator for $this->listoutput;
return '';
}
+ /**
+ * Return title object representing this page
+ *
+ * @return Title
+ */
+ function getTitle() {
+ return Title::makeTitle( NS_SPECIAL, $this->getName() );
+ }
+
/**
* Subclasses return an SQL query here.
*
function doQuery( $offset, $limit, $shownavigation=true ) {
global $wgUser, $wgOut, $wgLang, $wgContLang;
+ $this->offset = $offset;
+ $this->limit = $limit;
+
$sname = $this->getName();
$fname = get_class($this) . '::doQuery';
$sql = $this->getSQL();
"SELECT qc_type as type, qc_namespace as namespace,qc_title as title, qc_value as value
FROM $querycache WHERE qc_type='$type'";
- # Fetch the timestamp of this update
- $tRes = $dbr->select( 'querycache_info', array( 'qci_timestamp' ), array( 'qci_type' => $type ), $fname );
- $tRow = $dbr->fetchObject( $tRes );
- $updated = $tRow->qci_timestamp;
- $updatedTs = $wgLang->timeAndDate( $updated, true, true );
-
- if ( ! $this->listoutput )
- $wgOut->addWikiText( wfMsg( 'perfcached', $updatedTs ) );
+ if( !$this->listoutput ) {
+
+ # Fetch the timestamp of this update
+ $tRes = $dbr->select( 'querycache_info', array( 'qci_timestamp' ), array( 'qci_type' => $type ), $fname );
+ $tRow = $dbr->fetchObject( $tRes );
+
+ if( $tRow ) {
+ $updated = $wgLang->timeAndDate( $tRow->qci_timestamp, true, true );
+ $cacheNotice = wfMsg( 'perfcachedts', $updated );
+ $wgOut->addMeta( 'Data-Cache-Time', $tRow->qci_timestamp );
+ $wgOut->addScript( '<script language="JavaScript">var dataCacheTime = \'' . $tRow->qci_timestamp . '\';</script>' );
+ } else {
+ $cacheNotice = wfMsg( 'perfcached' );
+ }
+
+ $wgOut->addWikiText( $cacheNotice );
+ }
}