Przedszkolak
Postów: 14
Data rejestracji: 08.06.2006 00:43
|
Witam. Zamieściłem skrypt w panelu ale niemoge wpasc na pomysl jak wysroskowac cale staty i niemoge usunąc czarnych kresek przedzielajacych w niektorych miejscach skrypt zobaczcie www.radiomp.xt.pl po prawej stronie te kreski jak to usunac i potem wysrodkowac caly skrypt. Dla ulatwienia zamieszczam caly moj skrypt:
openside("Statystyki");
$sc[czas] = 180;
$sc[host] = "66.199.250.186";
$sc[port] = 7777;
$sc[template] = "<b> [genre]</b>";
$sc[template3] = "<b> [dj]</b>";
$sc[template2] = "<b> [ile]</b>";
if($fp = fsockopen($sc[host], $sc[port]))
{
fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
fgets($fp);fgets($fp);fgets($fp);
while(!feof($fp)) $in.=strip_tags(fgets($fp));
fclose($fp);
# echo $in;
// [status]
$m[0]="Server is currently";
$m[1]="";
$mp[0]=strpos($in,$m[0]);
$mp[1]=@strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , 5 ) ) );
if( $tmp[1][0] == "up" )
$dat[status] = "on";
elseif( $tmp[1][0] == "down" )
$dat[status] = "off";
else
$dat[status] = "err";
if($dat[status]=="on")
{
// [dj]
$m[0]="Stream Title:";
$m[1]="Content Type:";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1] ) );
if( $tmp[1] ) $dat[dj] = $tmp[1];
else $dat[dj] = "err";
// [gg]
$m[0]="Stream AIM:";
$m[1]="Stream IRC:";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1] ) );
if( $tmp[1] ) $dat[gg] = $tmp[1];
else $dat[gg] = "err";
// [genre]
$m[0]="Stream Genre:";
$m[1]="Stream URL:";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) );
if( $tmp[1] ) $dat[genre] = $tmp[1];
else $dat[genre] = "err";
// [ile]
$m[0]="kbps with";
$m[1]="listeners";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) ) );
if( $tmp[1] ) $dat[ile] = $tmp[1][0];
else $dat[ile] = "err";
// [max]
$m[0]="kbps with";
$m[1]="listeners";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) ) );
if( $tmp[1] ) $dat[max] = $tmp[1][2];
else $dat[max] = "err";
// [peak]
$m[0]="Listener Peak:";
$m[1]="Average";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-7) );
if( $tmp[1] ) $dat[peak] = $tmp[1];
else $dat[peak] = "err";
}
}
else
{
$dat=array();
$dat[status]="err";
}
$co = array('[status]','[dj]','[gg]','[genre]','[ile]','[max]','[peak]');
$naco = array($dat[status],$dat[dj],$dat[gg],$dat[genre],$dat[ile],$dat[max],$dat[peak]);
$sc[template] = str_replace($co,$naco,$sc[template]);
$sc[template2] = str_replace($co,$naco,$sc[template2]);
$sc[template3] = str_replace($co,$naco,$sc[template3]);
echo'<table cellspacing="0" cellpadding="0" background="panel.jpg" border="1" width="120" >
<tr><td valign="top" height="10">
</td></tr>
<tr><td valign="top" height="20">
<FONT SIZE="2" color="maroon"><a href="http://"></a>
</td></tr>
<tr><td valign="top" height="29">
</td></tr>
<tr><td valign="top" height="9">
<table cellspacing="0" cellpadding="0"><tr>
<td width="34">
</td>
<td width="190">
<MARQUEE Scrolldelay=200 width="93">'.$sc[template].'</MARQUEE>
</td>
</tr></table>
</td></tr>
<tr><td valign="top" height="21">
</td></tr>
<tr><td valign="top" height="9">
<table cellspacing="0" cellpadding="0"><tr>
<td width="37">
</td>
<td width="190>
<MARQUEE Scrollamount=3 width="73">'.$sc[template3].'</MARQUEE>
</td>
</tr></table>
</td></tr>
<tr><td valign="top" height="21">
</td></tr>
<tr><td valign="top" height="9">
<table cellspacing="0" cellpadding="0"><tr>
<td width="80">
</td>
<td >';
echo $sc[template2];
echo'</td>
</tr></table>
</td></tr>
<tr><td valign="top" height="35">
</td></tr>
<tr><td valign="top" height="12">
</td></tr>
</table>';
closeside();
|
Bywalec
Postów: 915 Pomógł: 41
Data rejestracji: 12.03.2006 07:28
|
temat mozna zamknac gdyz wszystko mu poprawilem(zeby Pieka sie nie czepial :P to wstawiam poprawiony kod). openside("Statystyki");
echo'<center>';
$sc[czas] = 180;
$sc[host] = "66.199.250.186";
$sc[port] = 7777;
$sc[template] = "<b> [genre]</b>";
$sc[template3] = "<b> [dj]</b>";
$sc[template2] = "<b> [ile]</b>";
if($fp = fsockopen($sc[host], $sc[port]))
{
fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
fgets($fp);fgets($fp);fgets($fp);
while(!feof($fp)) $in.=strip_tags(fgets($fp));
fclose($fp);
# echo $in;
// [status]
$m[0]="Server is currently";
$m[1]="";
$mp[0]=strpos($in,$m[0]);
$mp[1]=@strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , 5 ) ) );
if( $tmp[1][0] == "up" )
$dat[status] = "on";
elseif( $tmp[1][0] == "down" )
$dat[status] = "off";
else
$dat[status] = "err";
if($dat[status]=="on")
{
// [dj]
$m[0]="Stream Title:";
$m[1]="Content Type:";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1] ) );
if( $tmp[1] ) $dat[dj] = $tmp[1];
else $dat[dj] = "err";
// [gg]
$m[0]="Stream AIM:";
$m[1]="Stream IRC:";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1] ) );
if( $tmp[1] ) $dat[gg] = $tmp[1];
else $dat[gg] = "err";
// [genre]
$m[0]="Stream Genre:";
$m[1]="Stream URL:";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) );
if( $tmp[1] ) $dat[genre] = $tmp[1];
else $dat[genre] = "err";
// [ile]
$m[0]="kbps with";
$m[1]="listeners";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) ) );
if( $tmp[1] ) $dat[ile] = $tmp[1][0];
else $dat[ile] = "err";
// [max]
$m[0]="kbps with";
$m[1]="listeners";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=explode( " " , trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-2 ) ) );
if( $tmp[1] ) $dat[max] = $tmp[1][2];
else $dat[max] = "err";
// [peak]
$m[0]="Listener Peak:";
$m[1]="Average";
$mp[0]=strpos($in,$m[0]);
$mp[1]=strpos($in,$m[1]);
$ml[0]=strlen($m[0]);
$ml[1]=strlen($m[1]);
$tmp[1]=trim( substr( $in , $mp[0] + $ml[0] , $mp[1]-$mp[0]-$ml[1]-7) );
if( $tmp[1] ) $dat[peak] = $tmp[1];
else $dat[peak] = "err";
}
}
else
{
$dat=array();
$dat[status]="err";
}
$co = array('[status]','[dj]','[gg]','[genre]','[ile]','[max]','[peak]');
$naco = array($dat[status],$dat[dj],$dat[gg],$dat[genre],$dat[ile],$dat[max],$dat[peak]);
$sc[template] = str_replace($co,$naco,$sc[template]);
$sc[template2] = str_replace($co,$naco,$sc[template2]);
$sc[template3] = str_replace($co,$naco,$sc[template3]);
echo'<table cellspacing="0" cellpadding="0" background="panel.jpg" border="0" width="120" >
<tr><td valign="top" height="10">
</td></tr>
<tr><td valign="top" height="20">
<FONT SIZE="2" color="maroon"><a href="http://"></a>
</td></tr>
<tr><td valign="top" height="29">
</td></tr>
<tr><td valign="top" height="9">
<table cellspacing="0" cellpadding="0"><tr>
<td width="34">
</td>
<td width="190">
<MARQUEE Scrolldelay=200 width="113">'.$sc[template].'</MARQUEE>
</td>
</tr></table>
</td></tr>
<tr><td valign="top" height="21">
</td></tr>
<tr><td valign="top" height="9">
<table cellspacing="0" cellpadding="0"><tr>
<td width="37">
</td>
<td width="190">
<MARQUEE Scrollamount=3 width="113">'.$sc[template3].'</MARQUEE>
</td>
</tr></table>
</td></tr>
<tr><td valign="top" height="21">
</td></tr>
<tr><td valign="top" height="9">
<table cellspacing="0" cellpadding="0"><tr>
<td style="padding:2px"> '.$sc[template2].'</td>
</tr></table>
</td></tr>
<tr><td valign="top" height="35">
</td></tr>
<tr><td valign="top" height="15">
</td></tr>
</table>';
closeside();
Pozdro!!!
//Proton
Zamykam.
Edytowane przez proton dnia 16.07.2006 12:50:41
|