PDA

View Full Version : PHP Site Stats



Verrou
09-10-2007, 07:30 AM
Does anyone have a script that does this:

http://habbostatic.com/stats/stats4.php

Or something like it with the clock and hits etc.
Thanks,
Verrou

ScottDiamond.
09-10-2007, 03:52 PM
Does anyone have a script that does this:

http://habbostatic.com/stats/stats4.php

Or something like it with the clock and hits etc.
Thanks,
Verrou

You can use Javascript or PHP. I'd personally use PHP.

Nli.
09-10-2007, 04:04 PM
I think he means, has any one got the script where he can put it on his webpage like they have done ^.~

RichardKnox
09-10-2007, 04:10 PM
Need to use JS for the clock.

Matt.
09-10-2007, 04:15 PM
http://thybag.co.uk/#p=Tutorials&ind=25

That has some very usefully php codes that may help you :).

ScottDiamond.
09-10-2007, 04:21 PM
Need to use JS for the clock.

Yes.


I think he means, has any one got the script where he can put it on his webpage like they have done ^.~

"^.~" makes you look like an idiot.

Nli.
09-10-2007, 06:47 PM
Yes.



"^.~" makes you look like an idiot.
and can i ask.. how?

ScottDiamond.
09-10-2007, 07:02 PM
and can i ask.. how?

Because it is so pathetic and lame.

Eccentric
09-10-2007, 07:05 PM
http://www.techtuts.com/forums/index.php?showtopic=29 for all the 'hits'

lolwut
09-10-2007, 07:49 PM
I'll code it now.
Give me about 15mins.

lolwut
09-10-2007, 08:24 PM
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
$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>");
?>

Verrou
10-10-2007, 03:13 AM
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

Verrou
10-10-2007, 03:46 AM
Soz can't edit, here's a direct link: http://habboeden.com/stats/stats.php

Invent
10-10-2007, 02:29 PM
Try changing:



$hits = ("hits.txt");
$hits = file($hits);


to:


$hits = "hits.txt";

lolwut
10-10-2007, 08:49 PM
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.

Verrou
11-10-2007, 05:18 AM
Shure, plus you could add clock then right?

EDIT: Simon's fix didn't work :S I'll hold tight for the SQL version :D

MrCraig
11-10-2007, 03:46 PM
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.

lolwut
11-10-2007, 06:00 PM
Shure, plus you could add clock then right?

EDIT: Simon's fix didn't work :S I'll hold tight for the SQL version :DIt 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.



www.habbo-center.com/scripts/onl.php (http://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.

MrCraig
12-10-2007, 04:07 PM
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

Chippiewill
12-10-2007, 04:25 PM
Found a clock script:



<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! (http://js.brimonet.com/bnc.php#bnc1)

(will look around for a hit counter etc)

lolwut
12-10-2007, 11:26 PM
Sorry about forgetting, it slipped my mind. I'll start work tommorow on it, due to mysewlf being currntly shattered.

Verrou
13-10-2007, 01:36 AM
Shattered as in:
:eusa_wall or :(

lolwut
13-10-2007, 07:45 AM
No, like Tired but there's no emote for it.

Verrou
13-10-2007, 07:55 AM
kk lol

EDIT: Is there still a working "Habbo's in hotel" script i need one quickly for AU please.

lolwut
14-10-2007, 11:03 AM
Yeah there's one in this.
BTW: Gotta fix a db connection error then I'll pm you the .zip (:

Verrou
14-10-2007, 11:44 AM
Merci Boucoup :) Do u play au? Cuz i cud drop u a few hcs :D

lolwut
14-10-2007, 12:56 PM
Yeah, occasionally.
I prefer UK if you have anything there?

Verrou
15-10-2007, 05:24 AM
I think i have a few hcs on uk, um and i have a minor problem:
http://andrehamon.evenhosting.com/stats/

DeejayMachoo$
20-10-2007, 11:53 AM
http://fastonlineusers.com/on4.php?d=http://www.habbostatic.com/

Want to hide these adverts? Register an account for free!