• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Modern AAC Page - Most Creature Killers!

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
Add it in the new page http://127.0.0.1/index.php/admi/createPage

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:
I cant get it to work on latest rev of Modern AAC

here is error

PHP:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: limit

Filename: pages/creature.php

Line Number: 12
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: kills

Filename: pages/creature.php

Line Number: 14
A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: pages/creature.php

Line Number: 14

And here is script

PHP:
<?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>';
?>
 
Put it in the same file, don't add new values to config.php because when u update you will loose them. Config is just for system itself.
 
Put it in the same file, don't add new values to config.php because when u update you will loose them. Config is just for system itself.

so I should put
PHP:
/* Kill configuration */
$kills = array('rat' => 3001, 'cave rat' => 3002, 'troll' => 3003, 'wyrm' => 9544, 'demon' => 9545);
$limit= 5;

where in the injection.php file?
 
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>';
?>
 
so I should put
PHP:
/* Kill configuration */
$kills = array('rat' => 3001, 'cave rat' => 3002, 'troll' => 3003, 'wyrm' => 9544, 'demon' => 9545);
$limit= 5;

where in the injection.php file?


Where do i place this File??
 
Oh, well i pasted it all in the Page, It gives me this error.

Code:
Parse error: syntax error, unexpected T_LNUMBER in C:\xampplite\htdocs\system\pages\creaturekills.php on line 24
 
Please if one person have one error there, look to explain it more better, because give the error is easy.. but who knows why.
Explaining it more better = tell how u do it and what are u using.
 
Please if one person have one error there, look to explain it more better, because give the error is easy.. but who knows why.
Explaining it more better = tell how u do it and what are u using.

Ofc,

Let me rephrase it.

I get this error when i load the page, after i copied the codes into a newly created page.

I use ModernAAC 1.0
and i host it with xampp.
 
Oh, well i pasted it all in the Page, It gives me this error.

Code:
Parse error: syntax error, unexpected T_LNUMBER in C:\xampplite\htdocs\system\pages\creaturekills.php on line 24

I have the same error :(
 
@up, replace line 24 with this
PHP:
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>');

and make sure you have the monster folder.
 
Back
Top