Log in

View Full Version : Getting stats on my site trouble ;(



Premiums
14-04-2007, 07:51 PM
Hey xD.
Well I'm opening a site called http://www.habbism.net and I'm trying to get my stats for my radio on the site.

Heres my radio_stats.php file:

<?php
/************************************************** *************************
* stats.php
* -------------------
* begin : Sunday, Aug 21, 2006
* owner : AtomicOxide.co.uk - Dave
* email : [email protected]
*
*
************************************************** *************************/
/************************************************** *************************
*
* This program is a free script; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
************************************************** *************************/
/////////////////////////////////////////////////////////////////////////////
# DO NOT EDIT BELOW THIS LIME. #
/////////////////////////////////////////////////////////////////////////////
include ("includes/config.php");
$timeout='6';
$listenlink='http://'.$radiohost.':'.$radioport.'/listen.pls';
$radio=fsockopen("$radiohost", $radioport, &$errno, &$errstr, $timeout);
if(!$radio){
$success='2';
echo $radioofflinemsg; // Radio is offline, so display message
die();
}
//Connect to the server
if($success!='2'){ //If Connection
fputs($radio,"Get /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //Get 7.HTML
while(!feof($radio)){
$page.=fgets($radio, 1000);
}
$page=ereg_replace(".*<body>", "", $page);
$page=ereg_replace("</body>.*", ",", $page);
$numbers=explode(",",$page);
$currentlisteners=$numbers[0];
$connected=$numbers[1];
//Open Connection
$fp=fsockopen("$radiohost", $radioport, &$errno, &$errstr, 3);
if(!$fp){ //If Connection
$success2='2';
echo "The Radio Server Is Currently Offline";
}
if($success2!='2'){ //If Connected
fputs($fp,"Get /admin.cgi?pass=$radiopassword&mode=viewxml HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)){
$page.= fgets($fp, 1000);
}
$security=explode(",",$page);
$security=explode("401",$security[7]);
$u='0';
while($security[$u]!=""){
if($security[1]!=''){
die("Incorrect Server Password");
}
$u++;
}
//Array
$loop=array("AVERAGETIME", "SERVERGENRE", "SERVERURL", "SERVERTITLE", "SONGTITLE", "SONGURL", "IRC", "ICQ", "AIM", "WEBHITS", "STREAMHITS", "INDEX", "LISTEN", "PALM7",
"LOGIN", "LOGINFAIL", "PLAYED", "COOKIE", "ADMIN", "UPDINFO", "KICKSRC", "KICKDST", "UNBANDST", "BANDST", "VIEWBAN", "UNRIPDST", "VIEWRIP", "VIEWXML",
"VIEWLOG", "INVALID"); //Define All The Variables To Get (Delete Any Ones You Don't Want)
$y='0';
while($loop[$y]!=''){
$pageed=ereg_replace(".*<$loop[$y]>", "", $page); //Extract Data
$phpname=strtolower($loop[$y]);
$$phpname=ereg_replace("</$loop[$y]>.*", "", $pageed); //Finish Extracting Data
if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE)
$$phpname=urldecode($$phpname);
$phpname = $phpname;
$y++;
}
}
if($connected=='1')
$wordconnected="yes";
else
$wordconnected="no";
$peaklisteners=$numbers[2];
$maxlisteners=$numbers[3];
$reportedlisteners=$numbers[4];
$song=$numbers[6];
$bitrate=$numbers[5];
$site=explode(" ", $servertitle);
$title=explode("DJ",$servertitle);
if($wordconnected=="no" && $connected=="0")
{
echo $radioofflinemsg;
}else{
echo"<font face=\"Verdana\" size=\"1\"><div align=\"center\">
<table align=\"center\">
<tr>
<td align=\"center\">
<a href=\"<A href="http://$serverurl\"><b>Current">http://$serverurl\"><b>Current DJ:</b> $servertitle</a>
</td>
</tr>
<tr>
<td align=\"center\">
<center><b>Listners:</b> $reportedlisteners/$maxlisteners<p>
<b>Current Song:</b> <br />$numbers[6]</p>
</td>
</tr>
<tr>
<td align=\"center\">
<a href=$listenlink></a>
</td>
</tr>
<tr>
<td align=\"center\"><br />
<object id=\"MediaPlayer\" type=\"application/x-oleobject\" height=\"40\" standby=\"Loading...\" width=\"170\" classid=\"CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6\">
<param NAME=\"URL\" ref value=\"http://75.126.58.79:8006/">
<param NAME=\"rate\" value=\"1\">
<param NAME=\"balance\" value=\"0\">
<param NAME=\"currentPosition\" value=\"0\">
<param NAME=\"defaultFrame\" value>
<param NAME=\"playCount\" value=\"1\">
<param NAME=\"autoStart\" value=\"0\">
<param NAME=\"currentMarker\" value=\"0\">
<param NAME=\"invokeURLs\" value=\"-1\">
<param NAME=\"baseURL\" value>
<param NAME=\"volume\" value=\"100\">
<param NAME=\"mute\" value=\"0\">
<param NAME=\"uiMode\" value=\"mini\">
<param NAME=\"stretchToFit\" value=\"1\">
<param NAME=\"windowlessVideo\" value=\"0\">
<param NAME=\"enabled\" value=\"-1\">
<param NAME=\"enableContextMenu\" value=\"-1\">
<param NAME=\"fullScreen\" value=\"0\">
<param NAME=\"SAMIStyle\" value>
<param NAME=\"SAMILang\" value>
<param NAME=\"SAMIFilename\" value>
<param NAME=\"captioningID\" value>
<param NAME=\"enableErrorDialogs\" value=\"0\">
<param NAME=\"_cx\" value=\"4763\">
<param NAME=\"_cy\" value=\"1058\">
</object>
</td></tr>
</table>
</div></font>
";
//Close Connection
fclose($radio);
}
}
/////////////////////////////////////////////////////////////////////////////
# Atomic Network Productions #
/////////////////////////////////////////////////////////////////////////////
?>


Heres my config_radio.php code:

<?php
//////////////////////////////////////////////////////////////////////////////////////////////
// Dinghy Radio Stats Information
// Grabs the xml from your radio server and displays it in a iframe that refreshes every 30 seconds.
// ©Daniel Brown www.gmtt.co.uk (http://www.gmtt.co.uk)
//////////////////////////////////////////////////////////////////////////////////////////////
//Configuration
$scdef = "Habbism Radio Is Down"; // Default station name to display when server or stream is down
$scip = "75.126.58.79"; // ip or url of shoutcast server (DO NOT ADD HTTP:// don't include the port)
$scport = "8006"; // port of shoutcast server
$scpass = "******"; // password to shoutcast server
//End configuration
?>

And heres my iFrame code which I put on my site:

<iframe style="width: 157px; height: 78px;" name="stats" src="radio_stats.php" frameborder="0* height=" width="154"></iframe>

Heres a pic of what it turns out like on my site:
http://img262.imageshack.us/img262/7262/habbismradiostatsgy0.png


If someone could help me out I'll +rep you :).

Sygon..
14-04-2007, 07:56 PM
link to the page please.

CJ-real
14-04-2007, 09:19 PM
It might be because there firstly isnt the folder:
"includes"
on your server.

Secondly there isn't
"config.php"
on your server

1). Make the folder "includes"
2). Upload "config.php" inside it :)

Post the result

Premiums
14-04-2007, 09:51 PM
Nah that didn't happen.
Do you reccomend a site where i can download stats and I'll start over again?

Voldemort
15-04-2007, 05:54 AM
Judging by the picture of your site, you can't use PHP.

Tomm
15-04-2007, 08:24 AM
Thats a load of crap ''/ You do not need to place it in the includes folder and if config.php did not exist then it would give a error.

Please only post about something you know about.


It might be because there firstly isnt the folder:
"includes"
on your server.

Secondly there isn't
"config.php"
on your server

1). Make the folder "includes"
2). Upload "config.php" inside it :)

Post the result

DJ_CJ
15-04-2007, 08:50 AM
or simply rename config_radio.php as config.php and if you have a folder called includes then leave include ("includes/config.php"); but if you havnt change it to include ("config.php");

CJ-real
15-04-2007, 09:48 AM
Thats a load of crap ''/ You do not need to place it in the includes folder and if config.php did not exist then it would give a error.

Please only post about something you know about.

Ok, know it all, why do I get this error then:

http://habbism.net/config.php (http://habbism.net/config.php) :



Not Found

The requested URL /config.php was not found on this server.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.37 Server at www.habbism.net Port 80
http://habbism.net/includes/config.php (http://habbism.net/includes/config.php)



Not Found

The requested URL /config.php was not found on this server.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/1.3.37 Server at www.habbism.net Port 80 WHERES THE FILE??? NOTE TO THREAD AUTHOR:YOU ARE TRYING TO RETRIEVE A FILE FROM /INCLUDES/ AND THE FOLDER, NOR FILE EXISTS YOU ARE THE ONE WITH THE PROBLEM. I am trying to help, and you are saying what I am saying has nothing to do with it.

Heinous
15-04-2007, 10:21 AM
Ok, know it all, why do I get this error then:

http://habbism.net/config.php (http://habbism.net/config.php) :


http://habbism.net/includes/config.php (http://habbism.net/includes/config.php)

WHERES THE FILE??? NOTE TO THREAD AUTHOR:YOU ARE TRYING TO RETRIEVE A FILE FROM /INCLUDES/ AND THE FOLDER, NOR FILE EXISTS YOU ARE THE ONE WITH THE PROBLEM. I am trying to help, and you are saying what I am saying has nothing to do with it.

You are an idiot.

If that was the case, it'd be producing an error, not outputting the php as text.

And don't assume the folders don't exist, he could have it in /root/site/includes/

Premiums
15-04-2007, 01:20 PM
LOL, I renamed the file to config.php
http://www.habbism.net/includes/config.php

Stats stay the same way o.O.

Matt.
15-04-2007, 01:24 PM
LOL, I renamed the file to config.php
http://www.habbism.net/includes/config.php

Stats stay the same way o.O.

I'm sure this will be wrong but it's worth a try.
Try putting the radio_stats.php file in the /includes folder

Edit: I see that didn't work, sorry :(. I would try re uploading them?

Premiums
15-04-2007, 01:33 PM
I tryed that and it comes up this in the iFrame:
http://img142.imageshack.us/img142/7743/weirdhy2.png

Page cannot be displayed =S.

CJ-real
15-04-2007, 01:38 PM
radio stats in the main folder, not in /includes/

then post the result

also
You are an idiot.

If that was the case, it'd be producing an error, not outputting the php as text.

And don't assume the folders don't exist, he could have it in /root/site/includes/

if he did he wouldnt want help/raido_stats.php wouldnt work

Premiums
15-04-2007, 01:46 PM
Ok did that, result:
http://img262.imageshack.us/img262/7262/habbismradiostatsgy0.png
Back to that again ;(

CJ-real
15-04-2007, 05:20 PM
Ok ill get you a new script, 1 minute

Premiums
15-04-2007, 05:22 PM
ok :).
Thnx

CJ-real
15-04-2007, 05:25 PM
Post your server information but not the password please :)

Premiums
15-04-2007, 05:30 PM
Here;
IP; http://75.126.58.79
Port; 8006

Is that what you meen? :S

CJ-real
15-04-2007, 05:33 PM
Yes it is, and is there a certain image you want when the radio is online/offline?

Premiums
15-04-2007, 05:36 PM
Not at the moment, I'll do that part when I make the images lol.

CJ-real
15-04-2007, 05:38 PM
Ok, i put this one in for the moment:

http://images.habbohotel.com/c_images/album1048/bobbamusiclogo.gif

Premiums
15-04-2007, 05:40 PM
Orite :)

CJ-real
15-04-2007, 05:49 PM
Ok done, you will need to unzip and change the password in radio_config.php. I have dont verdana, size 10 like said erlier.

Download:
Here (http://cjnet.info/a/habbism/Habbism.zip)

Login:
Habbism

Password:
If you need this again, ask me in a PM :)

NOTE: The demo will not work as there is no password!, In fact, no demo - there's no point!

Premiums
15-04-2007, 05:55 PM
Ok downloaded, do I put the config_radio.php in a includes folder?

CJ-real
15-04-2007, 05:59 PM
nope, forget includes :)

Premiums
15-04-2007, 06:06 PM
I'll post the result when I get my shoutcast back up.
+rep to CJ-real :)

CJ-real
15-04-2007, 06:13 PM
thanks, good luck.

make sure the radio server is running and "go" from the shoutcast admin

Premiums
15-04-2007, 07:53 PM
They don't work, it comes up the following;

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home2/habbism/public_html/radio_stats.php on line 4

Warning: fsockopen() [function.fsockopen]: unable to connect to http://75.126.58.79:8006 in /home2/habbism/public_html/radio_stats.php on line 4
Habbish is Offline

So I dont think my host has function.fsockopen.
Would someone kindly host them for us :D?

CJ-real
15-04-2007, 08:00 PM
You changed the PW?

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