Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fsockopen errors - Shoutcast Now Playing script
#21
[Solved]
(04-29-2014, 08:41 AM)un4saken Wrote: Fixed yessir
Awesome @un4saken Cool

I'm dying of curiosity. What did you do?
[-] The following 1 user Likes Genesis's post:
  • NoelF1
#22
[Solved]
(04-29-2014, 08:41 AM)un4saken Wrote: Fixed yessir
You are king ! ClappingClappingClappingYahooYahooYahoo
Good

Thank you !!! Biggrin

All's working @ http://noelborg.com/testing/stats/radio_stats.php Biggrin
#23
[Solved]
(04-27-2014, 10:30 AM)igdesigner Wrote:
(04-27-2014, 09:49 AM)NoelF1 Wrote:
(04-27-2014, 07:58 AM)igdesigner Wrote: You need to enable "fsockopen" in your php settings. I have website on gigarank that uses "fsockopen" and I have no problem with that, because it works perfect for me.

Where do I find php.ini, can't find it anywhere in my cPanel/FileManager.

thanks mate.

In your php.ini file you need to write this:

PHP Code:
allow_url_fopen On 

Also make sure that it is working create .htaccess file and pase this:

PHP Code:
Options +FollowSymLinks
RewriteEngine On 

Hope it helps.

i think this seting not for enabling fscokopen, but for enabling file_get_contents and fopen('externalURL');
ytdl.xyz youtube downloader
#24
[Solved]
(04-29-2014, 08:41 AM)un4saken Wrote: Fixed yessir

Hi un4saken,
I'm having this problem again on another domain hosted on my account.

url is:
http://christmasradiomalta.com/stats/radio_stats.php

I need some quick help please.

and here's the full code again:

Code:
<?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// ©2004-2005 Daniel Brown http://www.gmtt.co.uk
// Please refer to the readme file for use.


// Add-On MAXLISTNERS insead of the / 10 MAXLISTENERS which was set, and the BITRATE add-on.
// Online and Offline graphics, and add-on code.
// Better HTML Script.

// Do Not Try To Edit This Only Unless You Know What You're Doing!!!!!!!

ini_set('display_errors','OFF');
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set('max_execution_time', 60); //300 seconds = 5 minutes

include('config_radio.php');

$scfp = fsockopen("$scip", $scport, $errno, $errstr, 30);
if(!$scfp) {
  $scsuccs=1;
echo''.$scdef.' is Offline';
}
if($scsuccs!=1){
fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
while(!feof($scfp)) {
  $page .= fgets($scfp, 1000);
}
######################################################################################################################
/////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//define  xml elements
$loop = array("STREAMSTATUS", "BITRATE", "SERVERTITLE", "CURRENTLISTENERS", "MAXLISTENERS", "BITRATE");
$y=0;
while($loop[$y]!=''){
  $pageed = ereg_replace(".*<$loop[$y]>", "", $page);
  $scphp = strtolower($loop[$y]);
  $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);
  if($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE)
   $$scphp = urldecode($$scphp);

// uncomment the next line to see all variables
//echo'$'.$scphp.' = '.$$scphp.'<br>';
  $y++;
}
//end intro xml elements
######################################################################################################################
######################################################################################################################
/////////////////////////part 2\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//get song info and history
$pageed = ereg_replace(".*<SONGHISTORY>", "", $page);
$pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);
$songatime = explode("<SONG>", $pageed);
$r=1;
while($songatime[$r]!=""){
  $t=$r-1;
  $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);
  $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);
  $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);
  $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);
  $song[$t] = urldecode($song[$t]);
  $dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);
  $dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);
$r++;
}
//end song info
fclose($scfp);
}

//display stats
if($streamstatus == "1"){
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="refresh" content="40"/>
<link rel=stylesheet href="" type="text/css">
<title>'.$scdef.'</title>
</head>

<body text="" bgcolor="">


<p align="center"><center>
<img src="online.jpg"><br>
<b>Stream Title:</b> '.$servertitle.'<br>
<b>Current Song:</b> '.$song[0].'</p><b>
</p>
</body>

</html>';
}
if($streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
echo'
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="refresh" content="40"/>
<link rel=stylesheet href="" type="text/css">
<title>Radio Server Is Offline</title>
</head>

<body text="" bgcolor="">
<center>
<img src="offline.jpg">
</body>

</html>';
}
?>
#25
[Solved]
better you update your script.
you use ereg_replace that have depracated.
ytdl.xyz youtube downloader
#26
[Solved]
(11-27-2014, 12:04 PM)ogah Wrote: better you update your script.
you use ereg_replace that have depracated.

Well, it used to work. It's a script I've found on the web. I also don't have enough knowledge to meddle in how it works. :/
#27
[Solved]
It says radio is offline. Could you please try again to see if your script works?
Please do not email or PM me with private support requests - Use Support Section.
Don't forget to read TOS.
Never argue with idiots.
First, they'll bring you down to their level and then beat you with their experience!
#28
[Solved]
(11-27-2014, 05:55 PM)un4saken Wrote: It says radio is offline. Could you please try again to see if your script works?

radio is on now........... still not working.
#29
[Solved]
Okay, fixed now
Please do not email or PM me with private support requests - Use Support Section.
Don't forget to read TOS.
Never argue with idiots.
First, they'll bring you down to their level and then beat you with their experience!
[-] The following 1 user Likes un4saken's post:
  • NoelF1
#30
[Solved]
(11-27-2014, 07:35 PM)un4saken Wrote: Okay, fixed now
You are my savior. Thank you thank you.ClappingClappingClappingClappingClapping
  




Users browsing this thread:
1 Guest(s)

fsockopen errors - Shoutcast Now Playing script368