X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialAncientpages.php;h=dee8fbde06d2077204fecf09e73129f3f19adc48;hb=5137bd84c31e39e5e26b2a25345eb0bcc7c48497;hp=1b9a897bba853f20b972a93cdc2d0466ef2468e5;hpb=8f22cb45b1ccd2d18bb4ef1247a18efbb9a87e2d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php index 1b9a897bba..dee8fbde06 100644 --- a/includes/SpecialAncientpages.php +++ b/includes/SpecialAncientpages.php @@ -1,7 +1,13 @@ tableName( 'page' ); + $revision = $db->tableName( 'revision' ); + #$use_index = $db->useIndexClause( 'cur_timestamp' ); # FIXME! this is gone + $epoch = $wgDBtype == 'mysql' ? 'UNIX_TIMESTAMP(rev_timestamp)' : + 'EXTRACT(epoch FROM rev_timestamp)'; + 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 sortDescending() { + return false; } function formatResult( $skin, $result ) { - global $wgLang; + global $wgLang, $wgContLang; - $d = $wgLang->timeanddate( $result->cur_timestamp, true ); - $link = $skin->makeKnownLink( $result->cur_title, "" ); - return "{$link} ({$d})"; + $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true ); + $title = Title::makeTitle( $result->namespace, $result->title ); + $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); + return wfSpecialList($link, $d); } } -function wfSpecialAncientpages() -{ +function wfSpecialAncientpages() { list( $limit, $offset ) = wfCheckLimits(); $app = new AncientPagesPage(); @@ -37,4 +60,4 @@ function wfSpecialAncientpages() $app->doQuery( $offset, $limit ); } -?> +