MediawikiExtensions/Top Pages

A new extension to display the most popular wiki pages, ordered by number of hits.

example
10 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
10

extension source
setHook( "toppages", "renderTopPages" ); }

function renderTopPages( $input ) {

$input = mysql_escape_string($input);

if (is_int($input)){ $limit = $input; } else { $limit = 5; }
 * 1) check if input is integer else set to 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=" ";

return $output; }