Conducting a conversation by means of comments
[mediawiki.git] / includes / SpecialShortpages.php
blobc3eafc41187f026a411302c8cb0d310b2b962e6d
1 <?php
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 {
11 function getName() {
12 return "Shortpages";
15 function isExpensive() {
16 return true;
19 function getSQL() {
20 return
21 "SELECT 'Shortpages' as type,
22 cur_namespace as namespace,
23 cur_title as title,
24 LENGTH(cur_text) AS value
25 FROM cur
26 WHERE cur_namespace=0 AND cur_is_redirect=0";
29 function sortDescending() {
30 return false;
33 function formatResult( $skin, $result ) {
34 global $wgLang;
35 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
36 $link = $skin->makeKnownLink( $result->title, "" );
37 return "{$link} ({$nb})";
41 function wfSpecialShortpages() {
42 list( $limit, $offset ) = wfCheckLimits();
44 $spp = new ShortPagesPage();
46 return $spp->doQuery( $offset, $limit );