Staff Stats

Page 1 of 2 12 LastLast
Results 1 to 25 of 28
  1. #1
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Staff Stats

    How can I code something like this,

    I was editing my staff page little taking the Idea from it



    I know I have to echo it out, but I don't know if I grab it from the users_stats or the users_info,

    this is my base of the code

    PHP Code:
    <?php 
                                    $getUserInfo 
    mysql_query("SELECT bans, cfhs FROM `users_stats` WHERE bans");
                                    while (
    $userInfomysql_fetch_assoc($getUserInfo))
                                         {
                                    echo 
    '

                                    }
                                    ?>
    but I'm not 100% if it's correct base because I don't think I could create more then 1 MySQL code for each table


  2. #2
    Member Janzeer is offline
    MemberRank
    Mar 2012 Join Date
    96Posts

    Re: Staff Stats

    You can just add multiple queries for that which would make life much easier, ("SELECT bans FROM `bans`") & ("SELECT cfhs FROM `moderation_tickets`")

  3. #3
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    Here is how i'd do it

    Code:
    if (mysql_num_rows($userInfo) > 0)
    {
    $x = 1;
    while ($staff = mysql_fetch_assoc($userInfo))
    {
    $bans = mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $staff['username'] . "'"));
    $cfh = mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" . $staff['id'] . "'")); 
    if ($x == 2)
    $x = 1;
    else
    $x = 2;

    and then here comes your echo,


    Code:
    echo '{userrname} has banned <strong>' . filter($bans) . '</strong> users and handled <strong>' .filter($cfh) .'</strong> call for help tickets.';
    Last edited by asesinato; 06-02-15 at 05:22 AM.

  4. #4
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    Here is how i'd do it

    Code:
    if (mysql_num_rows($userInfo) > 0)
    {
    $x = 1;
    while ($staff = mysql_fetch_assoc($userInfo))
    {
    $bans = mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $staff['username'] . "'"));
    $cfh = mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" . $staff['id'] . "'")); 
    if ($x == 2)
    $x = 1;
    else
    $x = 2;

    and then here comes your echo,


    Code:
    echo '{userrname} has banned <strong>' . filter($bans) . '</strong> users and handled <strong>' .filter($cfh) .'</strong> call for help tickets.';
    Highly suggest you to use a JOIN structure.

  5. #5
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    so which one should I use?

    Edit:----


    PHP Code:
    <?php 
    if (mysql_num_rows($userInfo) > 0)
    {
    $x 1;
    while (
    $staff mysql_fetch_assoc($userInfo))
    {
    $bans mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" $staff['username'] . "'"));
    $cfh mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" $staff['id'] . "'")); 
    if (
    $x == 2)
    $x 1;
    else
    $x 2;
    {
    echo 
    '{userrname} has banned <strong>' filter($bans) . '</strong> users and handled <strong>' .filter($cfh) .'</strong> call for help tickets.';
    }
    }
    }

                                    
    ?>
    Doesn't work, its not even showing the words; It's just showing blank space haha get it Taylor Swift :P

    EDIT 2:

    I got little bits and pieces to work now I need to get it to hand each users ticket and handle

    PHP Code:
    <?php 
                                    $getUserInfo 
    mysql_query("SELECT * FROM `users` WHERE rank >=4 LIMIT 5");
                                    while (
    $userInfomysql_fetch_assoc($getUserInfo))
                                         {
                                    echo 
    '

    <div style="padding:5px;">
    <strong><a href="https://playboon.co/home/">' 
    .$userInfo['username'] . '</a></strong> has banned <strong></strong> users and handled <strong>1</strong> call for help tickets.
    <br/>
    <hr>'
    ;
                                    }
    Images:

    Last edited by Glee; 07-02-15 at 01:50 AM. Reason: Added More Details

  6. #6
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Bump this back to the top please it's been more then 24 h

  7. #7
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: Staff Stats

    Post the full code block of what you have at the moment and how it looks like.

  8. #8
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Quote Originally Posted by The General View Post
    Post the full code block of what you have at the moment and how it looks like.
    PHP Code:
                                
                             </div>   
                            </div>
                            <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                            
                            <div class="habblet-container ">
                                <div class="cbb clearfix settings ">
                                    <h2 class="title"><span style="float: left;">Staff Statistics</h2></span>
                                    <div style="padding:5px;">
    <?php
    $getUserInfo 
    mysql_query("SELECT * FROM `users` WHERE rank >=4 LIMIT 5");
    if (
    mysql_num_rows($userInfo) > 0)
    {
    $x 1;
    while (
    $staff mysql_fetch_assoc($userInfo))
    {
    $bans mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" $staff['username'] . "'"));$cfh mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" $staff['id'] . "'"));
    if (
    $x == 2)$x 1;
    else
    $x 2;
    {
    echo 
    '{userrname} has banned <strong>' filter($bans) . '</strong> users and handled <strong>' .filter($cfh) .'</strong> call for help tickets.';
    }
    }
    }
    ?>
                                </div>
                            </div>
                            <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
    </div>
    </div>
    </div>

  9. #9
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    Sorry for the late reply, I've been rather busy. Here you go, use this.

    Spoiler:

    Code:
                <?php
                $staff = mysql_query("SELECT `id`,`username` FROM users WHERE rank >=4 LIMIT 5") or die(mysql_error());
                if (mysql_num_rows($staff) > 0)
                {
                    $x = 1;
                    while ($member = mysql_fetch_assoc($staff))
                    {
                        $bans = mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $member['username'] . "'"));
                        $cfh = mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" . $member['id'] . "'")); 
    
    
                        if ($x == 2)
                            $x = 1;
                        else
                            $x = 2;
                            
                        echo '
                        <a href="{url}/home/'.filter($member['username']).'">' . filter($member['username']) . '</a> has banned <b>' . filter($bans) . '</b> users and handled <b>' . filter($cfh) . '</b> call for help tickets.
                        <hr>
                         ';
                    }
                }
                ?>

  10. #10
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    Sorry for the late reply, I've been rather busy. Here you go, use this.

    Spoiler:

    Code:
                <?php
                $staff = mysql_query("SELECT `id`,`username` FROM users WHERE rank >=4 LIMIT 5") or die(mysql_error());
                if (mysql_num_rows($staff) > 0)
                {
                    $x = 1;
                    while ($member = mysql_fetch_assoc($staff))
                    {
                        $bans = mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $member['username'] . "'"));
                        $cfh = mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" . $member['id'] . "'")); 
    
    
                        if ($x == 2)
                            $x = 1;
                        else
                            $x = 2;
                            
                        echo '
                        <a href="{url}/home/'.filter($member['username']).'">' . filter($member['username']) . '</a> has banned <b>' . filter($bans) . '</b> users and handled <b>' . filter($cfh) . '</b> call for help tickets.
                        <hr>
                         ';
                    }
                }
                ?>
    Thank You it works :)

  11. #11
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    No problem, anything else you need help with?

  12. #12
    Account Upgraded | Title Enabled! UartigZone is offline
    MemberRank
    Dec 2013 Join Date
    LoserlandLocation
    441Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    No problem, anything else you need help with?
    Last online for staff page, how does that works and things like that?

  13. #13
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Quote Originally Posted by UartigZone View Post
    Last online for staff page, how does that works and things like that?
    that would be something like this I'm guessing...

    PHP Code:
     <?php
    $getStaff 
    mysql_query("SELECT `look`,`username`,`last_online` FROM `users` WHERE `rank` >= '4' ORDER BY `last_online` DESC LIMIT 5");
    while(
    $staffStats mysql_fetch_array($getStaff)) {
    echo 
    '
    <tr>
    <td width="25%"><img src="{image}/habbo-imaging/avatarimage.php?figure=' 
    $staffStats['look'] . '&size=m&direction32&head_direction=3&gesture=sml" align="left"></td> 
    <td width="75%"><a href="{url}/home/'
    .$staffStats['username'].'"><b>'.$staffStats['username'].'</b></a><br />'.$staffStats['last_online'].' was last online</td>
    </tr>
    </table>
    <hr>'
    ;
    }
    ?>
    Haven't tested but that is an example here is what it would look like though



    (You have to code it to turn into hours or days)
    @asesinato @UartigZone

  14. #14
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    How would you want last online built into that code above? Where would it show their last online date?

    Edit: here you go.
    Spoiler:

    Code:
                <?php
                $staff = mysql_query("SELECT `id`,`username`, `last_online` FROM users WHERE rank >=4 LIMIT 5") or die(mysql_error());
                if (mysql_num_rows($staff) > 0)
                {
                    $x = 1;
                    while ($member = mysql_fetch_assoc($staff))
                    {
                        $bans = mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $member['username'] . "'"));
                        $cfh = mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" . $member['id'] . "'")); 
    
    
    
    
                        if ($x == 2)
                            $x = 1;
                        else
                            $x = 2;
                            
                        echo '
                        <a href="{url}/home/'.filter($member['username']).'">' . filter($member['username']) . '</a> has banned <b>' . filter($bans) . '</b> users and handled <b>' . filter($cfh) . '</b> call for help tickets.
                        <br>
                        The last time this staff member was seen was on was ' . date('d/m/Y' ,$member['last_online']) . '
                        <hr>
                         ';
                    }
                }
                ?>

  15. #15
    Account Upgraded | Title Enabled! UartigZone is offline
    MemberRank
    Dec 2013 Join Date
    LoserlandLocation
    441Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    How would you want last online built into that code above? Where would it show their last online date?

    Edit: here you go.
    Spoiler:

    Code:
                <?php
                $staff = mysql_query("SELECT `id`,`username`, `last_online` FROM users WHERE rank >=4 LIMIT 5") or die(mysql_error());
                if (mysql_num_rows($staff) > 0)
                {
                    $x = 1;
                    while ($member = mysql_fetch_assoc($staff))
                    {
                        $bans = mysql_num_rows(mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $member['username'] . "'"));
                        $cfh = mysql_num_rows(mysql_query("SELECT * FROM moderation_tickets WHERE moderator_id = '" . $member['id'] . "'")); 
    
    
    
    
                        if ($x == 2)
                            $x = 1;
                        else
                            $x = 2;
                            
                        echo '
                        <a href="{url}/home/'.filter($member['username']).'">' . filter($member['username']) . '</a> has banned <b>' . filter($bans) . '</b> users and handled <b>' . filter($cfh) . '</b> call for help tickets.
                        <br>
                        The last time this staff member was seen was on was ' . date('d/m/Y' ,$member['last_online']) . '
                        <hr>
                         ';
                    }
                }
                ?>

    Thanks you two! it was a test to see how it was working.

    I don't know what i should get into my staff page. I got Bans and age and online and offline ( Only for event staffs ) any ideas or know what usefull?

  16. #16
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    Quote Originally Posted by UartigZone View Post
    Thanks you two! it was a test to see how it was working.

    I don't know what i should get into my staff page. I got Bans and age and online and offline ( Only for event staffs ) any ideas or know what usefull?
    Bans, Tickets, Position, Last Online, Offline/Offline - those are the general things which people use. Country, Age, Motto - however it does give a bit of information about your staff away, which users don't really need to know.

  17. #17
    Account Upgraded | Title Enabled! UartigZone is offline
    MemberRank
    Dec 2013 Join Date
    LoserlandLocation
    441Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    Bans, Tickets, Position, Last Online, Offline/Offline - those are the general things which people use. Country, Age, Motto - however it does give a bit of information about your staff away, which users don't really need to know.
    I got bans, position and offline/online for some of my ranks. I don't know 100% how i should get tickets in the code and what to do...

  18. #18
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    Post your code that you have at the moment

  19. #19
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Actually how would I be able to get Most Online time into mins into hours into days?

  20. #20
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    Quote Originally Posted by Glee View Post
    Actually how would I be able to get Most Online time into mins into hours into days?
    Use 'H:i:s'

  21. #21
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    Use 'H:i:s'
    How would I apply that into this code:

    PHP Code:
    <?php
    $getCredits 
    mysql_query("SELECT `look`,`username`,`respect` FROM `users` WHERE `rank` <= '10' ORDER BY `respect` DESC LIMIT 5");
    while(
    $creditsStats mysql_fetch_array($getCredits)) {
    echo 
    '
    <tr>
    <td width="25%"><img src="{image}/habbo-imaging/avatarimage.php?figure=' 
    $creditsStats['look'] . '&size=m&direction32&head_direction=3&gesture=sml" align="left"></td> 
    <td width="75%"><a href="{url}/home/'
    .$creditsStats['username'].'"><b>'.$creditsStats['username'].'</b></a><br />'.$creditsStats['respect'].' Respects</td>
    </tr>
    </table>
    <hr>'
    ;
    }
    ?>

  22. #22
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    Not sure how you wanted it laid out, but just edit it to your liking of course.
    Spoiler:
    <?php
    $getCredits = mysql_query("SELECT `look`,`username`,`respect`, `last_online` FROM `users` WHERE `rank` <= '10' ORDER BY `respect` DESC LIMIT 5");
    while($creditsStats = mysql_fetch_array($getCredits)) {
    echo '
    <tr>
    <td width="25%"><img src="{image}/habbo-imaging/avatarimage.php?figure=' . $creditsStats['look'] . '&size=m&direction32&head_direction=3&gesture=sml" align="left"></td>
    <td width="75%"><a href="{url}/home/'.$creditsStats['username'].'"><b>'.$creditsStats['username'].'</b></a><br />'.$creditsStats['respect'].' Respects</td>
    </tr>
    <br>
    '. $creditsStats['username'] .' was seen last online on '. date('d-m-Y' ,$creditsStats['last_online']) .' at '. date('H:i:s' ,$creditsStats['last_online']) .'
    </table>
    <hr>';
    }
    ?>


  23. #23
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    Not sure how you wanted it laid out, but just edit it to your liking of course.
    Spoiler:
    <?php
    $getCredits = mysql_query("SELECT `look`,`username`,`respect`, `last_online` FROM `users` WHERE `rank` <= '10' ORDER BY `respect` DESC LIMIT 5");
    while($creditsStats = mysql_fetch_array($getCredits)) {
    echo '
    <tr>
    <td width="25%"><img src="{image}/habbo-imaging/avatarimage.php?figure=' . $creditsStats['look'] . '&size=m&direction32&head_direction=3&gesture=sml" align="left"></td>
    <td width="75%"><a href="{url}/home/'.$creditsStats['username'].'"><b>'.$creditsStats['username'].'</b></a><br />'.$creditsStats['respect'].' Respects</td>
    </tr>
    <br>
    '. $creditsStats['username'] .' was seen last online on '. date('d-m-Y' ,$creditsStats['last_online']) .' at '. date('H:i:s' ,$creditsStats['last_online']) .'
    </table>
    <hr>';
    }
    ?>

    Not working I re-edit the code
    PHP Code:
    <?php
    $getCredits 
    mysql_query("SELECT `look`,`username`,`last_online` FROM `users` WHERE `rank` >= '3' ORDER BY `last_online` DESC LIMIT 5");
    while(
    $creditsStats mysql_fetch_array($getCredits)) {
    echo 
    '
    <tr>
    <td width="25%"><img src="{image}/habbo-imaging/avatarimage.php?figure=' 
    $creditsStats['look'] . '&size=m&direction32&head_direction=2&gesture=sml&headonly=1" align="left"></td> 
    <td width="75%"><a href="{url}/home/'
    .$creditsStats['username'].'"><b>'.$creditsStats['username'].'</b></a><br />' .date('H:i:s') .$creditsStats['last_online'].' Days Online</td>
    </tr>
    </table>
    <hr>'
    ;
    }
    ?>
    This is what I'm getting


  24. #24
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: Staff Stats

    Quote Originally Posted by Glee View Post
    Not working I re-edit the code
    Look carefully how I've coded it
    Quote Originally Posted by asesinato View Post
    '. date('H:i:s' ,$creditsStats['last_online']) .'

    You've done it like


    Code:
    ' .date('H:i:s') .$creditsStats['last_online'].'

    When it should be like
    Code:
    '. date('H:i:s' ,$creditsStats['last_online']) .'

  25. #25
    Alpha Member Glee is offline
    MemberRank
    Jun 2009 Join Date
    Niagara Falls,Location
    2,225Posts

    Re: Staff Stats

    Quote Originally Posted by asesinato View Post
    Look carefully how I've coded it



    You've done it like


    Code:
    ' .date('H:i:s') .$creditsStats['last_online'].'

    When it should be like
    Code:
    '. date('H:i:s' ,$creditsStats['last_online']) .'
    Okay, first of all I just realized something the last_online isn't the online time is it?
    doesn't the last_online tells you when you were last online?
    I'm looking for the online time that shows you how long you've play on the hotel



Page 1 of 2 12 LastLast

Advertisement