Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37885366
en ru br
ALT Linux repos
S:0.4.0-alt1

Group :: Networking/WWW
RPM: mediawiki-extensions-TopTenPages

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

TopTenPages-0.3.2/000075500000000000000000000000001230462722400137055ustar00rootroot00000000000000TopTenPages-0.3.2/SpecialTopTenPages.php000064400000000000000000000010611230462722400201060ustar00rootroot00000000000000<?php
class SpecialTopTenPages extends PopularPagesPage {
public function __construct( $name = 'TopTenPages' ) {
parent::__construct( $name );
$inc = $this->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.php000064400000000000000000000024471230462722400166160ustar00rootroot00000000000000<?php
# To install the extension, add to your LocalSettings.php:
# require_once("$IP/extensions/TopTenPages.php");

/*
Syntax:
<TopTenPages/>
<TopTenPages>5</TopTenPages>
<TopTenPages offset="1"/>
{{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 );
}
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin