3 # SpecialShortpages extends QueryPage. It is used to return the shortest
4 # pages in the database.
7 require_once("QueryPage.php");
9 class ShortPagesPage
extends QueryPage
{
15 function isExpensive() {
20 $dbr =& wfGetDB( DB_SLAVE
);
21 $cur = $dbr->tableName( 'cur' );
24 "SELECT 'Shortpages' as type,
25 cur_namespace as namespace,
27 LENGTH(cur_text) AS value
29 WHERE cur_namespace=0 AND cur_is_redirect=0";
32 function sortDescending() {
36 function formatResult( $skin, $result ) {
38 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value
) );
39 $link = $skin->makeKnownLink( $result->title
, "" );
40 return "{$link} ({$nb})";
44 function wfSpecialShortpages() {
45 list( $limit, $offset ) = wfCheckLimits();
47 $spp = new ShortPagesPage();
49 return $spp->doQuery( $offset, $limit );