Autor Tema: [AYUDA]stats  (Leído 668 veces)

Desconectado edgarmoreno2

  • PHPer@ Fijo
  • ***
  • Mensajes: 140
  • Karma: 2
  • Sexo: Masculino
    • Ver Perfil
    • FANFMRADIO
[AYUDA]stats
« en: 25 de Octubre de 2009, 19:20:06 pm »
Hola mira e cogido este stats y e puesto los datos y todo de la radio pero aora voy al index de el stats y me da un error en la linea 13 mirar aki os dejo el codigo
Código: [Seleccionar]
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><body bgcolor="ffffff">
<font color="navyblue"><?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// Coded by Daniel Brown. Edited by Nick Coates [SharpeHosting.com] [Shar*****ws] KEEP THIS INTACT!!!
// Please refer to the readme file for use.
include(&#39;config_radio.php&#39;);  //you may edit this path to fit your server environment otherwise leave it alone
$scfp fsockopen("$scip"$scport, &$errno, &$errstr10);
 if(!
$scfp) {
  
$scsuccs=1;
echo&
#39;&#39;.$scdef.&#39; La radio esta Offline&#39;;
 
}
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($scfp1000);
 }
######################################################################################################################
/////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//define  xml elements
 
$loop = array("STREAMSTATUS""BITRATE""SERVERTITLE""CURRENTLISTENERS");
 
$y=0;
 while(
$loop[$y]!=&#39;&#39;){
  
$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&#39;$&#39;.$scphp.&#39; = &#39;.$$scphp.&#39;<br>&#39;;
  
$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&#39;
<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">
<
META HTTP-EQUIV="REFRESH" CONTENT="30">
<
link rel=stylesheet href="" type="text/css">
<
title>&#39;.$scdef.&#39;</title>
</head>

<
body text="" bgcolor="ffffff">
<
table width="228" height="158" border="0" cellpadding="0" cellspacing="0">
  <
tr>
    <
td align="left" valign="top"><table width="228" border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td><table width="228" border="0" cellspacing="0" cellpadding="0">
            <
tr>
              <
td><strong><font color="black"><font face="verdana" size="1">En este momento la radio esta</font></font></strong></td>
              <
td><strong><font face="verdana" size="1"><img src="online.gif" width="40" height="16"></font></strong></td>
            </
tr>
          </
table></td>
      </
tr>
      <
tr>
        <
td height="123" align="left" valign="top"><table width="228" height="91" border="0" cellpadding="0" cellspacing="0">
          <
tr>
            <
td width="134" align="center" valign="middle"><font color="black"><font face="verdana" size="1">DJ: </font><strong><font color="black"><font face="verdana" size="1"> &#39;.$servertitle.&#39; </font>
 
&nbsp;</strong></td>
            <
td width="94" align="center" valign="middle"><img src="http://www.habbo.es/habbo-imaging/avatarimage?user=&#39;.$servertitle.&#39;&action=std&direction=3000004&head_direction=3000002&gesture=sml&size=l"></td>
          </
tr>
        </
table>
          <
table width="228" border="0" cellspacing="0" cellpadding="0">
            <
tr>
              <
td height="32" align="center" valign="middle"><MARQUEE width 100scrolldelay ><strong><font color="black"><font face="verdana" size="1">&#39;.$song[0].&#39;</font> &nbsp;</strong>
</MARQUEE> &nbsp;</td>
            </
tr>
          </
table></td>
      </
tr>
      <
tr>
        <
td align="right" valign="middle"><strong><font color="black"><font face="verdana" size="1">Oyentes &#39;.$currentlisteners.&#39; / 200</font> &nbsp;</strong></td>
      
</tr>
    </
table></td>
  </
tr>
</
table>

</
body>

</
html>&#39;;
}
if(
$streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
echo&#39;
<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">
<
META HTTP-EQUIV="REFRESH" CONTENT="30;URL=radio_stats.php">
<
link rel=stylesheet href="" type="text/css">
<
title>Habbo Hotel Radio Is Curently Offline</title>
</
head>

<
body text="" bgcolor=""><STYLE type=text/css>
UNKNOWN {
FONT-SIZE10pxCOLOR#black; FONT-FAMILY: verdana
}
BODY {
BACKGROUND-COLORffffff
}
A:link {
COLOR: ; TEXT-DECORATIONnone
}
A:visited {
COLOR#363636; TEXT-DECORATION: none
}
A:hover {
COLOR#363636; TEXT-DECORATION: underline
}
A:active {
TEXT-DECORATIONnone
}
BODY {
FONT-SIZE10pxCOLORe9e6f4FONT-FAMILYverdana
}
TD {
FONT-SIZE10pxCOLORe9e6f4FONT-FAMILYverdana
}
TH {
FONT-SIZE10pxCOLORe9e6f4FONT-FAMILYverdana
}
.
style5 {font-size14px}
</
STYLE>
<
div><center><img src="offline.png"></img></center></div>
</
body>

</
html>&#39;;
}
?>
</font>
</body>
es en la linea 13 si me lo podeis arreglar os estaria muy agradecidos si no porfabor esplique men como ponerlo bien

Comunidad PHPeros

[AYUDA]stats
« en: 25 de Octubre de 2009, 19:20:06 pm »

Desconectado Itachi

  • PHPerit@
  • *
  • Mensajes: 21
  • Karma: 0
    • Ver Perfil
Re:[AYUDA]stats
« Respuesta #1 en: 25 de Octubre de 2009, 21:43:39 pm »
Hola mira e cogido este stats y e puesto los datos y todo de la radio pero aora voy al index de el stats y me da un error en la linea 13 mirar aki os dejo el codigo
Código: [Seleccionar]
<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><body bgcolor="ffffff">
<font color="navyblue"><?php
// Shoutcast Server Stats
// Parses shoutcasts xml to make an effective stats thing for any website
// Coded by Daniel Brown. Edited by Nick Coates [SharpeHosting.com] [Shar*****ws] KEEP THIS INTACT!!!
// Please refer to the readme file for use.
include(&#39;config_radio.php&#39;);  //you may edit this path to fit your server environment otherwise leave it alone
$scfp fsockopen("$scip"$scport, &$errno, &$errstr10);
 if(!
$scfp) {
  
$scsuccs=1;
echo&
#39;&#39;.$scdef.&#39; La radio esta Offline&#39;;
 
}
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($scfp1000);
 }
######################################################################################################################
/////////////////////////part 1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//define  xml elements
 
$loop = array("STREAMSTATUS""BITRATE""SERVERTITLE""CURRENTLISTENERS");
 
$y=0;
 while(
$loop[$y]!=&#39;&#39;){
  
$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&#39;$&#39;.$scphp.&#39; = &#39;.$$scphp.&#39;<br>&#39;;
  
$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&#39;
<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">
<
META HTTP-EQUIV="REFRESH" CONTENT="30">
<
link rel=stylesheet href="" type="text/css">
<
title>&#39;.$scdef.&#39;</title>
</head>

<
body text="" bgcolor="ffffff">
<
table width="228" height="158" border="0" cellpadding="0" cellspacing="0">
  <
tr>
    <
td align="left" valign="top"><table width="228" border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td><table width="228" border="0" cellspacing="0" cellpadding="0">
            <
tr>
              <
td><strong><font color="black"><font face="verdana" size="1">En este momento la radio esta</font></font></strong></td>
              <
td><strong><font face="verdana" size="1"><img src="online.gif" width="40" height="16"></font></strong></td>
            </
tr>
          </
table></td>
      </
tr>
      <
tr>
        <
td height="123" align="left" valign="top"><table width="228" height="91" border="0" cellpadding="0" cellspacing="0">
          <
tr>
            <
td width="134" align="center" valign="middle"><font color="black"><font face="verdana" size="1">DJ: </font><strong><font color="black"><font face="verdana" size="1"> &#39;.$servertitle.&#39; </font>
 
&nbsp;</strong></td>
            <
td width="94" align="center" valign="middle"><img src="http://www.habbo.es/habbo-imaging/avatarimage?user=&#39;.$servertitle.&#39;&action=std&direction=3000004&head_direction=3000002&gesture=sml&size=l"></td>
          </
tr>
        </
table>
          <
table width="228" border="0" cellspacing="0" cellpadding="0">
            <
tr>
              <
td height="32" align="center" valign="middle"><MARQUEE width 100scrolldelay ><strong><font color="black"><font face="verdana" size="1">&#39;.$song[0].&#39;</font> &nbsp;</strong>
</MARQUEE> &nbsp;</td>
            </
tr>
          </
table></td>
      </
tr>
      <
tr>
        <
td align="right" valign="middle"><strong><font color="black"><font face="verdana" size="1">Oyentes &#39;.$currentlisteners.&#39; / 200</font> &nbsp;</strong></td>
      
</tr>
    </
table></td>
  </
tr>
</
table>

</
body>

</
html>&#39;;
}
if(
$streamstatus == "0")
{
//you may edit the html below, make sure to keep variable intact
echo&#39;
<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">
<
META HTTP-EQUIV="REFRESH" CONTENT="30;URL=radio_stats.php">
<
link rel=stylesheet href="" type="text/css">
<
title>Habbo Hotel Radio Is Curently Offline</title>
</
head>

<
body text="" bgcolor=""><STYLE type=text/css>
UNKNOWN {
FONT-SIZE10pxCOLOR#black; FONT-FAMILY: verdana
}
BODY {
BACKGROUND-COLORffffff
}
A:link {
COLOR: ; TEXT-DECORATIONnone
}
A:visited {
COLOR#363636; TEXT-DECORATION: none
}
A:hover {
COLOR#363636; TEXT-DECORATION: underline
}
A:active {
TEXT-DECORATIONnone
}
BODY {
FONT-SIZE10pxCOLORe9e6f4FONT-FAMILYverdana
}
TD {
FONT-SIZE10pxCOLORe9e6f4FONT-FAMILYverdana
}
TH {
FONT-SIZE10pxCOLORe9e6f4FONT-FAMILYverdana
}
.
style5 {font-size14px}
</
STYLE>
<
div><center><img src="offline.png"></img></center></div>
</
body>

</
html>&#39;;
}
?>
</font>
</body>
es en la linea 13 si me lo podeis arreglar os estaria muy agradecidos si no porfabor esplique men como ponerlo bien

¿Qué error te da?, si no nos lo dices, no te podemos ayudar

Desconectado edgarmoreno2

  • PHPer@ Fijo
  • ***
  • Mensajes: 140
  • Karma: 2
  • Sexo: Masculino
    • Ver Perfil
    • FANFMRADIO
Re:[AYUDA]stats
« Respuesta #2 en: 25 de Octubre de 2009, 22:11:54 pm »
¿Qué error te da?, si no nos lo dices, no te podemos ayudar
Warning: Call-time pass-by-reference has been deprecated in /home/webcindario/r/a/radiovh/radio_stats.php on line 13

Warning: Call-time pass-by-reference has been deprecated in /home/webcindario/r/a/radiovh/radio_stats.php on line 13

Warning: fsockopen() has been disabled for security reasons in /home/webcindario/r/a/radiovh/radio_stats.php on line 13
esos errores me dan

Desconectado Fravier

  • PHPer@ Fijo
  • ***
  • Mensajes: 119
  • Karma: 7
    • Ver Perfil
Re:[AYUDA]stats
« Respuesta #3 en: 25 de Octubre de 2009, 23:37:56 pm »
Warning: Call-time pass-by-reference has been deprecated in /home/webcindario/r/a/radiovh/radio_stats.php on line 13

Warning: Call-time pass-by-reference has been deprecated in /home/webcindario/r/a/radiovh/radio_stats.php on line 13

Warning: fsockopen() has been disabled for security reasons in /home/webcindario/r/a/radiovh/radio_stats.php on line 13
esos errores me dan

Tienes la funcion fsockopen activada?, porque si no la tienes por eso es el error

Desconectado Siquillote

  • PHPero Master
  • ******
  • Mensajes: 4.229
  • Karma: 179
  • Sexo: Masculino
    • Ver Perfil
Re:[AYUDA]stats
« Respuesta #4 en: 26 de Octubre de 2009, 15:22:27 pm »
Edgar , eso es debido a que webcindario tiene esa funcion desabilitada. Como te tengo en MSN pues hay te ayudo yo , cierra el tema porfavor

#Fdo. Physlet

Desconectado edgarmoreno2

  • PHPer@ Fijo
  • ***
  • Mensajes: 140
  • Karma: 2
  • Sexo: Masculino
    • Ver Perfil
    • FANFMRADIO
Re:[AYUDA]stats
« Respuesta #5 en: 26 de Octubre de 2009, 17:07:12 pm »
Tienes la funcion fsockopen activada?, porque si no la tienes por eso es el error
si si la tengo activada

Desconectado Tope

  • PHPero Experto
  • *****
  • Mensajes: 540
  • Karma: 23
  • Sexo: Masculino
  • Programador PHP
    • Ver Perfil
    • www.Info-Keko.Es
Re:[AYUDA]stats
« Respuesta #6 en: 26 de Octubre de 2009, 18:09:45 pm »
No, no la tienes, lo primero que te dice es que fsockopen está deshabilitado por motivos de seguridad.

Si tienes PHP 5, prueba a utilizar mi código (está en Tutoriales PHP)
Un Saludo, Tope >> Programador FIJO en PHPeros