RevCMS Script

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

    RevCMS Script

    I'm trying to created a script to get the newest users


    PHP Code:
    <?php 
                                    $getUserInfo 
    mysql_query("SELECT * FROM users WHERE account_created ORDER BY id LIMIT 1");
                                    while (
    $userInfomysql_fetch_assoc($getUserInfo))
                                         {
                                    echo 
    '
    But it still show me as Staff member even though I had 3 users registered today (test accounts)

    Edit 2:

    Trying to get this to get WHERE online = 1 aswell
    PHP Code:
    <?php  
    $getStaff 
    mysql_query("SELECT * FROM users WHERE rank <=5");  
    $staffs mysql_num_rows($getStaff);  
    ?>
    Last edited by Glee; 14-04-15 at 02:33 AM.


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

    Re: RevCMS Script

    Hey @Glee, the reason why you're only getting your username because in your syntax you're SELECTING * all rows in account_created with the ORDER limited being by 1, your username is at the top so it's returning your username. Here is a little script I just created, hope it helps

    Code:
    <?php
    $getUserInfo = mysql_query("SELECT * from users ORDER by id DESC");
    $showUserInfo = mysql_fetch_assoc($getUserInfo);
    ?>
    <!-- Style whatever you like here, habblet container or whatever -->
    <?php echo filter($showUserInfo['username']); ?>
    - - - Updated - - -

    For the second one, I don't quite understand what you mean.

  3. #3
    Gamma Spamma Liam is online now
    MemberRank
    Dec 2011 Join Date
    Down UnderLocation
    2,945Posts

    Re: RevCMS Script

    Do you mean:
    Code:
    <?php  
    $getStaff = mysql_query("SELECT * FROM 'users' WHERE rank <=5 AND 'online' = 1");  
    $staffs = mysql_num_rows($getStaff);  
    ?>
    If not, please elaborate.

  4. #4
    Enthusiast Kemyst is offline
    MemberRank
    Feb 2015 Join Date
    26Posts

    Re: RevCMS Script

    @Glee If you're trying to get only staff members then the code would be something like this.

    PHP Code:


    <?php$getTopStats mysql_query("SELECT look,username from users WHERE rank > 5 ORDER BY id DESC LIMIT 1");while($topSpats mysql_fetch_array($getTopStats)){echo '<tr><td width="50px"> </td>            <td width="20px">';  echo '<img src="http://www.habbo.fr/habbo-imaging/avatarimage?figure=' $topSpats['look'] . '&size=lrg&direction=3&head_direction=3&gesture=sml&size=m" align="center"></td> <td width=195px" align="center"><a href="#"><b>'.$topSpats['username'].'</b></a>';echo '</td>           ';
    }
    ?>
    While if you're trying to get hold of latest users registered script would be like


    PHP Code:
    <?php$getTopStats mysql_query("SELECT look,username from users ORDER BY id DESC LIMIT 1");while($topSpats mysql_fetch_array($getTopStats)){echo '<tr><td width="50px"> </td>            <td width="20px">';  echo '<img src="http://www.habbo.fr/habbo-imaging/avatarimage?figure=' $topSpats['look'] . '&size=lrg&direction=3&head_direction=3&gesture=sml&size=m" align="center"></td> <td width=195px" align="center"><a href="#"><b>'.$topSpats['username'].'</b></a>';echo '</td>           ';
    }

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

    Re: RevCMS Script

    Quote Originally Posted by Kemyst View Post
    @Glee If you're trying to get only staff members then the code would be something like this.

    PHP Code:


    <?php$getTopStats mysql_query("SELECT look,username from users WHERE rank > 5 ORDER BY id DESC LIMIT 1");while($topSpats mysql_fetch_array($getTopStats)){echo '<tr><td width="50px"> </td>            <td width="20px">';  echo '<img src="http://www.habbo.fr/habbo-imaging/avatarimage?figure=' $topSpats['look'] . '&size=lrg&direction=3&head_direction=3&gesture=sml&size=m" align="center"></td> <td width=195px" align="center"><a href="#"><b>'.$topSpats['username'].'</b></a>';echo '</td>           ';
    }
    ?>
    While if you're trying to get hold of latest users registered script would be like


    PHP Code:
    <?php$getTopStats mysql_query("SELECT look,username from users ORDER BY id DESC LIMIT 1");while($topSpats mysql_fetch_array($getTopStats)){echo '<tr><td width="50px"> </td>            <td width="20px">';  echo '<img src="http://www.habbo.fr/habbo-imaging/avatarimage?figure=' $topSpats['look'] . '&size=lrg&direction=3&head_direction=3&gesture=sml&size=m" align="center"></td> <td width=195px" align="center"><a href="#"><b>'.$topSpats['username'].'</b></a>';echo '</td>           ';
    }
    Already been fixed Thank You Though



Advertisement