Migrated as a QueryPage extension
[mediawiki.git] / includes / SpecialAncientpages.php
blob3aa93a54a47dc88757ac4934bdaf36fbb6975074
1 <?php
3 require_once( "QueryPage.php" );
5 class AncientPagesPage extends QueryPage {
7 function getName() {
8 return "Ancientpages";
11 function isExpensive() {
12 return parent::isExpensive() ;
15 function getSQL() {
16 global $wgIsMySQL;
17 $use_index=$wgIsMySQL?"USE INDEX (cur_timestamp)":"";
18 return
19 "SELECT 'Ancientpages' as type,
20 cur_namespace as namespace,
21 cur_title as title,
22 UNIX_TIMESTAMP(cur_timestamp) as value
23 FROM cur $use_index
24 WHERE cur_namespace=0 AND cur_is_redirect=0";
27 function sortDescending() {
28 return false;
31 function formatResult( $skin, $result ) {
32 global $wgLang;
34 $d = $wgLang->timeanddate( wfUnix2Timestamp( $result->value ), true );
35 $link = $skin->makeKnownLink( $result->title, "" );
36 return "{$link} ({$d})";
40 function wfSpecialAncientpages()
42 list( $limit, $offset ) = wfCheckLimits();
44 $app = new AncientPagesPage();
46 $app->doQuery( $offset, $limit );