use Database::timestamp() for cutoff
[lhc/web/wiklou.git] / includes / SpecialAncientpages.php
1 <?php
2
3 require_once( "QueryPage.php" );
4
5 class AncientPagesPage extends QueryPage {
6
7 function getName() {
8 return "Ancientpages";
9 }
10
11 function isExpensive() {
12 return parent::isExpensive() ;
13 }
14
15 function getSQL() {
16 $db =& wfGetDB( DB_SLAVE );
17 $cur = $db->tableName( 'cur' );
18 $use_index = $db->useIndexClause( 'cur_timestamp' );
19 return
20 "SELECT 'Ancientpages' as type,
21 cur_namespace as namespace,
22 cur_title as title,
23 UNIX_TIMESTAMP(cur_timestamp) as value
24 FROM $cur $use_index
25 WHERE cur_namespace=0 AND cur_is_redirect=0";
26 }
27
28 function sortDescending() {
29 return false;
30 }
31
32 function formatResult( $skin, $result ) {
33 global $wgLang;
34
35 $d = $wgLang->timeanddate( wfUnix2Timestamp( $result->value ), true );
36 $link = $skin->makeKnownLink( $result->title, "" );
37 return "{$link} ({$d})";
38 }
39 }
40
41 function wfSpecialAncientpages()
42 {
43 list( $limit, $offset ) = wfCheckLimits();
44
45 $app = new AncientPagesPage();
46
47 $app->doQuery( $offset, $limit );
48 }
49
50 ?>