TopTenPages-0.3.2/ 0000755 0000000 0000000 00000000000 12304627224 0013705 5 ustar 00root root 0000000 0000000 TopTenPages-0.3.2/SpecialTopTenPages.php 0000644 0000000 0000000 00000001061 12304627224 0020106 0 ustar 00root root 0000000 0000000 including();
}
public function isIncludable() {
return true;
}
function isListed() {
return false;
}
function execute( $par ) {
$inc = $this->including();
if ( $inc ) {
$parts = explode( '/', $par, 3 );
$this->offset = (int)$parts[0];
$this->limit = (int)$parts[1];
}
$this->setListoutput( false );
$this->shownavigation = !$inc;
parent::execute( $par );
}
}
TopTenPages-0.3.2/TopTenPages.php 0000644 0000000 0000000 00000002447 12304627224 0016616 0 ustar 00root root 0000000 0000000
5
{{Special:TopTenPages}}
{{Special:TopTenPages/-/5}}
{{Special:TopTenPages/1/5}}
*/
$wgExtensionCredits['specialpage'][] = array(
'name' => 'TopTenPages',
'version' => '0.3.1',
'author' => array(
'Timo Tijhof',
'Sascha',
),
'url' => 'https://www.mediawiki.org/wiki/Extension:TopTenPages',
'description' => 'Shows most viewed pages.',
);
$wgAutoloadClasses['SpecialTopTenPages'] = __DIR__ . '/SpecialTopTenPages.php';
$wgSpecialPages['TopTenPages'] = 'SpecialTopTenPages';
$wgSpecialPageGroups['TopTenPages'] = 'other';
$wgExtensionFunctions[] = 'efTopTenPages';
function efTopTenPages() {
global $wgParser;
$wgParser->setHook( 'TopTenPages', 'efTopTenPagesRender' );
}
/**
* The callback function for converting the input text to HTML output.
*/
function efTopTenPagesRender( $text, array $args, Parser $parser, PPFrame $frame ) {
if (array_key_exists('offset', $args)) {
$offset = (int) $args['offset'];
} else {
$offset = 0;
}
if ($text > 0){
$limit = (int) $text;
} else {
$limit = 10;
}
return $parser->recursiveTagParse( "{{Special:TopTenPages/$offset/$limit}}", $frame );
}