X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSpecialShortpages.php;h=5d748c238f65523bc6af31245f9a56782a45c1ee;hb=fcd1cdeb930e1779af77b3747b7c60338d4e81d7;hp=2cb6c378900a4a4f83eb1d04f294f044372ba6b6;hpb=0332f4c59809e5a89f626e8969cd76261819f432;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SpecialShortpages.php b/includes/SpecialShortpages.php index 2cb6c37890..5d748c238f 100644 --- a/includes/SpecialShortpages.php +++ b/includes/SpecialShortpages.php @@ -1,32 +1,70 @@ tableName( 'page' ); + $name = $dbr->addQuotes( $this->getName() ); + + return + "SELECT $name as type, + page_namespace as namespace, + page_title as title, + page_len AS value + FROM $page FORCE INDEX (page_len) + WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0"; + } + + function sortDescending() { + return false; } function formatResult( $skin, $result ) { - $nb = wfMsg( "nbytes", $result->len ); - $link = $skin->makeKnownLink( $result->cur_title, "" ); - return "{$link} ({$nb})"; + global $wgLang, $wgContLang; + $nb = htmlspecialchars( wfMsg( 'nbytes', $wgLang->formatNum( $result->value ) ) ); + $title = Title::makeTitle( $result->namespace, $result->title ); + $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); + $histlink = $skin->makeKnownLinkObj( $title, wfMsgHtml('hist'), 'action=history' ); + return "({$histlink}) $link ({$nb})"; } } -function wfSpecialShortpages() -{ +/** + * constructor + */ +function wfSpecialShortpages() { list( $limit, $offset ) = wfCheckLimits(); $spp = new ShortPagesPage();