I was adding a special page (dead-end pages), and I realized that almost all
[lhc/web/wiklou.git] / includes / SpecialAncientpages.php
1 <?
2
3 include_once( "QueryPage.php" );
4
5 class AncientPagesPage extends QueryPage {
6
7 function getName() {
8 return "Ancientpages";
9 }
10
11 function isExpensive() {
12 return 0;
13 }
14
15 function getSQL( $offset, $limit ) {
16 return "SELECT cur_title, cur_timestamp " .
17 "FROM cur USE INDEX (cur_timestamp) " .
18 "WHERE cur_namespace=0 AND cur_is_redirect=0 " .
19 " ORDER BY cur_timestamp LIMIT {$offset}, {$limit}";
20 }
21
22 function formatResult( $skin, $result ) {
23 global $wgLang;
24
25 $d = $wgLang->timeanddate( $result->cur_timestamp, true );
26 $link = $skin->makeKnownLink( $result->cur_title, "" );
27 return "{$link} ({$d})";
28 }
29 }
30
31 function wfSpecialAncientpages()
32 {
33 list( $limit, $offset ) = wfCheckLimits();
34
35 $app = new AncientPagesPage();
36
37 $app->doQuery( $offset, $limit );
38 }
39
40 ?>