[Rev] Banlist fix [ASE]

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,199
3,934
Hi,

So I was working on our ASE at HabboXP and I noticed how poor ASE actually is, as we're rebuilding ours, and I saw that if one person was banned it would drag out x9999 and even more, so replace your php code getting the bans with this:

PHP:
<?php
$getBans = mysql_query("SELECT * FROM bans");
 
while(($ban = mysql_fetch_array($getBans))) 
{
echo "<tr><td>" . $ban['value'] ."</td><td>" . $ban['reason'] . "</td><td>" . $ban['added_by'] . "</td><td><a href='?url=banlist&unban=" . $ban['id'] . "'><b>Unban</b></a></td></tr>";
}
?>

- Cheers.
 

Kristopher

Photographer
Dec 25, 2010
803
68
You shoudl release ur HK or alteast get one working to release.. But anyways i will use when i get get it working!
 

presto5

Member
Jul 26, 2011
66
1
I guess this is better than the code I took for phoenix php hk

Since the remove button I didnt feel like fixing.

PHP:
<table width="100%" border="0" cellspacing="0">
<thead style="margin-bottom:10px;">
<tr>
<td width="10%">Ban ID</td>
    <td width="10%">Type</td>
<td width="15%">Data</td>
<td width="30%">Reason</td>
<td width="10%">Expires</td>
<td width="15%">Added By</td>
<td width="10%">Option</td>
</tr>
</thead>
<?php
$banq = mysql_query("SELECT * FROM bans");
while($ban = mysql_fetch_array($banq))
{
?>
<tr>
<td><?php echo $ban['id']; ?></td>
    <td><?php echo strtoupper($ban['bantype']); ?></td>
<td><?php echo $ban['value']; ?></td>
<td><?php echo $ban['reason']; ?></td>
<td><?php if($ban['expire'] < time()) echo 'Expired'; else echo @date("d-m-Y H:i", $ban['expire']); ?></td>
<td><?php echo $ban['added_by']; ?></td>
<td><button class="left" onClick="RemoveBan('<?php echo $ban['id']; ?>');" href="#">Remove</button></td>
</tr>
<?php
}
?>

Right Now I have your code edited too

PHP:
<tr><td><b>Username</b></td><td><b>Reason</b></td><td><b>Banned by</b></td><td><b>Expires</b></td><td><b>Value</b></td></tr>
<?php
$getBans = mysql_query("SELECT * FROM bans");
 
while(($ban = mysql_fetch_array($getBans))) 
{
echo "<tr><td>" . $ban['value'] ."</td><td>" . $ban['reason'] . "</td><td>" . $ban['added_by'] . "</td><td>" . @date("d-m-Y H:i", $ban['expire']) . "</td><td><a href='?url=banlist&unban=" . $ban['id'] . "'><b>Unban</b></a></td></tr>";
}
?>


Could someone help me add it to where is says expired if the ban is expired.
 

Users who are viewing this thread

Top