Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SpecialPopularpages.php

Go to the documentation of this file.
00001 <?php 00002 00003 require_once( "QueryPage.php" ); 00004 00005 class PopularPagesPage extends QueryPage { 00006 00007 function getName() { 00008 return "Popularpages"; 00009 } 00010 00011 function isExpensive() { 00012 # cur_counter is not indexed 00013 return true; 00014 } 00015 00016 function getSQL() { 00017 return 00018 "SELECT 'Popularpages' as type, 00019 cur_namespace as namespace, 00020 cur_title as title, 00021 cur_counter as value 00022 FROM cur 00023 WHERE cur_namespace=0 AND cur_is_redirect=0"; 00024 } 00025 00026 function formatResult( $skin, $result ) { 00027 global $wgLang; 00028 $link = $skin->makeKnownLink( $result->title, "" ); 00029 $nv = wfMsg( "nviews", $wgLang->formatNum( $result->value ) ); 00030 return "{$link} ({$nv})"; 00031 } 00032 } 00033 00034 function wfSpecialPopularpages() 00035 { 00036 list( $limit, $offset ) = wfCheckLimits(); 00037 00038 $ppp = new PopularPagesPage(); 00039 00040 return $ppp->doQuery( $offset, $limit ); 00041 } 00042 00043 ?>

Generated on Tue Jun 29 23:40:07 2004 for Mediawiki by doxygen 1.3.7