* Don't use content language for talk link
[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 true;
26 }
27
28 function isSyndicated() { return false; }
29
30 function getSQL() {
31 global $wgDBtype;
32 $db =& wfGetDB( DB_SLAVE );
33 $page = $db->tableName( 'page' );
34 $revision = $db->tableName( 'revision' );
35 #$use_index = $db->useIndexClause( 'cur_timestamp' ); # FIXME! this is gone
36 $epoch = $wgDBtype == 'mysql' ? 'UNIX_TIMESTAMP(rev_timestamp)' :
37 'EXTRACT(epoch FROM rev_timestamp)';
38 return
39 "SELECT 'Ancientpages' as type,
40 page_namespace as namespace,
41 page_title as title,
42 $epoch as value
43 FROM $page, $revision
44 WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0
45 AND page_latest=rev_id";
46 }
47
48 function sortDescending() {
49 return false;
50 }
51
52 function formatResult( $skin, $result ) {
53 global $wgLang, $wgContLang;
54
55 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
56 $title = Title::makeTitle( $result->namespace, $result->title );
57 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
58 return wfSpecialList($link, $d);
59 }
60 }
61
62 function wfSpecialAncientpages() {
63 list( $limit, $offset ) = wfCheckLimits();
64
65 $app = new AncientPagesPage();
66
67 $app->doQuery( $offset, $limit );
68 }
69
70 ?>