aboutsummaryrefslogtreecommitdiffstats
path: root/includes/SpecialLongpages.php
blob: 6139fdb58c76c630b62d6b3e4de9fc59f2540e7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

require_once( "QueryPage.php" );

class LongPagesPage extends QueryPage {

	function getName() {
		return "Longpages";
	}

	function isExpensive() {
		return true;
	}

	function getSQL() {
		return
			"SELECT 'Longpages' as type,
					cur_namespace as namespace,
			        cur_title as title,
			        LENGTH(cur_text) AS value
			FROM cur
			WHERE cur_namespace=0 AND cur_is_redirect=0";
	}

	function formatResult( $skin, $result ) {
		global $wgLang;
		$nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value ) );
		$link = $skin->makeKnownLink( $result->title, "" );
		return "{$link} ({$nb})";
	}
}

function wfSpecialLongpages()
{
    list( $limit, $offset ) = wfCheckLimits();

    $lpp = new LongPagesPage( );
    
    $lpp->doQuery( $offset, $limit );
}

?>