wiki.techinc.nl/includes/SpecialShortpages.php
Brion Vibber 4dac4d85c6 Add digit transformation function Language::formatNum() for Arabic and other
languages which need to use localized (decimal) digits. Sample implementation
for Arabic.
2004-03-06 03:03:14 +00:00

38 lines
751 B
PHP

<?php
include_once("QueryPage.php");
class ShortPagesPage extends QueryPage {
function getName() {
return "Shortpages";
}
function isExpensive() {
return 1;
}
function getSQL( $offset, $limit ) {
return "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
"WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY len " .
"LIMIT {$offset}, {$limit}";
}
function formatResult( $skin, $result ) {
global $wgLang;
$nb = wfMsg( "nbytes", $wgLang->formatNum( $result->len ) );
$link = $skin->makeKnownLink( $result->cur_title, "" );
return "{$link} ({$nb})";
}
}
function wfSpecialShortpages()
{
list( $limit, $offset ) = wfCheckLimits();
$spp = new ShortPagesPage();
return $spp->doQuery( $offset, $limit );
}
?>