403801d2b23bde5736584618d6b3a902bdce20ea
[lhc/web/wiklou.git] / includes / SpecialLongpages.php
1 <?php
2
3 include_once( "QueryPage.php" );
4
5 class LongPagesPage extends QueryPage {
6
7 function getName() {
8 return "Longpages";
9 }
10
11 function isExpensive() {
12 return 1;
13 }
14
15 function getSQL( $offset, $limit ) {
16 return "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
17 "WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY len DESC " .
18 "LIMIT {$offset}, {$limit}";
19 }
20
21 function formatResult( $skin, $result ) {
22 global $wgLang;
23 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->len ) );
24 $link = $skin->makeKnownLink( $result->cur_title, "" );
25 return "{$link} ({$nb})";
26 }
27 }
28
29 function wfSpecialLongpages()
30 {
31 list( $limit, $offset ) = wfCheckLimits();
32
33 $lpp = new LongPagesPage( );
34
35 $lpp->doQuery( $offset, $limit );
36 }
37
38 ?>