3aa93a54a47dc88757ac4934bdaf36fbb6975074
[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 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";
25 }
26
27 function sortDescending() {
28 return false;
29 }
30
31 function formatResult( $skin, $result ) {
32 global $wgLang;
33
34 $d = $wgLang->timeanddate( wfUnix2Timestamp( $result->value ), true );
35 $link = $skin->makeKnownLink( $result->title, "" );
36 return "{$link} ({$d})";
37 }
38 }
39
40 function wfSpecialAncientpages()
41 {
42 list( $limit, $offset ) = wfCheckLimits();
43
44 $app = new AncientPagesPage();
45
46 $app->doQuery( $offset, $limit );
47 }
48
49 ?>