Changing comments layout preparing for generated documentation with Phpdocumentor
[lhc/web/wiklou.git] / includes / SpecialPopularpages.php
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 require_once( "QueryPage.php" );
10
11 /**
12 *
13 */
14 class PopularPagesPage extends QueryPage {
15
16 function getName() {
17 return "Popularpages";
18 }
19
20 function isExpensive() {
21 # cur_counter is not indexed
22 return true;
23 }
24
25 function getSQL() {
26 $dbr =& wfGetDB( DB_SLAVE );
27 $cur = $dbr->tableName( 'cur' );
28
29 return
30 "SELECT 'Popularpages' as type,
31 cur_namespace as namespace,
32 cur_title as title,
33 cur_counter as value
34 FROM $cur
35 WHERE cur_namespace=0 AND cur_is_redirect=0";
36 }
37
38 function formatResult( $skin, $result ) {
39 global $wgLang;
40 $link = $skin->makeKnownLink( $result->title, "" );
41 $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value ) );
42 return "{$link} ({$nv})";
43 }
44 }
45
46 /**
47 * Constructor
48 */
49 function wfSpecialPopularpages() {
50 list( $limit, $offset ) = wfCheckLimits();
51
52 $ppp = new PopularPagesPage();
53
54 return $ppp->doQuery( $offset, $limit );
55 }
56
57 ?>