Replace ugly abuse of log pages to store cached results of query pages
[lhc/web/wiklou.git] / includes / SpecialShortpages.php
1 <?php
2
3 require_once("QueryPage.php");
4
5 class ShortPagesPage extends QueryPage {
6
7 function getName() {
8 return "Shortpages";
9 }
10
11 function isExpensive() {
12 return true;
13 }
14
15 function getSQL() {
16 return
17 "SELECT 'Shortpages' as type,
18 cur_namespace as namespace,
19 cur_title as title,
20 LENGTH(cur_text) AS value
21 FROM cur
22 WHERE cur_namespace=0 AND cur_is_redirect=0";
23 }
24
25 function sortDescending() {
26 return false;
27 }
28
29 function formatResult( $skin, $result ) {
30 global $wgLang;
31 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
32 $link = $skin->makeKnownLink( $result->title, "" );
33 return "{$link} ({$nb})";
34 }
35 }
36
37 function wfSpecialShortpages()
38 {
39 list( $limit, $offset ) = wfCheckLimits();
40
41 $spp = new ShortPagesPage();
42
43 return $spp->doQuery( $offset, $limit );
44 }
45
46 ?>