Revert the attempt to autodetect CGI configs with working PATHINFO, since it turns...
[mediawiki.git] / includes / SpecialPopularpages.php
blob77d41437c5fa59a00231618138aba18c2ec4cd2e
1 <?php
2 /**
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
8 /**
10 * @package MediaWiki
11 * @subpackage SpecialPage
13 class PopularPagesPage extends QueryPage {
15 function getName() {
16 return "Popularpages";
19 function isExpensive() {
20 # page_counter is not indexed
21 return true;
23 function isSyndicated() { return false; }
25 function getSQL() {
26 $dbr =& wfGetDB( DB_SLAVE );
27 $page = $dbr->tableName( 'page' );
29 return
30 "SELECT 'Popularpages' as type,
31 page_namespace as namespace,
32 page_title as title,
33 page_counter as value
34 FROM $page
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);
48 /**
49 * Constructor
51 function wfSpecialPopularpages() {
52 list( $limit, $offset ) = wfCheckLimits();
54 $ppp = new PopularPagesPage();
56 return $ppp->doQuery( $offset, $limit );