Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fsockopen errors - Shoutcast Now Playing script
#1
[Solved]
Hi techies,

I'm trying to use a "Shoutcast Now Playing" script

which can be found here:
Code:
http://radiosolution.info/clients/knowledgebase/36/Now-playing-script-for-Shoutcast.html
and an example:
Code:
http://www.radiosolution.info/tools/nowplaying.php


now I'm having a problem with the same script on my site
Code:
http://noelborg.com/testing/stats/radio_stats.php

Do you allow connections via "fsockopen" ? Can I use such script, please?
username: noelpro
#2
[Solved]
You should be able to edit that in you php.ini I'm sure.
#3
[Solved]
Depends on whether the connection is closed by default for security reasons. DJB or un4saken would be able to confirm whether it is closed.
#4
[Solved]
When I try to visit your site then the problem look appear like this.
Code:
Fatal error: Call-time pass-by-reference has been removed in /home/noelpro/public_html/testing/stats/radio_stats.php on line 16

It seem the problem is coming from line 16. I found other related article which is disscussing the problem like yours.

http://stackoverflow.com/questions/89712...-available.
HOT MUSIC VIDEO | Video Music Knowledgebase
#5
[Solved]
(04-27-2014, 03:45 AM)jaran Wrote: When I try to visit your site then the problem look appear like this.
Code:
Fatal error: Call-time pass-by-reference has been removed in /home/noelpro/public_html/testing/stats/radio_stats.php on line 16

It seem the problem is coming from line 16. I found other related article which is disscussing the problem like yours.

http://stackoverflow.com/questions/89712...-available.


I honestly have no idea what you're talking about. Didn't find that cose in the radio_stats,php.

This is the code I've got at present.

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!!!!!!!

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">
<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>Listeners:</b> '.$currentlisteners.' / '.$maxlisteners.'<br>
<b>Bitrate:</b> '.$bitrate.'kbps<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">
<link rel=stylesheet href="" type="text/css">
<title>Radio Server Is Offline</title>
</head>

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

</html>';
}
?>
#6
[Solved]
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.
#7
[Solved]
(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.
#8
[Solved]
As I said before at above you had the error because "&" variable at line 16
Your script,
PHP Code:
$scfp fsockopen("$scip"$scport, &$errno, &$errstr30); 
It should be,
PHP Code:
$scfp fsockopen("$scip"$scport$errno$errstr30); 
HOT MUSIC VIDEO | Video Music Knowledgebase
[-] The following 1 user Likes jaran's post:
  • NoelF1
#9
[Solved]
(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.
[-] The following 1 user Likes GigaGreg's post:
  • NoelF1
#10
[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.

Thanks a lot mate, edited my .htaccess file. But I can't find my php.ini file anywhere. Undecided
  




Users browsing this thread:
1 Guest(s)

fsockopen errors - Shoutcast Now Playing script3100