content-type restrictions
[mediawiki.git] / includes / SpecialShortpages.php
blobb9892772e68dd797b2ca8d7a1c254c88de09db3d
1 <?php
3 include_once("QueryPage.php");
5 class ShortPagesPage extends QueryPage {
7 function getName() {
8 return "Shortpages";
11 function isExpensive() {
12 return 1;
15 function getSQL( $offset, $limit ) {
16 return "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
17 "WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY len " .
18 "LIMIT {$offset}, {$limit}";
21 function formatResult( $skin, $result ) {
22 global $wgLang;
23 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->len ) );
24 $link = $skin->makeKnownLink( $result->cur_title, "" );
25 return "{$link} ({$nb})";
29 function wfSpecialShortpages()
31 list( $limit, $offset ) = wfCheckLimits();
33 $spp = new ShortPagesPage();
35 return $spp->doQuery( $offset, $limit );