Stop loading feed.php every time by moving available feeds classes in defines.php...
[lhc/web/wiklou.git] / includes / SpecialLongpages.php
1 <?php
2 /**
3 *
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
7
8 /**
9 *
10 */
11 require_once( "QueryPage.php" );
12
13 /**
14 *
15 * @package MediaWiki
16 * @subpackage SpecialPage
17 */
18 class LongPagesPage extends QueryPage {
19
20 function getName() {
21 return "Longpages";
22 }
23
24 function isExpensive() {
25 return true;
26 }
27
28 function getSQL() {
29 $dbr =& wfGetDB( DB_SLAVE );
30 $cur = $dbr->tableName( 'cur' );
31
32 return
33 "SELECT 'Longpages' as type,
34 cur_namespace as namespace,
35 cur_title as title,
36 LENGTH(cur_text) AS value
37 FROM $cur
38 WHERE cur_namespace=0 AND cur_is_redirect=0";
39 }
40
41 function formatResult( $skin, $result ) {
42 global $wgLang;
43 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
44 $link = $skin->makeKnownLink( $result->title, "" );
45 return "{$link} ({$nb})";
46 }
47 }
48
49 /**
50 * constructor
51 */
52 function wfSpecialLongpages()
53 {
54 list( $limit, $offset ) = wfCheckLimits();
55
56 $lpp = new LongPagesPage( );
57
58 $lpp->doQuery( $offset, $limit );
59 }
60
61 ?>