00001 <?php
00011 class AncientPagesPage extends QueryPage {
00012
00013 function getName() {
00014 return "Ancientpages";
00015 }
00016
00017 function isExpensive() {
00018 return true;
00019 }
00020
00021 function isSyndicated() { return false; }
00022
00023 function getSQL() {
00024 global $wgDBtype;
00025 $db = wfGetDB( DB_SLAVE );
00026 $page = $db->tableName( 'page' );
00027 $revision = $db->tableName( 'revision' );
00028 $epoch = $wgDBtype == 'mysql' ? 'UNIX_TIMESTAMP(rev_timestamp)' :
00029 'EXTRACT(epoch FROM rev_timestamp)';
00030 return
00031 "SELECT 'Ancientpages' as type,
00032 page_namespace as namespace,
00033 page_title as title,
00034 $epoch as value
00035 FROM $page, $revision
00036 WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0
00037 AND page_latest=rev_id";
00038 }
00039
00040 function sortDescending() {
00041 return false;
00042 }
00043
00044 function formatResult( $skin, $result ) {
00045 global $wgLang, $wgContLang;
00046
00047 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
00048 $title = Title::makeTitle( $result->namespace, $result->title );
00049 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
00050 return wfSpecialList($link, $d);
00051 }
00052 }
00053
00054 function wfSpecialAncientpages() {
00055 list( $limit, $offset ) = wfCheckLimits();
00056
00057 $app = new AncientPagesPage();
00058
00059 $app->doQuery( $offset, $limit );
00060 }