Changing comments layout preparing for generated documentation with Phpdocumentor
[lhc/web/wiklou.git] / includes / SpecialShortpages.php
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 require_once("QueryPage.php");
10
11 /**
12 * SpecialShortpages extends QueryPage. It is used to return the shortest
13 * pages in the database.
14 */
15 class ShortPagesPage extends QueryPage {
16
17 function getName() {
18 return "Shortpages";
19 }
20
21 function isExpensive() {
22 return true;
23 }
24
25 function getSQL() {
26 $dbr =& wfGetDB( DB_SLAVE );
27 $cur = $dbr->tableName( 'cur' );
28
29 return
30 "SELECT 'Shortpages' as type,
31 cur_namespace as namespace,
32 cur_title as title,
33 LENGTH(cur_text) AS value
34 FROM $cur
35 WHERE cur_namespace=0 AND cur_is_redirect=0";
36 }
37
38 function sortDescending() {
39 return false;
40 }
41
42 function formatResult( $skin, $result ) {
43 global $wgLang;
44 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
45 $link = $skin->makeKnownLink( $result->title, "" );
46 return "{$link} ({$nb})";
47 }
48 }
49
50 /**
51 * constructor
52 */
53 function wfSpecialShortpages() {
54 list( $limit, $offset ) = wfCheckLimits();
55
56 $spp = new ShortPagesPage();
57
58 return $spp->doQuery( $offset, $limit );
59 }
60
61 ?>