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

bans.php doesn't show Player Name

Eldora

Banned User
Joined
Oct 19, 2009
Messages
604
Reaction score
26
How can I get "Banned Player" name to show?

Note: "value" in bans table equals "id" in players table.
And I basically want to fetch the"name" in the players table to show up under "Banned Player".



1617809939782.png



PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>
<?PHP
$ban_reason = array (
    "OFFENSIVE NAME",
    "NAME CONTAINING PART OF SENTENCE",
    "NAME WITH NONSENSICAL LETTER COMBO",
    "INVALID NAME FORMAT",
    "NAME NOT DESCRIBING PERSON",
    "NAME OF CELEBRITY",
    "NAME REFERRING TO COUNTRY",
    "NAMEFAKING PLAYER IDENTITY",
    "NAMEFAKING OFFICIAL POSITION",
    "OFFENSIVE STATEMENT",
    "SPAMMING",
    "ADVERTISEMENT NOT RELATED TO GAME",
    "REAL MONEY ADVERTISEMENT",
    "NON-ENGLISH PUBLIC STATEMENT",
    "OFF-TOPIC PUBLIC STATEMENT",
    "INCITING RULE VIOLATION",
    "BUG ABUSE",
    "GAME WEAKNESS ABUSE",
    "USING MACRO",
    "USING UNOFFICIAL SOFTWARE TO PLAY",
    "HACKING",
    "MULTI-CLIENTING",
    "ACCOUNT TRADING",
    "ACCOUNT SHARING",
    "THREATENING GAMEMASTER",
    "PRETENDING TO HAVE OFFICIAL POSITION",
    "PRETENDING TO HAVE INFLUENCE ON GAMEMASTER",
    "FALSE REPORT TO GAMEMASTER",
    "EXCESSIVE UNJUSTIFED PLAYER KILLING",
    "DESTRUCTIVE BEHAVIOUR",
    "SPOILING AUCTION",
    "INVALID PAYMENT",
    "NOTHING"
);

$players_banned = mysql_select_multi('SELECT `bans`.`value`, `bans`.`comment`, `bans`.`admin_id`, `bans`.`expires`, `bans`.`added`, `bans`.`reason` FROM `bans`, `players` WHERE `players`.`id` = `bans`.`value` AND `bans`.`type` = 2 AND `bans`.`active` = 1 GROUP BY `bans`.`value` ORDER BY `bans`.`added` DESC');
if(!$players_banned) { ?>
<h2><center><b>There are no players banned on <?php echo $config['site_title'] ?>!</b></center></h2>
<?php } else {
    $number_of_players = 0;       
    foreach($players_banned as $player) {
        $nick = mysql_select_multi("SELECT name, id, level, account_id FROM `players` WHERE account_id =".$player['value']." ORDER BY level DESC LIMIT 1");
        $gmnick = mysql_select_multi("SELECT name, id FROM `players` WHERE id =".$player['admin_id']."");
        
        if($player['admin_id'] >= "1")
            $banby = "<a href=characterprofile.php?name=".$gmnick['name']."><font color ='green'>".$gmnick['name']."</font></a>";
        else
            $banby = "Auto Ban";
            
        $number_of_players++;
        
        if(is_int($number_of_players / 2))
            $bgcolor = '#F1E0C6';
        else
            $bgcolor = '#D4C0A1';
        
        if ($player['expires'] == -1) // If the banishment is permanent
            $expires = "PERMANENT";
        else
            $expires = date("d/m/Y, G:i:s", $player['expires']);
        
            
        $players_rows .= '<TR BGCOLOR='.$bgcolor.'>
            <TD align="center"><A HREF="characterprofile.php?name='.$nick['name'].'">'.$nick['name'].'</A></TD>
            <TD align="center">'.$ban_reason[$player['reason']].'</TD>
            <TD align="center">'.$player['comment'].'</TD>
            <TD align="center">'.$banby.'</TD>
            <TD align="center">'.date("d/m/Y, G:i:s", $player['added']).'</TD>
            <TD align="center">'.$expires.'</TD>
        </TR>';
    } ?>
    
    <!-- List of players -->
    <h1>Banned Players</h1>
    <TABLE BORDER="2" CELLSPACING="1" CELLPADDING="4" WIDTH="100%">
        <TR><TD CLASS="white"><b><center>Banned Player</center></b></TD>
        <TD class="white"><b><center>Reason</center></b></TD>
        <TD class="white"><b><center>Comment</center></b></TD>
        <TD class="white"><b><center>Banned By</center></b></TD>
        <TD class="white"><b><center>Added</center></b></TD>
        <TD class="white"><b><center>Expires</center></b></TD></TR><?php echo $players_rows ?>
    </TABLE>
    
<?php } ?>

<?php include 'layout/overall/footer.php'; ?>
 
Back
Top