Extension:TopTenPages
From MediaWiki.org
|
Top Ten Pages Release status: beta |
|
|---|---|
| Implementation | Tag, User activity |
| Description | Shows most viewed Pages |
| Author(s) | Sascha Talk |
| Version | 0.2 (2007-09-04) |
| MediaWiki | 1.7+, earlier may work |
| Download | Extension:TopTenPages/Code N/A N/A |
| Parameters | N/A |
| Added rights | N/A |
| Example | <TopTenPages/> ALT: <TopTenPages offset="1" namespace="usertalk">5</TopTenPages> |
Contents |
[edit] Function
Shows the most popular Pages within an article. I use it on the main page of our Company-Wiki.
<TopTenPages [offset=OFFSET] [namespace=NAMESPACE]>[NUMBEROFPAGES]</TopTenPages>
- OFFSET
- Format: Integer
- Default: 0
- How many of the most popular Pages to ignore. (e.g. offset="1" to ignore the main page)
- NAMESPACE
- Format: One of these Strings ("talk", "user", "image", "template", "help", "category")
- Default: Normal Articles (NS_MAIN) if string is missing or mistyped
- NUMBEROFPAGES
- Format: Integer
- Default: 10
- How many most popular pages should be listed.
[edit] Examples
To show 10 most popular Pages:
<TopTenPages/>
To show 5 most popular Pages:
<TopTenPages>5</TopTenPages>
To omit the most popular page(s):
<TopTenPages offset=1/>
To show most popular (article-)talk-pages:
<TopTenPages namespace="talk"/>
This Extension makes use of the Wiki-Builtin-Function Special:Popularpages with similar functionality (which is disabled in some installations).
[edit] Image description
The Image was created by this code:
==Beliebteste Seiten im Intranet== <TopTenPages>10</TopTenPages> [[Spezial:Popularpages|mehr >>]]
The image was taken from a German installation with monobook-skin. Since the extension recycles the original wiki-code, language within the extension-controlled-content will change according to the interface-language chosen.
[edit] Installation
Copy to your Extensions Directory.
To activate the extension, include it from your LocalSettings.php with:
include("extensions/TopTenPages.php");
The Extension consists mostly of the class QueryPage out of includes/QueryPage.php since I lacked knowledge and time to access the includes/QueryPage.php directly. Hints appreciated.
[edit] Disclaimer
It's my first approach to PHP. For use in Low-Risk-Environment. Use at own risk.

