Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: PHP Site Stats

  1. #11
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    Sorry about waiting;
    Can't be bothered doing a script to grab the online Habbo's off the real site, but all of this should work.
    Features:-
    Hits Today
    Hits Overall
    Users Online (used FastOnlineUsers, 'cause I cbf doing JavaScript)
    Your IP
    Fansite Status
    Edit the variable $domain to your domain and $status to Official if your fansite is official and Un-Official if it isn't.
    Make 2 text files in the same directory as this script, one called hits.txt and one called hits_today.txt


    PHP Code:
    <?php
    $domain 
    "www.whatever-your-domain-is.com";
    $status "Un-Official";
    ////////////////////////////////////////////////////////
    echo("<font size=\"2\" face=\"Verdana\">");
    $date date("G");
    $ip $_SERVER['REMOTE_ADDR'];
    $hits_today = ("hits_today.txt");
    $hits_today file($hits_today);
    $hits_today[0] ++;
    $fp fopen($hits_today"w");
    fputs($fp "$hits_today[0]");
    fclose($fp);
    //Above code adds 1 hit to the hits_today.txt file.

    if($date == "23"){
    $fp fopen($hits_today "w");
    fputs($fp " ");
    fclose($fp);
    }
    //Above code wipes the hits_today.txt file when the time is 23. Basically 11 o'clock at night.

    echo("Hits Today: $hits_today[0]<br>");
    //Above code tells your users the hits today

    $hits = ("hits.txt");
    $hits file($hits);
    $hits[0] ++;
    $fp fopen($hits"w");
    fputs($fp "$hits[0]");
    fclose($fp);
    //Above code adds 1 hit to hits.txt file whenever someone hits.

    echo("Hits Overall: $hits[0]<br>");
    //Above code tells the user hits overall.

    echo("Users Online: <script type=\"text/javascript\" src=\"http://fastonlineusers.com/on3.php?d=$domain\"></script><br>");
    //Above code tells the user the amount of people online.

    echo("Your IP: $ip<br>");
    //Above code tells the user their IP address.

    echo("Fansite Status: $status<br>");
    //Above code tells the user if the fansite is official.
    echo("</font>");
    ?>
    Last edited by lolwut; 09-10-2007 at 08:27 PM.
    i've been here for over 8 years and i don't know why

  2. #12
    Join Date
    Oct 2006
    Posts
    2,918
    Tokens
    946
    Habbo
    Verrou

    Latest Awards:

    Default

    Wow thanks so much! ++REP

    Also rep to anyone for the clock.

    Uh:
    Warning: fopen() expects parameter 1 to be string, array given in /hsphere/local/home/iswestim/habboeden.com/stats/stats.php on line 11 Warning: fputs(): supplied argument is not a valid stream resource in /hsphere/local/home/iswestim/habboeden.com/stats/stats.php on line 12 Warning: fclose(): supplied argument is not a valid stream resource in /hsphere/local/home/iswestim/habboeden.com/stats/stats.php on line 13 Hits Today: 1
    Warning: fopen() expects parameter 1 to be string, array given in /hsphere/local/home/iswestim/habboeden.com/stats/stats.php on line 29 Warning: fputs(): supplied argument is not a valid stream resource in /hsphere/local/home/iswestim/habboeden.com/stats/stats.php on line 30 Warning: fclose(): supplied argument is not a valid stream resource in /hsphere/local/home/iswestim/habboeden.com/stats/stats.php on line 31 Hits Overall: 1
    Users Online: 1
    Your IP: XXX.XXX.XXX.XXX
    Fansite Status: Unofficial
    Last edited by Verrou; 10-10-2007 at 03:17 AM.
    Quote Originally Posted by Special-1k View Post
    How do you uninstall an internet? I want to uninstall my Google Chrome and
    get firefox but I never really got rid of an internet my dad usually did it for me.
    If you know how post below so I can do this.

  3. #13
    Join Date
    Oct 2006
    Posts
    2,918
    Tokens
    946
    Habbo
    Verrou

    Latest Awards:

    Default

    Soz can't edit, here's a direct link: http://habboeden.com/stats/stats.php
    Quote Originally Posted by Special-1k View Post
    How do you uninstall an internet? I want to uninstall my Google Chrome and
    get firefox but I never really got rid of an internet my dad usually did it for me.
    If you know how post below so I can do this.

  4. #14
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Try changing:

    PHP Code:
    $hits = ("hits.txt");
    $hits file($hits); 
    to:
    PHP Code:
    $hits "hits.txt"

  5. #15
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    Was about to say what Invent did, goddamn your greatness Simon...

    Glad you like it Verrou.

    I'll put it on my localhost and see if Simon's fix works.

    EDIT: Verrou, would you mind if I recoded this in SQL? It's so much easier for us both.

    Last edited by lolwut; 10-10-2007 at 09:01 PM.
    i've been here for over 8 years and i don't know why

  6. #16
    Join Date
    Oct 2006
    Posts
    2,918
    Tokens
    946
    Habbo
    Verrou

    Latest Awards:

    Default

    Shure, plus you could add clock then right?

    EDIT: Simon's fix didn't work :S I'll hold tight for the SQL version
    Last edited by Verrou; 11-10-2007 at 05:22 AM.
    Quote Originally Posted by Special-1k View Post
    How do you uninstall an internet? I want to uninstall my Google Chrome and
    get firefox but I never really got rid of an internet my dad usually did it for me.
    If you know how post below so I can do this.

  7. #17
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    www.habbo-center.com/scripts/onl.php

    It has unique hits and how many guests are currently viewing page and admin CP.

    cba to add more features atm.
    Coming and going...
    Highers are getting the better of me

  8. #18
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    Quote Originally Posted by Verrou View Post
    Shure, plus you could add clock then right?

    EDIT: Simon's fix didn't work :S I'll hold tight for the SQL version
    It didn't work because of the file(); functions, which are dodgey and easy to hack... After I have dinner I'll start work, I assume you can execute SQL queries and such?
    Clock would be JavaScript because of the way it automatically updates, but I could do it.

    Quote Originally Posted by cj555
    www.habbo-center.com/scripts/onl.php

    It has unique hits and how many guests are currently viewing page and admin CP.

    cba to add more features atm.
    Is that usersystem off TechTuts, I hope not, cause you've made up copyrights when it's not you who made it.
    Last edited by lolwut; 11-10-2007 at 06:07 PM.
    i've been here for over 8 years and i don't know why

  9. #19
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by .php View Post
    It didn't work because of the file(); functions, which are dodgey and easy to hack... After I have dinner I'll start work, I assume you can execute SQL queries and such?
    Clock would be JavaScript because of the way it automatically updates, but I could do it.


    Is that usersystem off TechTuts, I hope not, cause you've made up copyrights when it's not you who made it.
    No its not.

    You can download and check code if you like.

    It has nothing in common with techtuts whatsoever
    Coming and going...
    Highers are getting the better of me

  10. #20
    Join Date
    May 2007
    Posts
    10,481
    Tokens
    3,140

    Latest Awards:

    Default

    Found a clock script:

    Code:
    <script language="JavaScript">
    <!--
    //Supplied free by js.brimonet.com
    var clockID = 0;
    function UpdateClock() {
       if(clockID) {
          clearTimeout(clockID);
          clockID  = 0;
       }
       var tDate = new Date();
       document.theClock.theTime.value = "" 
                                       + tDate.getHours() + ":" 
                                       + tDate.getMinutes() + ":" 
                                       + tDate.getSeconds();
     
       clockID = setTimeout("UpdateClock()", 1000);
    }
    function StartClock() {
       clockID = setTimeout("UpdateClock()", 500);
    }
    function KillClock() {
       if(clockID) {
          clearTimeout(clockID);
          clockID  = 0;
       }
    }
    //-->
    </script>
    <body onload="StartClock()" onunload="KillClock()">
    <center><form name="theClock">
    <input type=text name="theTime" size=8 style="border:0px;">
    <form></center>
    Found on hot scripts

    Link: Is here!

    (will look around for a hit counter etc)
    Last edited by Chippiewill; 12-10-2007 at 04:27 PM.
    Chippiewill.


Page 2 of 3 FirstFirst 123 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
  •