8 * Implements Special:Ancientpages
11 class AncientPagesPage
extends QueryPage
{
14 return "Ancientpages";
17 function isExpensive() {
21 function isSyndicated() { return false; }
25 $db = wfGetDB( DB_SLAVE
);
26 $page = $db->tableName( 'page' );
27 $revision = $db->tableName( 'revision' );
31 $epoch = 'UNIX_TIMESTAMP(rev_timestamp)';
34 $epoch = '((trunc(rev_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)';
37 $epoch = 'EXTRACT(epoch FROM rev_timestamp)';
41 "SELECT 'Ancientpages' as type,
42 page_namespace as namespace,
46 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0
47 AND page_latest=rev_id";
50 function sortDescending() {
54 function formatResult( $skin, $result ) {
55 global $wgLang, $wgContLang;
57 $d = $wgLang->timeanddate( wfTimestamp( TS_MW
, $result->value
), true );
58 $title = Title
::makeTitle( $result->namespace, $result->title
);
59 $link = $skin->linkKnown(
61 htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
63 return wfSpecialList($link, htmlspecialchars($d) );
65 function formatApiResult( $row ) {
66 $result = parent
::formatApiResult( $row );
67 $result['timestamp'] = wfTimestamp( TS_ISO_8601
, $row->value
);
71 function wfSpecialAncientpages() {
72 list( $limit, $offset ) = wfCheckLimits();
74 $app = new AncientPagesPage();
76 $app->doQuery( $offset, $limit );