5 * @subpackage SpecialPage
11 * @subpackage SpecialPage
13 class PopularPagesPage
extends QueryPage
{
16 return "Popularpages";
19 function isExpensive() {
20 # page_counter is not indexed
23 function isSyndicated() { return false; }
26 $dbr =& wfGetDB( DB_SLAVE
);
27 $page = $dbr->tableName( 'page' );
30 "SELECT 'Popularpages' as type,
31 page_namespace as namespace,
35 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0";
38 function formatResult( $skin, $result ) {
39 global $wgLang, $wgContLang;
40 $title = Title
::makeTitle( $result->namespace, $result->title
);
41 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
42 $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'),
43 $wgLang->formatNum( $result->value
) );
44 return wfSpecialList($link, $nv);
51 function wfSpecialPopularpages() {
52 list( $limit, $offset ) = wfCheckLimits();
54 $ppp = new PopularPagesPage();
56 return $ppp->doQuery( $offset, $limit );