X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialAncientpages.php;h=fc5df4f8629b31560d3b03ea39781d344662acd2;hb=0d81130dd47970a71871dae4ff1f625ff6f33014;hp=4738a1a0663fa6817ac8b90f93940778f5e356b1;hpb=a0b5676996e84f2916d32ba684fecf4f024a4899;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialAncientpages.php b/includes/specials/SpecialAncientpages.php index 4738a1a066..fc5df4f862 100644 --- a/includes/specials/SpecialAncientpages.php +++ b/includes/specials/SpecialAncientpages.php @@ -1,50 +1,59 @@ tableName( 'page' ); - $revision = $db->tableName( 'revision' ); + function isSyndicated() { + return false; + } - switch ($wgDBtype) { - case 'mysql': - $epoch = 'UNIX_TIMESTAMP(rev_timestamp)'; - break; - case 'oracle': - $epoch = '((trunc(rev_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)'; - break; - default: - $epoch = 'EXTRACT(epoch FROM rev_timestamp)'; - } + function getQueryInfo() { + return array( + 'tables' => array( 'page', 'revision' ), + 'fields' => array( 'namespace' => 'page_namespace', + 'title' => 'page_title', + 'value' => 'rev_timestamp' ), + 'conds' => array( 'page_namespace' => MWNamespace::getContentNamespaces(), + 'page_is_redirect' => 0, + 'page_latest=rev_id' ) + ); + } - return - "SELECT 'Ancientpages' as type, - page_namespace as namespace, - page_title as title, - $epoch as value - FROM $page, $revision - WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0 - AND page_latest=rev_id"; + function usesTimestamps() { + return true; } function sortDescending() { @@ -52,22 +61,14 @@ class AncientPagesPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgLang, $wgContLang; + global $wgContLang; - $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true ); + $d = $this->getLanguage()->userTimeAndDate( $result->value, $this->getUser() ); $title = Title::makeTitle( $result->namespace, $result->title ); - $link = $skin->linkKnown( + $link = Linker::linkKnown( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); - return wfSpecialList($link, htmlspecialchars($d) ); + return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) ); } } - -function wfSpecialAncientpages() { - list( $limit, $offset ) = wfCheckLimits(); - - $app = new AncientPagesPage(); - - $app->doQuery( $offset, $limit ); -}