* (bug 5862) Update of Belarusian language (be)
[mediawiki.git] / includes / SpecialAncientpages.php
bloba0fcef7a0a92e4f6bf239abf5a79a63b982c155c
1 <?php
2 /**
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
8 /**
11 require_once( 'QueryPage.php' );
13 /**
15 * @package MediaWiki
16 * @subpackage SpecialPage
18 class AncientPagesPage extends QueryPage {
20 function getName() {
21 return "Ancientpages";
24 function isExpensive() {
25 return true;
28 function isSyndicated() { return false; }
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";
48 function sortDescending() {
49 return false;
52 function formatResult( $skin, $result ) {
53 global $wgLang, $wgContLang;
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);
62 function wfSpecialAncientpages() {
63 list( $limit, $offset ) = wfCheckLimits();
65 $app = new AncientPagesPage();
67 $app->doQuery( $offset, $limit );