X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2FSpecialAncientpages.php;h=4d676036cd14502f350ecc23418a486c8593779f;hb=e68b242f310bc876b6ec152a2e67ce706863f204;hp=3aa93a54a47dc88757ac4934bdaf36fbb6975074;hpb=9cac06d2ccdff00dfe3b10388c0b4ceb3178012b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php index 3aa93a54a4..4d676036cd 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, - cur_namespace as namespace, - cur_title as title, - UNIX_TIMESTAMP(cur_timestamp) as value - FROM cur $use_index - WHERE cur_namespace=0 AND cur_is_redirect=0"; + 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() { @@ -29,16 +47,16 @@ class AncientPagesPage extends QueryPage { } function formatResult( $skin, $result ) { - global $wgLang; + global $wgLang, $wgContLang; - $d = $wgLang->timeanddate( wfUnix2Timestamp( $result->value ), true ); - $link = $skin->makeKnownLink( $result->title, "" ); + $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true ); + $title = Title::makeTitle( $result->namespace, $result->title ); + $link = $skin->makeKnownLinkObj( $title, $wgContLang->convert( $title->getPrefixedText() ) ); return "{$link} ({$d})"; } } -function wfSpecialAncientpages() -{ +function wfSpecialAncientpages() { list( $limit, $offset ) = wfCheckLimits(); $app = new AncientPagesPage();