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 // TODO implement proper conversion to a Unix epoch
35 $epoch = 'rev_timestamp';
38 $epoch = '((trunc(rev_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)';
41 $epoch = 'EXTRACT(epoch FROM rev_timestamp)';
45 "SELECT 'Ancientpages' as type,
46 page_namespace as namespace,
50 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0
51 AND page_latest=rev_id";
54 function sortDescending() {
58 function formatResult( $skin, $result ) {
59 global $wgLang, $wgContLang;
61 $d = $wgLang->timeanddate( wfTimestamp( TS_MW
, $result->value
), true );
62 $title = Title
::makeTitle( $result->namespace, $result->title
);
63 $link = $skin->linkKnown(
65 htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
67 return wfSpecialList($link, htmlspecialchars($d) );
71 function wfSpecialAncientpages() {
72 list( $limit, $offset ) = wfCheckLimits();
74 $app = new AncientPagesPage();
76 $app->doQuery( $offset, $limit );