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 8 of 8
  1. #1
    Join Date
    Oct 2006
    Location
    London
    Posts
    342
    Tokens
    0

    Default Users online / total hits

    Can anyone get me/ link me to a tut where i can get a javascript to display the number of users currently online and a javascript to show the total hits?

    ty + rep

    also i want a script that will be keped on my site not an scr to another site

    ty!

  2. #2
    Join Date
    Nov 2006
    Location
    Chillwell, UK
    Posts
    343
    Tokens
    0

  3. #3
    Join Date
    Aug 2004
    Location
    bristol
    Posts
    3,799
    Tokens
    0

    Latest Awards:

    Default

    JavaScript alone cannot do this, your host will need to support some type of server-side scripting. If you have support for a language such as PHP, I'll write you a script.
    kinda quit.

  4. #4
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Exclamation

    Quote Originally Posted by joshua View Post
    JavaScript alone cannot do this, your host will need to support some type of server-side scripting. If you have support for a language such as PHP, I'll write you a script.
    I do please write it

  5. #5
    Join Date
    Aug 2006
    Location
    Wakefield, West Yorkshire
    Posts
    1,351
    Tokens
    0

    Latest Awards:


  6. #6
    Join Date
    Nov 2006
    Location
    Chillwell, UK
    Posts
    343
    Tokens
    0

    Default

    Nooo use my idea ZYMIC ok! guys im moving back onto Panther NOW

  7. #7
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    if u want a flat file one, heres a V old one i wrote
    PHP Code:
     <?php

    ##################################################################
    #            Thybag Users Online Now and to day script           #
    ##################################################################
    #            � Copyright  Thybag.co.uk 2004 - 2005               #
    ##################################################################
    # This Script is FREE to use as long as this header remains      #
    # In tact. And realy since no one is ever going to see it is     #
    # there any point in removing it?                               #
    ##################################################################

    // Configuration
    $timeoutseconds 6000// length of time user is considered online in seconds
    $daylength 86400// lengh of day in seconds
    $filename "online.txt" // the file in wich to store information, chmod it to 777


    //-----------------------------------------------------------------------------------------
    # Unless you know what your doing its not advisable to edit beond this point
    //-----------------------------------------------------------------------------------------

    // Main Variables
    $timestamp=time();
    $timeout=$timestamp-$timeoutseconds;
    $aday $timestamp-$daylength;
    $ip getenv("REMOTE_ADDR");

    // Run The Array Loops
    $hits file($filename);
    foreach(
    $hits as $Key => $Val)
    {
    $hittedinfo[$Key] = explode("|"$Val); //explode that data into a new array:
    }
    //Loop all me info
    for($K 0$K sizeof($hits); $K++) {

    //Put any ips that arnt over a day old in to a string so they remain in the database
    if($hittedinfo[$K][0] > $aday )
    {
            
    $hitstring .= $hittedinfo[$K][0]."|".$hittedinfo[$K][1]."";
    }

    $usedip[$K] = trim($hittedinfo[$K][1]); //Make an array of Ips in database

    //Make array of all online users
    if($hittedinfo[$K][0] > $timeout)
    {
    $onlinenow[$K] = "1";
    }


    // end the loop
    }


    $toenter ="";

    // Dont dubble up
    $usedip array_unique($usedip)   ;

    //if the ip has already been counted dont add it to the database
    if(in_array(trim($ip), $usedip))
    {
    $toenter $timestamp."|".$ip."\n" ;} //if it aint, write er in
    else    // its there, is it to old or shall we still use
    {$K2 array_search($ip$usedip);
    if(
    $hittedinfo[$K2][0] < $timeout)
    {
    $toenter $timestamp."|".$ip."\n" ;}


            }

    //Write all the data we want to keep back to the file
    $fp fopen($filename "w+");
    fputs($fp $hitstring."".$toenter);
    fclose($fp);

    //Now where done, set the output varibles with the numbers the need
    $hitztoday sizeof($usedip);
    $usersonline sizeof($onlinenow);

    /*-----------------------------------------------------------------------------------------
    $hitztoday - now contains the amount of unque hits for today
    $usersonline - now contains the amount of users online

    Include this file in to where ever you wish the stats varibales to be useable, make sure
    you only include once per page to prevent errors.

    Create and chmod to 777 a txt file called online or whatever you renamed the $filename vaible
    to use, put in same directory as page this is being included into, unless you ad folder info
    to the url.

    To make this information appear on the page simply use the echo function
    EG:
    echo "Users Online: ";
    echo $usersonline;


    If you require any more assitance with the script feel free to ask at
    <a href='http://thybag.co.uk/forum/' target='_blank'>http://thybag.co.uk/forum/</a> or email me at [email protected]
    -----------------------------------------------------------------------------------------*/


    // Beta - auto output vairibles
    //echo "Today:".$hitztoday."<br>Online:".$usersonline;
    ?>
    Last edited by Mentor; 07-12-2006 at 08:52 PM.

  8. #8
    Join Date
    Oct 2006
    Location
    London
    Posts
    342
    Tokens
    0

    Default

    JavaScript alone cannot do this, your host will need to support some type of server-side scripting. If you have support for a language such as PHP, I'll write you a script.
    im talking about a serverside include jscript btw

Posting Permissions

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