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