X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialAncientpages.php;h=1de0e05386d5826a2bc75d66e24594626dbba0ed;hb=a8cc4dc52cb73cea3553b53cd0ff426fe272da28;hp=f799cc2cb4ffe470cfef76ec3df8218dcac66000;hpb=45060393ea1cc4b94f19e895adf121127508714e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php index f799cc2cb4..1de0e05386 100644 --- a/includes/SpecialAncientpages.php +++ b/includes/SpecialAncientpages.php @@ -22,22 +22,24 @@ class AncientPagesPage extends QueryPage { } function isExpensive() { - return parent::isExpensive() ; + return true; } function isSyndicated() { return false; } function getSQL() { $db =& wfGetDB( DB_SLAVE ); - $cur = $db->tableName( 'cur' ); - $use_index = $db->useIndexClause( 'cur_timestamp' ); + $page = $db->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, - 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() { @@ -48,7 +50,8 @@ class AncientPagesPage extends QueryPage { global $wgLang, $wgContLang; $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true ); - $link = $skin->makeKnownLink( $result->title, $wgContLang->convert( $result->title) ); + $title = Title::makeTitle( $result->namespace, $result->title ); + $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); return "{$link} ({$d})"; } }