Op http://www.casterclub.com/scast_song.php heb ik het volgende opensource scriptje weten te downloaden. Installatie was zeer duidelijk en dus geen probleem. Na het runnen van script blijf ik fouten krijgen, ik ben beginneling met php en weet er geen raad mee.
Zie hier de code
en hier de foutmeldingen
Notice: Undefined variable: scsuccs in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 25
Notice: Undefined variable: page in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 28
Notice: Use of undefined constant SERVERGENRE - assumed 'SERVERGENRE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SERVERTITLE - assumed 'SERVERTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SONGTITLE - assumed 'SONGTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
$streamstatus = 1
Notice: Use of undefined constant SERVERGENRE - assumed 'SERVERGENRE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SERVERTITLE - assumed 'SERVERTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SONGTITLE - assumed 'SONGTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
$bitrate = 40
Notice: Undefined offset: 2 in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 35
Notice: Undefined offset: 21 in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 55
MON radio: Dj mike - Resistance
Zoals je in de laatste regel kunt zien werkt het script wel. Maar toch al die fouten
Op de site van de maker van dit script, staat nog iemand met de zelfde fout maar een oplossing vind k nergens. Ook hun forum is bijna helemaal leeg.
Zie hier de code
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
| //connect to shoutcast server include('config.php'); //you may edit this path to fit your server environment otherwise leave it alone $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"); $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 ###################################################################################################################### ###################################################################################################################### /////////////////////////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]); $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 name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>'.$scdef.'</title> </head> <body text="#FFFFFF" bgcolor="#000000"> <p style="margin-top: 0; margin-bottom: 0"> <font face="Arial" size="2"><b> Stream Bitrate:</b> '.$bitrate.'kbps</font></p> <p style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="2" color="#FFFFFF"><b> Current Song:</b> '.$song[0].' <b>Played @</b> '.$playedat[0].'</font></p> <p style="margin-top: 0; margin-bottom: 0"><b> <font face="Verdana" size="2" color="#FFFFFF"> Past Songs:</font></b></p> <p style="margin-top: 0; margin-bottom: 0"><font color="#FFFFFF"><font face="Verdana" size="2"> <b>1.</b> '.$song[1].' - <b>Played @</b> '.$playedat[1].'<BR> <b>2.</b> '.$song[2].' - <b>Played @</b> '.$playedat[2].'<BR> <b>3.</b> '.$song[3].' - <b>Played @</b> '.$playedat[3].'<BR> <b>4.</b> '.$song[4].' - <b>Played @</b> '.$playedat[4].'<BR> <b>5.</b> '.$song[5].' - <b>Played @</b> '.$playedat[5].'<BR> <b>6.</b> '.$song[6].' - <b>Played @</b> '.$playedat[6].'<BR> <b>7.</b> '.$song[7].' - <b>Played @</b> '.$playedat[7].'<BR> <b>8.</b> '.$song[8].' - <b>Played @</b> '.$playedat[8].'<BR> <b>9.</b> '.$song[9].' - <b>Played @</b> '.$playedat[9].'<BR></font><BR> </body> </html>'; } ?> |
en hier de foutmeldingen
Notice: Undefined variable: scsuccs in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 25
Notice: Undefined variable: page in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 28
Notice: Use of undefined constant SERVERGENRE - assumed 'SERVERGENRE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SERVERTITLE - assumed 'SERVERTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SONGTITLE - assumed 'SONGTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
$streamstatus = 1
Notice: Use of undefined constant SERVERGENRE - assumed 'SERVERGENRE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SERVERTITLE - assumed 'SERVERTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
Notice: Use of undefined constant SONGTITLE - assumed 'SONGTITLE' in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 39
$bitrate = 40
Notice: Undefined offset: 2 in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 35
Notice: Undefined offset: 21 in D:\mastersofnorbik.ath.cx\menu\sc_song\sc_song.php on line 55
MON radio: Dj mike - Resistance
Zoals je in de laatste regel kunt zien werkt het script wel. Maar toch al die fouten