5 * @subpackage SpecialPage
11 require_once( "QueryPage.php" );
16 * @subpackage SpecialPage
18 class PopularPagesPage
extends QueryPage
{
21 return "Popularpages";
24 function isExpensive() {
25 # cur_counter is not indexed
30 $dbr =& wfGetDB( DB_SLAVE
);
31 $cur = $dbr->tableName( 'cur' );
34 "SELECT 'Popularpages' as type,
35 cur_namespace as namespace,
39 WHERE cur_namespace=0 AND cur_is_redirect=0";
42 function formatResult( $skin, $result ) {
44 $link = $skin->makeKnownLink( $result->title
, "" );
45 $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value
) );
46 return "{$link} ({$nv})";
53 function wfSpecialPopularpages() {
54 list( $limit, $offset ) = wfCheckLimits();
56 $ppp = new PopularPagesPage();
58 return $ppp->doQuery( $offset, $limit );