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!


Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2005
    Posts
    1,411
    Tokens
    0

    Latest Awards:

    Default People Online Help!

    Hey, i was wondering what the php code is for this, of course it changes when people come onto the site.

    People Online: 0

    Thanks

    Matt
    I owe rep to:

    NintendoNews & Luckyrare

  2. #2
    Join Date
    Aug 2005
    Location
    Spain
    Posts
    1,367
    Tokens
    0

    Latest Awards:


  3. #3
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    :| thats a dhtml and javascript site fool..


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  4. #4
    Join Date
    Apr 2005
    Posts
    810
    Tokens
    0

    Default

    <?
    /*This snippet will display a welcome message depending on the time of day
    You can change the messages displayed below.
    Feel free to use and modify to your liking.

    Visit glomer.net for more information or e-mail:
    tate at tatenations dot com

    USAGE:
    Simply plug into your site and change the messages to whatever you want.
    */

    //Change the messages to what you want.
    $afternoon = " ";
    $evening = " ";
    $late = " ";
    $moring = " ";

    //No need to edit any further

    //Get the current hour
    $current_time = date(G);
    //Get the current day
    $current_day = date(l);

    //12 p.m. - 5 p.m.
    if ($current_time >= 12 && $current_time <= 17) {
    echo $afternoon;
    }
    // 6 p.m. to 11 p.m.
    elseif ($current_time >= 18 && $current_time <= 24) {
    echo $evening;
    }
    //12 a.m. - 5 a.m.
    elseif ($current_time >= 1 && $current_time <= 5) {
    echo $late;
    }
    // 6 a.m. to 11 a.m.
    elseif ($current_time >= 6 && $current_time <= 11) {
    echo $morning;
    }
    echo "<b>Time:</b> ";
    $date = date("m/j/y");
    $time =date('H:i:s');
    echo "$time <br> <b>Date:</b> $date<br>"
    ?>
    <?
    $remote = $_SERVER["REMOTE_ADDR"];
    $file = "usersonline.txt";
    $timeoutseconds = 60; //Tells how long the user is considered "on line"
    $timestamp = time();
    $timeout = ($timestamp-$timeoutseconds);
    $fp = fopen("$file", "a+");
    $write = $remote."||".$timestamp."\n";
    fwrite($fp, $write);
    fclose($fp);
    $online_array = array();
    $file_array = file($file);
    foreach($file_array as $newdata){
    list($ip, $time) = explode("||", $newdata);
    if($time >= $timeout){
    array_push($online_array, $ip);
    }
    }
    $online_array = array_unique($online_array);
    $online = count($online_array);
    if($online == "1"){
    echo "<b>Habbos Online:</b> $online ";
    }else{
    echo "<br><b>Habbos Online:</b> $online ";
    }
    ?>
    <?
    echo " <br><b>Hits:</b> "
    ?>
    <?
    $file = "counter.txt";
    $open = fopen($file, "r");
    $size = filesize($file);
    $count = fread($open, $size);
    $count1 = $count+1;
    echo($count1);
    fclose($open);

    $open = fopen($file, "w");
    fwrite($open, $count1);
    fclose($open);
    echo " ";
    ?>

    hits.php
    counter.txt
    usersonline.txt

  5. #5
    Join Date
    Feb 2005
    Posts
    1,411
    Tokens
    0

    Latest Awards:

    Default

    Nice code + Rep.
    I owe rep to:

    NintendoNews & Luckyrare

  6. #6
    Join Date
    Apr 2005
    Posts
    810
    Tokens
    0

    Default

    Thanks. ;P

  7. #7
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    Wow... Well Done +Rep
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  8. #8
    Join Date
    Feb 2005
    Posts
    1,411
    Tokens
    0

    Latest Awards:

    Default

    Post this in that code in the tutorial section. It rules
    I owe rep to:

    NintendoNews & Luckyrare

  9. #9
    Join Date
    Apr 2005
    Posts
    810
    Tokens
    0

    Default

    I don't have permission to post in that forum & thanks again for the rep.

    I forgot to add the IP,

    <?
    $domain = GetHostByName($REMOTE_ADDR);
    ?>

  10. #10
    Join Date
    Feb 2005
    Posts
    1,411
    Tokens
    0

    Latest Awards:

    Default

    Nice!. You should try and get permission
    I owe rep to:

    NintendoNews & Luckyrare

Page 1 of 2 12 LastLast

Posting Permissions

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