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 $title = Title
::makeTitle( $result->namespace, $result->title
);
46 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
47 $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value
) );
48 return "{$link} ({$nv})";
55 function wfSpecialPopularpages() {
56 list( $limit, $offset ) = wfCheckLimits();
58 $ppp = new PopularPagesPage();
60 return $ppp->doQuery( $offset, $limit );