4 * @addtogroup SpecialPage
9 * @addtogroup SpecialPage
11 class PopularPagesPage
extends QueryPage
{
14 return "Popularpages";
17 function isExpensive() {
18 # page_counter is not indexed
21 function isSyndicated() { return false; }
24 $dbr = wfGetDB( DB_SLAVE
);
25 $page = $dbr->tableName( 'page' );
28 "SELECT 'Popularpages' as type,
29 page_namespace as namespace,
33 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0";
36 function formatResult( $skin, $result ) {
37 global $wgLang, $wgContLang;
38 $title = Title
::makeTitle( $result->namespace, $result->title
);
39 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
40 $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'),
41 $wgLang->formatNum( $result->value
) );
42 return wfSpecialList($link, $nv);
49 function wfSpecialPopularpages() {
50 list( $limit, $offset ) = wfCheckLimits();
52 $ppp = new PopularPagesPage();
54 return $ppp->doQuery( $offset, $limit );