Add it in the new page http://127.0.0.1/index.php/admi/createPage
Then add into the config.php
This will work if you follow the http://otland.net/f118/gesior-aac-most-creature-killers-update-fixed-1-query-69920/ topic how to make the script working
Also you need to copy monster folder to your main directory
Fix, updated thanks to Zonet:
Code:
<?php
/* Scrip by zonet */
/* Modern Aac version by Kavvson */
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
/* Color config */
$color1 = "#a46f00" ;
ECHO '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%">
<tr bgcolor="'.$color1.'" style="color: white;"><th width="10%">Creature</th><th>Creature name</th><th>Most Killer ( '.$limit.' )</th></tr>';
$row = 1;
foreach($kills as $name => $storage) {
$qa = $SQL->query('SELECT `player_storage`.`player_id`, `player_storage`.`key`, `player_storage`.`value` AS `value`, `players`.`id`, `players`.`name` AS `name` FROM `player_storage` LEFT JOIN `players` ON `player_storage`.`player_id` = `players`.`id` WHERE `player_storage`.`key` = '.$storage.' ORDER BY ABS(value) DESC LIMIT '.$limit)->fetchAll();
/* Color config */
$color = ( $row % 2 ? "#e5cc97" : "#eeddb9" );
$row++;
ECHO '<tr bgcolor="'.$color.'"><td><img src="/monsters/'.(str_replace(" ", "" , $name)).'.gif"></td><td width="20%" style="font-size: 13pt; font-weight: bold; color: darkorange;"><center>'.(ucfirst($name)).'</center></td><td>';
$a = 0;
foreach( $qa as $q )
{
$a++;
if($a == 1)
ECHO '<font color="green">';
if($a == $limit)
ECHO '<font color="red">';
if($a == $limit/2)
ECHO '<font color="darkorange">';
ECHO '<b>'.$a.'. Name:</b> <a href="'.WEBSITE.'/index.php/character/view/'.$q['name'].'">'.$q['name'].'</a> (Kills: '.$q['value'].') </font></font></font><br />';
}
}
ECHO '</td></table>';
?>
Then add into the config.php
Code:
/* Kill configuration */
$kills = array('rat' => 3001, 'cave rat' => 3002, 'troll' => 3003, 'wyrm' => 9544, 'demon' => 9545);
$limit= 5;
This will work if you follow the http://otland.net/f118/gesior-aac-most-creature-killers-update-fixed-1-query-69920/ topic how to make the script working
Also you need to copy monster folder to your main directory
Fix, updated thanks to Zonet:
Here
PHP:<?PHP /* Scrip by zonet */ /* Modern Aac version by Kavvson */ /* Kill configuration */ $kills = array('rat' => 3001, 'cave rat' => 3002, 'troll' => 3003, 'wyrm' => 9544, 'demon' => 9545); $limit= 5; require("config.php"); $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $SQL = $ots->getDBHandle(); /* Color config */ $color1 = "#a46f00" ; ECHO '<table border="0px" cellspacing="1px" cellpadding="4px" width="100%"> <tr bgcolor="'.$color1.'" style="color: white;"><th width="10%">Creature</th><th>Creature name</th><th>Most Killer ( '.$limit.' )</th></tr>'; $row = 1; foreach($kills as $name => $storage) { $qa = $SQL->query('SELECT `player_storage`.`player_id`, `player_storage`.`key`, `player_storage`.`value` AS `value`, `players`.`id`, `players`.`name` AS `name` FROM `player_storage` LEFT JOIN `players` ON `player_storage`.`player_id` = `players`.`id` WHERE `player_storage`.`key` = '.$storage.' ORDER BY ABS(value) DESC LIMIT '.$limit)->fetchAll(); /* Color config */ $color = ( $row % 2 ? "#e5cc97" : "#eeddb9" ); $row++; ECHO '<tr bgcolor="'.$color.'"><td><img src="/monsters/'.(str_replace(" ", "" , $name)).'.gif"></td><td width="20%" style="font-size: 13pt; font-weight: bold; color: darkorange;"><center>'.(ucfirst($name)).'</center></td><td>'; $a = 0; foreach( $qa as $q ) { $a++; if($a == 1) ECHO '<font color="green">'; if($a == $limit) ECHO '<font color="red">'; if($a == $limit/2) ECHO '<font color="darkorange">'; ECHO '<b>'.$a.'. Name:</b> <a href="'.WEBSITE.'/index.php/character/view/'.$q['name'].'">'.$q['name'].'</a> (Kills: '.$q['value'].') </font></font></font><br />'; } } ECHO '</td></table>'; ?>
Last edited by a moderator: