• 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!

Showing [Baned] like highscores

Rodo

New Member
Joined
Oct 23, 2007
Messages
575
Solutions
1
Reaction score
3
Location
Mexico
Well, I have the following script on my layout.php but I want that if player is banned, the text [Banned] appear like the highscore section, can someone make this one? :thumbup:



captura.png




PHP:
   <?php
   $limitt = 5;
   $zap = $SQL->query('SELECT `name`, `level` FROM `players` WHERE `group_id` < '.$config['site']['players_group_id_block'].' AND `name` != "Account Manager" ORDER BY `level` DESC, `experience` DESC LIMIT 5;');
   $number_of_rows = 0;
   foreach($zap as $wynik)
   {
      $number_of_rows++;
      echo ' <a href="index.php?subtopic=characters&name='.urlencode($wynik['name']).'" > <li class="light">'.$number_of_rows.'. '.$wynik['name'].'</b></a><font color=gray>Level: </font><font color=white> '.$wynik['level'].'</font></li>';
   }
   ?>
 
Last edited:
i'm @ msn dude

if it's gesior can be done from here:

PHP:
$ban = '';
if($account->isLoaded() && $account->isBanned())
$ban = '<span style="color:red"> [Banned]</span>';

nope, another query would be better, from 'bans' table
 
Last edited:
PHP:
<?php
   $limitt = 5;
   $zap = $SQL->query('SELECT players.`name` , players.`level` , bans.`active`
		FROM `players`
		LEFT JOIN bans ON bans.`value` = players.`id` OR bans.`value` = players.`account_id`
		WHERE players.`group_id` < '.$config['site']['players_group_id_block'].'
		AND players.`name` != "Account Manager"
		ORDER BY players.`level` DESC , players.`experience` DESC
		LIMIT '.$limitt);
   $number_of_rows = 0;
   foreach($zap as $wynik)
   {
      $number_of_rows++;
	  $msg = ' <a href="index.php?subtopic=characters&name='.urlencode($wynik['name']).'" > ';
	  if($wynik['active'])
		$msg .= '<font color=red><b>[Banned]</b></font>';
      $msg.= '<li class="light">'.$number_of_rows.'. '.$wynik['name'].'</b></a><font color=gray>Level: </font><font color=white> '.$wynik['level'].'</font></li>';
      echo $msg;
   }
?>
 
Last edited:
PHP:
<?php
   $limitt = 5;
   $zap = $SQL->query('SELECT players.`name` , players.`level` , bans.`active`
		FROM `players`
		LEFT JOIN bans ON bans.`value` = players.`id` OR bans.`value` = players.`account_id`
		WHERE players.`group_id` < '.$config['site']['players_group_id_block'].'
		AND players.`name` != "Account Manager"
		ORDER BY players.`level` DESC , players.`experience` DESC
		LIMIT '.$limitt)->fetchAll();
   $number_of_rows = 0;
   foreach($zap as $wynik)
   {
      $number_of_rows++;
	  $msg = ' <a href="index.php?subtopic=characters&name='.urlencode($wynik['name']).'" > ';
	  if($wynik['active'])
		$msg .= '<font color=red><b>[Banned]</b></font>';
      $msg.= '<li class="light">'.$number_of_rows.'. '.$wynik['name'].'</b></a><font color=gray>Level: </font><font color=white> '.$wynik['level'].'</font></li>';
      echo $msg;
   }
?>

? xD
 
PHP:
SELECT players.`name` , players.`level` , bans.`active`
        FROM `players`
        LEFT JOIN bans ON bans.`value` = players.`id` OR bans.`value` = players.`account_id`
        WHERE players.`group_id` < 3
        AND players.`name` != "Account Manager"
        ORDER BY players.`level` DESC , players.`experience` DESC
        LIMIT 5

execute this query, and tell me an output. You can always msg me on msn.
 
It select 4 times the same player


name level active
Coco Rapado 355 0
Coco Rapado 355 0
Coco Rapado 355 1
Coco Rapado 355 0
 
Last edited:
Back
Top