Localization: Prefer showing the date before the time, like in lastmodifiedat (no...
[mediawiki.git] / includes / specials / SpecialAncientpages.php
blob188ad9148b2fca87fb97af2657e97b2f0c928c2a
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
8 * Implements Special:Ancientpages
9 * @ingroup SpecialPage
11 class AncientPagesPage extends QueryPage {
13 function getName() {
14 return "Ancientpages";
17 function isExpensive() {
18 return true;
21 function isSyndicated() { return false; }
23 function getSQL() {
24 global $wgDBtype;
25 $db = wfGetDB( DB_SLAVE );
26 $page = $db->tableName( 'page' );
27 $revision = $db->tableName( 'revision' );
28 $epoch = $wgDBtype == 'mysql' ? 'UNIX_TIMESTAMP(rev_timestamp)' :
29 'EXTRACT(epoch FROM rev_timestamp)';
30 return
31 "SELECT 'Ancientpages' as type,
32 page_namespace as namespace,
33 page_title as title,
34 $epoch as value
35 FROM $page, $revision
36 WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0
37 AND page_latest=rev_id";
40 function sortDescending() {
41 return false;
44 function formatResult( $skin, $result ) {
45 global $wgLang, $wgContLang;
47 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
48 $title = Title::makeTitle( $result->namespace, $result->title );
49 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
50 return wfSpecialList($link, $d);
54 function wfSpecialAncientpages() {
55 list( $limit, $offset ) = wfCheckLimits();
57 $app = new AncientPagesPage();
59 $app->doQuery( $offset, $limit );