J'utilise aussi un second script qui lui ne plante pas le site mais affiche des erreurs
Ce script affiche l'historique des titres diffusés et fonctionnait aussi très bien chez mon ancien hébergeur :
$scfp = fsockopen("tv3.stream-music.net", "8402", &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo'Radio Klub est actuellement en maintenance';
}
if($scsuccs!=1){
//for newer shoutcast servers
fputs ($scfp, "GET /admin.cgi?mode=viewxml HTTP/1.1\r\nHost: tv3.stream-music.net:8402\r\n .
User-Agent: SHOUTcast Song (author: [email protected])(Mozilla Compatible)\r\n .
Authorization: Basic ".base64_encode ("admin:"xxxxxxxx"")."\r\n\r\n");
while(!feof($scfp)) {
$page .= fgets($scfp, 1000);
}
//define xml elements
$loop = array("STREAMSTATUS", "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)
$$scphp = urldecode($$scphp);
// uncomment the next line to see all variables
// echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
//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]);
//format the date
$frmt_date[$t] = date('h:i:s',$playedat[$t]);
//you may edit the html below, make sure to keep variables intact
echo'
<div align="left"><b>'.$frmt_date[$t].'</b> '.$song[$t].'<b></b></b><BR></div>
';
$r++;
}
fclose($scfp);
}
?>
avec l'erreur suivante :
Code : Tout sélectionner
Warning: modules_html::include() [function.modules-html-include]: Unable to access /customers/radio-klub.net/radio-klub.net/httpd.www/modules/mod_track2.php in /customers/radio-klub.net/radio-klub.net/httpd.www/includes/frontend.html.php on line 367
Warning: modules_html::include(/customers/radio-klub.net/radio-klub.net/httpd.www/modules/mod_track2.php) [function.modules-html-include]: failed to open stream: No such file or directory in /customers/radio-klub.net/radio-klub.net/httpd.www/includes/frontend.html.php on line 367
Warning: modules_html::include() [function.include]: Failed opening '/customers/radio-klub.net/radio-klub.net/httpd.www/modules/mod_track2.php' for inclusion (include_path='.:') in /customers/radio-klub.net/radio-klub.net/httpd.www/includes/frontend.html.php on line 367
Y a t-il une solution a ce type de problème ?
J'utilise aussi un second script qui lui ne plante pas le site mais affiche des erreurs
Ce script affiche l'historique des titres diffusés et fonctionnait aussi très bien chez mon ancien hébergeur :
[php]
$scfp = fsockopen("tv3.stream-music.net", "8402", &$errno, &$errstr, 30);
if(!$scfp) {
$scsuccs=1;
echo'Radio Klub est actuellement en maintenance';
}
if($scsuccs!=1){
//for newer shoutcast servers
fputs ($scfp, "GET /admin.cgi?mode=viewxml HTTP/1.1\r\nHost: tv3.stream-music.net:8402\r\n .
User-Agent: SHOUTcast Song (author:
[email protected])(Mozilla Compatible)\r\n .
Authorization: Basic ".base64_encode ("admin:"xxxxxxxx"")."\r\n\r\n");
while(!feof($scfp)) {
$page .= fgets($scfp, 1000);
}
//define xml elements
$loop = array("STREAMSTATUS", "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)
$$scphp = urldecode($$scphp);
// uncomment the next line to see all variables
// echo'$'.$scphp.' = '.$$scphp.'<br>';
$y++;
}
//end intro xml elements
//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]);
//format the date
$frmt_date[$t] = date('h:i:s',$playedat[$t]);
//you may edit the html below, make sure to keep variables intact
echo'
<div align="left"><b>'.$frmt_date[$t].'</b> '.$song[$t].'<b></b></b><BR></div>
';
$r++;
}
fclose($scfp);
}
?>
[/php]
avec l'erreur suivante :
[code]Warning: modules_html::include() [function.modules-html-include]: Unable to access /customers/radio-klub.net/radio-klub.net/httpd.www/modules/mod_track2.php in /customers/radio-klub.net/radio-klub.net/httpd.www/includes/frontend.html.php on line 367
Warning: modules_html::include(/customers/radio-klub.net/radio-klub.net/httpd.www/modules/mod_track2.php) [function.modules-html-include]: failed to open stream: No such file or directory in /customers/radio-klub.net/radio-klub.net/httpd.www/includes/frontend.html.php on line 367
Warning: modules_html::include() [function.include]: Failed opening '/customers/radio-klub.net/radio-klub.net/httpd.www/modules/mod_track2.php' for inclusion (include_path='.:') in /customers/radio-klub.net/radio-klub.net/httpd.www/includes/frontend.html.php on line 367[/code]
Y a t-il une solution a ce type de problème ?