9 require_once("QueryPage.php");
12 * SpecialShortpages extends QueryPage. It is used to return the shortest
13 * pages in the database.
15 class ShortPagesPage
extends QueryPage
{
21 function isExpensive() {
26 $dbr =& wfGetDB( DB_SLAVE
);
27 $cur = $dbr->tableName( 'cur' );
30 "SELECT 'Shortpages' as type,
31 cur_namespace as namespace,
33 LENGTH(cur_text) AS value
35 WHERE cur_namespace=0 AND cur_is_redirect=0";
38 function sortDescending() {
42 function formatResult( $skin, $result ) {
44 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value
) );
45 $link = $skin->makeKnownLink( $result->title
, "" );
46 return "{$link} ({$nb})";
53 function wfSpecialShortpages() {
54 list( $limit, $offset ) = wfCheckLimits();
56 $spp = new ShortPagesPage();
58 return $spp->doQuery( $offset, $limit );