RC patrol fixlet: include rcid in 'diff' link in enhanced mode, for individually...
[mediawiki.git] / includes / SpecialShortpages.php
blob3faf4838542c3cd2c0c30374c61d024922e00106
1 <?php
2 /**
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
8 /**
11 require_once("QueryPage.php");
13 /**
14 * SpecialShortpages extends QueryPage. It is used to return the shortest
15 * pages in the database.
16 * @package MediaWiki
17 * @subpackage SpecialPage
19 class ShortPagesPage extends QueryPage {
21 function getName() {
22 return "Shortpages";
25 function isExpensive() {
26 return true;
28 function isSyndicated() { return false; }
30 function getSQL() {
31 $dbr =& wfGetDB( DB_SLAVE );
32 $cur = $dbr->tableName( 'cur' );
33 $name = $dbr->addQuotes( $this->getName() );
35 return
36 "SELECT $name as type,
37 cur_namespace as namespace,
38 cur_title as title,
39 LENGTH(cur_text) AS value
40 FROM $cur
41 WHERE cur_namespace=0 AND cur_is_redirect=0";
44 function sortDescending() {
45 return false;
48 function formatResult( $skin, $result ) {
49 global $wgLang, $wgContLang;
50 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
51 $link = $skin->makeKnownLink( $result->title, $wgContLang->convert( $result->title ) );
52 return "{$link} ({$nb})";
56 /**
57 * constructor
59 function wfSpecialShortpages() {
60 list( $limit, $offset ) = wfCheckLimits();
62 $spp = new ShortPagesPage();
64 return $spp->doQuery( $offset, $limit );