How would I do this?

Status
Not open for further replies.

Worldcomer

New Member
Jul 30, 2013
21
3
Hello! Just wondering, how would I count the bans, similar to Fresh? Screenshot below.

9a3.png


Like, get the amount of time someone has banned someone? If I could have some help, that'd be fantastic.
 

AssLikeThat

Posting Freak
Jan 27, 2013
765
154
Something like this:

Code:
<?php
$bans= "SELECT COUNT(*) FROM bans WHERE username= '.$Users['username'].'";
$bancount= mysql_fetch_assoc($bans);
echo $bancount;
?>

Not sure if thats completely right :L but try it :3
 

Worldcomer

New Member
Jul 30, 2013
21
3
Something like this:

Code:
<?php
$bans= "SELECT COUNT(*) FROM bans WHERE username= '.$Users['username'].'";
$bancount= mysql_fetch_assoc($bans);
echo $bancount;
?>

Not sure if thats completely right :L but try it :3

How would I display this? Would it using
Code:
<?php echo $bancount; ?>
work?
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
Something like:

PHP:
<?php
$Bans = mysql_query("SELECT * FROM `bans` WHERE `username` = '" . $Users['username'] . "'");
$BanCount = mysql_num_rows($Bans);
echo $BanCount;
?>
 

Worldcomer

New Member
Jul 30, 2013
21
3
Something like:

PHP:
<?php
$Bans = mysql_query("SELECT * FROM `bans` WHERE `username` = '" . $Users['username'] . "'");
$BanCount = mysql_num_rows($Bans);
echo $BanCount;
?>

How would I show this on the actual page itself? Sorry for being a noob here, lol. Would I use the code above? (My earlier post)

----

EDIT: Completed it. Thread can now be closed. (I'm assuming you're the Habbo Moderator as you've closed past threads)
 

Damon

Member
Aug 13, 2012
364
114
How would I show this on the actual page itself? Sorry for being a noob here, lol. Would I use the code above? (My earlier post)

----

EDIT: Completed it. Thread can now be closed. (I'm assuming you're the Habbo Moderator as you've closed past threads)
Use m0nsta.'s code.. where ever you would like the next. the part "echo $BanCount;" inside of his code displays it.
 

Worldcomer

New Member
Jul 30, 2013
21
3
I did it like this.

PHP:
$Bans = mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $member['username'] . "'");
$BanCount = mysql_num_rows($Bans);
 
            echo '<table width="107%" height="50px" style="padding: 5px; margin-left: -15px; background-color: ' . (($oe == 2) ? '#fff' : '#E6E6E6') . ';">
            <tbody>
                <tr>
                    <td valign="middle" width="25">
                        <img style="margin-top: -10px;" src="http://www.habbo.nl/habbo-imaging/avatarimage?figure=' .$member['look'] . '&size=m&direction=2&head_direction=3&gesture=sml">
                    </td>
                    <td valign="top">
                        </br><p style="margin-top: -10px;" style="font-size: 100%;"><strong><a><u>' .$member['username'] . '</a></u></strong><br>Last online: <i>' . date('d M, Y', $member['last_online']) . '</i><br>Motto: "<i>' . $member['motto'] . '</i>"<br>' . (($member['online'] == "1") ? '<font color="darkgreen"><p style="margin-left: 165px; margin-top: -37px;"><strong>Online</stromg>': '<font color="darkred"><strong><p style="margin-left: 165px; margin-top: -37px;">Offline</stromg>') . '</p></font></font></strong>
                        <hr>
                        Role: <b>' . $member['role'] . '</b><br>
                        Age: ' . $member['age'] . '</br>
                        Registered on: <b>' . date('d M, Y', $member['account_created']) . '</b></br>
                       
                        Bans: <b>'; echo $BanCount;
 
Status
Not open for further replies.

Users who are viewing this thread

Top