5 * @subpackage SpecialPage
11 require_once("QueryPage.php");
14 * SpecialShortpages extends QueryPage. It is used to return the shortest
15 * pages in the database.
17 * @subpackage SpecialPage
19 class ShortPagesPage
extends QueryPage
{
25 function isExpensive() {
30 $dbr =& wfGetDB( DB_SLAVE
);
31 $cur = $dbr->tableName( 'cur' );
32 $name = $dbr->addQuotes( $this->getName() );
35 "SELECT $name as type,
36 cur_namespace as namespace,
38 LENGTH(cur_text) AS value
40 WHERE cur_namespace=0 AND cur_is_redirect=0";
43 function sortDescending() {
47 function formatResult( $skin, $result ) {
49 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value
) );
50 $link = $skin->makeKnownLink( $result->title
, "" );
51 return "{$link} ({$nb})";
58 function wfSpecialShortpages() {
59 list( $limit, $offset ) = wfCheckLimits();
61 $spp = new ShortPagesPage();
63 return $spp->doQuery( $offset, $limit );