X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSpecialAncientpages.php;h=1de0e05386d5826a2bc75d66e24594626dbba0ed;hb=71e75ac5ead653914ec3ae100e26d186375a306e;hp=6029f06bc1d0e820cca20c81c699d20d34bf7545;hpb=ac549401d4ddaf655ec47cd1e66092fdc83ab30b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialAncientpages.php b/includes/SpecialAncientpages.php index 6029f06bc1..1de0e05386 100644 --- a/includes/SpecialAncientpages.php +++ b/includes/SpecialAncientpages.php @@ -1,7 +1,20 @@ 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, - 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() { @@ -30,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, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); return "{$link} ({$d})"; } } -function wfSpecialAncientpages() -{ +function wfSpecialAncientpages() { list( $limit, $offset ) = wfCheckLimits(); $app = new AncientPagesPage();