$_REQUEST -> $wgRequest
[mediawiki.git] / includes / SpecialPopularpages.php
blob23ad5709fb60705aae2e9d8e21dea7ab62b288e6
1 <?php
3 require_once( "QueryPage.php" );
5 class PopularPagesPage extends QueryPage {
7 function getName() {
8 return "Popularpages";
11 function isExpensive() {
12 # cur_counter is not indexed
13 return true;
16 function getSQL() {
17 $dbr =& wfGetDB( DB_SLAVE );
18 $cur = $dbr->tableName( 'cur' );
20 return
21 "SELECT 'Popularpages' as type,
22 cur_namespace as namespace,
23 cur_title as title,
24 cur_counter as value
25 FROM $cur
26 WHERE cur_namespace=0 AND cur_is_redirect=0";
29 function formatResult( $skin, $result ) {
30 global $wgLang;
31 $link = $skin->makeKnownLink( $result->title, "" );
32 $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value ) );
33 return "{$link} ({$nv})";
37 function wfSpecialPopularpages()
39 list( $limit, $offset ) = wfCheckLimits();
41 $ppp = new PopularPagesPage();
43 return $ppp->doQuery( $offset, $limit );