* (bug 6029) Improvement to German localisation (de)
[mediawiki.git] / includes / SpecialShortpages.php
blob5381e2f3a571be28a41bc60a4c8074e34e729888
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 /**
26 * This query is indexed as of 1.5
28 function isExpensive() {
29 return true;
32 function isSyndicated() {
33 return false;
36 function getSQL() {
37 $dbr =& wfGetDB( DB_SLAVE );
38 $page = $dbr->tableName( 'page' );
39 $name = $dbr->addQuotes( $this->getName() );
41 $forceindex = $dbr->useIndexClause("page_len");
42 return
43 "SELECT $name as type,
44 page_namespace as namespace,
45 page_title as title,
46 page_len AS value
47 FROM $page $forceindex
48 WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0";
51 function sortDescending() {
52 return false;
55 function formatResult( $skin, $result ) {
56 global $wgLang, $wgContLang;
57 $nb = wfMsgExt( 'nbytes', array('parsemag', 'escape'), $wgLang->formatNum( $result->value ) );
58 $title = Title::makeTitle( $result->namespace, $result->title );
59 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
60 $histlink = $skin->makeKnownLinkObj( $title, wfMsgHtml('hist'), 'action=history' );
61 $dirmark = $wgContLang->getDirMark();
63 return "({$histlink}) {$dirmark}$link {$dirmark}({$nb})";
67 /**
68 * constructor
70 function wfSpecialShortpages() {
71 list( $limit, $offset ) = wfCheckLimits();
73 $spp = new ShortPagesPage();
75 return $spp->doQuery( $offset, $limit );