Difference between revisions 607816 and 610198 on mediawikiwiki

__TOC__
==TopTenPages.php==
<syntaxhighlight lang="php">
<?php
 
# To install the extension, add to your LocalSettings.php:
# require_once("$IP/extensions/TopTenPages.php");

(contracted; show full)	} else {
		$limit = 10;
	}
 	return $parser->recursiveTagParse( "{{Special:TopTenPages/$offset/$limit}}", $frame );
}

</syntaxhighlight>
==SpecialTopTenPage
s.php==
<syntaxhighlight lang="php">

<?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 );
	}
}
</syntaxhighlight>