blob: a261ce18f6148c21164909a1cea9bed66f8f0d3a (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
<?php
/**
*
*/
/**
*
*/
require_once( "QueryPage.php" );
/**
*
*/
class PopularPagesPage extends QueryPage {
function getName() {
return "Popularpages";
}
function isExpensive() {
# cur_counter is not indexed
return true;
}
function getSQL() {
$dbr =& wfGetDB( DB_SLAVE );
$cur = $dbr->tableName( 'cur' );
return
"SELECT 'Popularpages' as type,
cur_namespace as namespace,
cur_title as title,
cur_counter as value
FROM $cur
WHERE cur_namespace=0 AND cur_is_redirect=0";
}
function formatResult( $skin, $result ) {
global $wgLang;
$link = $skin->makeKnownLink( $result->title, "" );
$nv = wfMsg( "nviews", $wgLang->formatNum( $result->value ) );
return "{$link} ({$nv})";
}
}
/**
* Constructor
*/
function wfSpecialPopularpages() {
list( $limit, $offset ) = wfCheckLimits();
$ppp = new PopularPagesPage();
return $ppp->doQuery( $offset, $limit );
}
?>
|