add Last-Modified header
[lhc/web/wiklou.git] / includes / SpecialShortpages.php
1 <?php
2 #
3 # SpecialShortpages extends QueryPage. It is used to return the shortest
4 # pages in the database.
5 #
6
7 require_once("QueryPage.php");
8
9 class ShortPagesPage extends QueryPage {
10
11 function getName() {
12 return "Shortpages";
13 }
14
15 function isExpensive() {
16 return true;
17 }
18
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";
27 }
28
29 function sortDescending() {
30 return false;
31 }
32
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})";
38 }
39 }
40
41 function wfSpecialShortpages() {
42 list( $limit, $offset ) = wfCheckLimits();
43
44 $spp = new ShortPagesPage();
45
46 return $spp->doQuery( $offset, $limit );
47 }
48
49 ?>