• 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 - Creating Top 5 table

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
Greetings.

This is not a injection.. This time its a SQL Query.

Tutorial where to place it?

enter the following direction \injections\home crate a new folder with a name Aleh-Table paste in it the code.. Save it as injection.php

How to display the content?

Add a line in your template file. Templates/templatename/index.tpl

PHP:
{include_php file='templates\Kavvson\topplayer.php'}

It might be like this
PHP:
<div class="top-box">
{include_php file='templates\Kavvson\css\topplayer.php'}			
</div>

Create a file topplayer.php and paste in it the content. The file put in Templates/templatename/topplayer.php

PHP:
<?PHP
//** Connection to the database **//
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = POT::getInstance()->getDBHandle();

//** Top Players + online status By Kavvson **//
								$money_list = $SQL->query('SELECT name,level,experience FROM players ORDER BY experience DESC LIMIT 5')->fetchAll();
										$i = 1;
										foreach($money_list as $money_chr){
										echo '<center>';
											echo $i.'. <a href="?subtopic=characters&name='.urlencode($money_chr['name']).'">';
		$player = $ots->createObject('Player');
        $player->find($money_chr['name']); 
						echo '<font color="';
                        echo ($player->isOnline()) ? 'green' : 'red';
                        echo '">';	
						echo '<b>'.$money_chr['name'].'</b></a></font>';
						echo  '<br>Level: <B>'.$money_chr['level'].'</B><br>';
											$i++;
										}
										for( $i; $i <= 5; $i++ ){
											echo $i.'. <br><i>Empty</i><br /><br />';
										}
										echo '</center>';
										
?>

What functions do it have?

topexp.png


+ Display top 5 exp
+ Display the status (on/off)

This time all credits goes to me. Rep me!!! or leave :p
 
Who are you to approve this? :confused:

@Thread:
Amazing, but still waiting for the final release to use it :)
 
Thx i will have to create soon some new injections for modern aac
 
Uhm you will need to change

echo $i.'. <a href="?subtopic=characters&name='.urlencode($money_chr['name']).'">';

into

echo $i.'. <a href="/character/view/'.urlencode($money_chr['name']).'">';
 
Uhm you will need to change

echo $i.'. <a href="?subtopic=characters&name='.urlencode($money_chr['name']).'">';

into

echo $i.'. <a href="/character/view/'.urlencode($money_chr['name']).'">';
Wont work...

use this one
Code:
echo $i.'. <a href="'.WEBSITE.'/index.php/character/view/'.$money_chr['name'].'">';
Yours will use "+" for a space,
this one "%20" and modernAAC uses "%20"
 
Nice :D
Btw, the query-line should be:
PHP:
$money_list = $SQL->query('SELECT `name`, `level`, `experience` FROM `players` WHERE `group_id` < 4 AND `account_id` != \'1\' ORDER BY `experience` DESC LIMIT 5')->fetchAll();
So it won't show nor Gamemasters, CMs, Gods; neither players from account 1 (samples or acc manager).
 
Im using wow template in modern, I can see it! Its just the div that contain
"Top Exp" what i should do to get work this sh¨*¨*?

Thx =)
 
Back
Top