Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2007
    Location
    Italy
    Posts
    50
    Tokens
    0

    Default User System, Help Needed

    I'm working with this user system but i didnt find a way to put on the script for online users...
    Help Me Plz:
    Following there are the total/newest member script in case you can use it...
    PHP Code:
    <?php
    include('config.php');

    // Query database
    $count_sql 'SELECT * FROM members';
    $count_result mysql_query($count_sql);

    //gets the number
    $count mysql_num_rows($count_result);

    echo 
    $count// displays the total members

    $new mysql_fetch_array(mysql_query("SELECT * FROM `members` ORDER BY `id` DESC LIMIT 0, 1")); // Gets the newest member
    echo "Newest User: " $new[username]; // displays the newest member
    ?>

  2. #2
    Join Date
    Oct 2005
    Location
    London :D
    Posts
    899
    Tokens
    0

    Default

    Re-describe what you are trying to do. Dont really understand :S
    PM ME FOR QUICK HELP ON WEBDESIGNING, CODING, AND COMPUTER PROBLEMS! I WILL BE GLAD TO HELP FOR FREE!

    I AM A GOLD HC MEMBER! 16 MONTHS! I have been on Habbo since the layout with the Newsie, and 14 of my articles were posted! I'm trusted when trading HC stuff for coding!


    Noob person (this is true):

  3. #3
    ScottDiamond Guest

    Default

    I think he's looking for a Logged in Users script .

  4. #4
    Join Date
    Jan 2007
    Location
    Canada eh?
    Posts
    766
    Tokens
    75

    Default

    Um... well basically what you would have to do is have your user system write a value to a table when a user logs in and logs out... For instance:

    User Logs In: Table value `ONLINE` is set to `YES`
    User Logs Out: Table value `ONLINE` is set to `NO`

    And then what you would do is something similar to the above, except you tell it to count only the rows where `ONLINE` = `YES`

    Make sense? Heres some pseudo-code for you...

    Process Login
    PHP Code:
    <?php
    if($username == $database_username && $password == $database_password){
    #Do other login processing stuff here.... like setting the sessions and etc
    $result mysql_query("UPDATE user_table WHERE $username = database_username SET online = 'yes'");
    #What the above just did was set the online value to yes for the user who just logged in
    }
    ?>
    Count Users Online
    PHP Code:
    <?php
    $result 
    mysql_query(COUNT users WHERE online 'yes');
    $users_online $result;
    echo 
    "There are";
    echo 
    $users_online;
    echo 
    "online";
    ?>
    ?>
    Last edited by QuickScriptz; 16-04-2007 at 12:53 AM.

  5. #5
    Join Date
    Apr 2007
    Posts
    50
    Tokens
    0

    Default

    He wants to put on his homepage what the new users are. 1. check that the code is right + go wid Scriptz Idear.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •