5 * @subpackage SpecialPage
11 require_once( "QueryPage.php" );
16 * @subpackage SpecialPage
18 class PopularPagesPage
extends QueryPage
{
21 return "Popularpages";
24 function isExpensive() {
25 # page_counter is not indexed
28 function isSyndicated() { return false; }
31 $dbr =& wfGetDB( DB_SLAVE
);
32 $page = $dbr->tableName( 'page' );
35 "SELECT 'Popularpages' as type,
36 page_namespace as namespace,
40 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0";
43 function formatResult( $skin, $result ) {
44 global $wgLang, $wgContLang;
45 $link = $skin->makeKnownLink( $result->title
, $wgContLang->convert( $result->title
) );
46 $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value
) );
47 return "{$link} ({$nv})";
54 function wfSpecialPopularpages() {
55 list( $limit, $offset ) = wfCheckLimits();
57 $ppp = new PopularPagesPage();
59 return $ppp->doQuery( $offset, $limit );