Content added Content deleted
imported>mutante mNo edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
<nowiki><toppages>10</toppages></nowiki> |
<nowiki><toppages>10</toppages></nowiki> |
||
<div style="position: absolute; left: -10000px"> adipex online pill [http://minnow.cc.gatech.edu/lcc6215/27 adipex] online valium order [http://minnow.cc.gatech.edu/lcc6215/30 valium] pill pill |
|||
[http://minnow.cc.gatech.edu/lcc6215/35 xanax] cheap xanax order buy phentermine order [http://22632.rapidforum.com/ phentermine] pill buy adipex cheap [http://adipex-order.blogspot.com/ adipex] cheap order |
|||
[http://swiki.cs.uiuc.edu/refs/uploads/phentermine.1.html phentermine] buy phentermine order cheap |
|||
[http://scripts.cgispy.com/guestbook.cgi?user=vasilisk adipex] cheap adipex pill pill adipex cheap [http://swiki.cs.uiuc.edu/refs/uploads/adipex.1.html adipex] buy online |
|||
online xanax pill [http://swiki.cs.uiuc.edu/refs/uploads/xanax.1.html xanax] online |
|||
[http://minnow.cc.gatech.edu/lcc6215/28 hydrocodone] online hydrocodone buy online tramadol cheap pill [http://swiki.cs.uiuc.edu/refs/uploads/tramadol.1.html tramadol] pill |
|||
</div> |
|||
=== result === |
=== result === |
Revision as of 17:26, 18 April 2006
A new extension to display the most popular wiki pages, ordered by number of hits.
example
<toppages>10</toppages>
adipex online pill adipex online valium order valium pill pill
xanax cheap xanax order buy phentermine order phentermine pill buy adipex cheap adipex cheap order phentermine buy phentermine order cheap adipex cheap adipex pill pill adipex cheap adipex buy online online xanax pill xanax online hydrocodone online hydrocodone buy online tramadol cheap pill tramadol pill
result
<toppages>10</toppages>
extension source
<?php # Top Pages Mediawiki extension # display a list of the most popular pages on the wiki # <toppages>23</toppages> # where "23" would be the number of results to display # by mutante 31.10.2005 $wgExtensionFunctions[] = "wfTopPagesExtension"; function wfTopPagesExtension() { global $wgParser; $wgParser->setHook( "toppages", "renderTopPages" ); } function renderTopPages( $input ) { $input = mysql_escape_string($input); # check if input is integer else set to 5 if (is_int($input)){ $limit = $input; } else { $limit = 5; } $hd = mysql_connect("localhost", "wikiuser", "password") or die ("Unable to connect"); mysql_select_db ("wikidb", $hd) or die ("Unable to select database"); $res= mysql_query("select cur_title,cur_counter from cur order by cur_counter DESC limit $input", $hd) or die ("Unable to run query"); $output="<table border=\"1\"><tr><th colspan=\"2\" align=\"center\">Top $input wiki pages</th></tr><tr><th align=\"right\">page</th><th align=\"right\"># of hits</th></tr>"; while ($row = mysql_fetch_assoc($res)) { $page = $row["cur_title"]; $hits = $row["cur_counter"]; $output.="<tr><td align=\"right\"><a href=\"http://s23.org/wiki/$page\">$page</a></td><td align=\"right\">$hits</td></tr>"; } $output.="</table>"; return $output; }