X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialAncientpages.php;h=1de0e05386d5826a2bc75d66e24594626dbba0ed;hb=a8cc4dc52cb73cea3553b53cd0ff426fe272da28;hp=13c97b4c331ae06d80c12779d93445f2fce1c64b;hpb=0332f4c59809e5a89f626e8969cd76261819f432;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php index 13c97b4c33..1de0e05386 100644 --- a/includes/SpecialAncientpages.php +++ b/includes/SpecialAncientpages.php @@ -1,7 +1,20 @@ tableName( 'page' ); + $revision = $db->tableName( 'revision' ); + #$use_index = $db->useIndexClause( 'cur_timestamp' ); # FIXME! this is gone + return + "SELECT 'Ancientpages' as type, + page_namespace as namespace, + page_title as title, + UNIX_TIMESTAMP(rev_timestamp) 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, "" ); + $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 "{$link} ({$d})"; } } -function wfSpecialAncientpages() -{ +function wfSpecialAncientpages() { list( $limit, $offset ) = wfCheckLimits(); $app = new AncientPagesPage();