Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mati/domains/forum.programosy.pl/public_html/includes/bbcode.php on line 483

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 27

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 28

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 29

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 30

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 31

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 32

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 33

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 35

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 36

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 37

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 38

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 39

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 40

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 41

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 42

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 43

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 44

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 45

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 47

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 48

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 49

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 50

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 51

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 52

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 53

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 54

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 55

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 56

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 80

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 81

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 82

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 83

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 84

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 85

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 86

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 87

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 88

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 89

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 90

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 91

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 92

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 93

Deprecated: Function eregi() is deprecated in /home/mati/domains/forum.programosy.pl/public_html/includes/functions_gfxua.php on line 94

Strict Standards: Non-static method utf_normalizer::nfkc() should not be called statically in /home/mati/domains/forum.programosy.pl/public_html/includes/utf/utf_tools.php on line 1663
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3900: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3902: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3903: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3904: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
statystyki przy niedziałającym serwerze • programosy.pl

  • Ogłoszenie:

statystyki przy niedziałającym serwerze

Wszystko odnośnie tworzenia grafiki - obróbka, problemy, oceny.
Tworzenia Stron internetowych - HTML, PHP, MySQL...

statystyki przy niedziałającym serwerze

Postprzez luka237 25 Mar 2008, 18:52

reklama
Mam taki skrypt statystyk:
Kod: Zaznacz wszystko
<HTML>
<HEAD>
<TITLE>Statystyki pobrane z eshoutcast.info</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">
</HEAD>

<!-- ImageReady Slices (Untitled-1 copy.gif) -->
<TABLE WIDTH=159 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="166">
   <TR><TD height="51">
         <IMG SRC="images/index_01.png" WIDTH=159 HEIGHT=51 ALT=""></TD>
   </TR>
      
   <TR>
      <TD height="35">
         <IMG SRC="images/index_02.png" WIDTH=159 HEIGHT=35 ALT=""></TD>
   </TR>
   <TR>
      <TD background="images/index_03.png" height="17" valign="top">
         <b>
         <font face="Verdana" size="1" color="#FFFF00">
<MARQUEE width="159" SCROLLAMOUNT=2 behavior="alternate" onMouseOver='this.stop()' onMouseOut='this.start()' height="12" scrolldelay="2"><?
   $sc[czas]       =   180;
   $sc[host]       =   "121.15.121.215";
   $sc[port]       =   2594;?>
<?  $sc[template]   =  "<b> [dj]</b>";

#   $sc[template]   =   "<b>Status (On/Off/err) :</b> [status]<br><b>GG DJ-a:</b> [gg]<br><b>Dj:</b> [genre]<br><b>Ilu sluchaczy aktualnie/maksymalnie/peak:</b> [ile]/[max]/[peak]<br>";

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]);

echo $sc[template];

$nag = "statystyki porbane ze www.eshoutcast.info";
$text = '';
?></Marquee></font></b></TD>
   </TR>
   <TR>
      <TD height="12">
         <IMG SRC="images/index_04.png" WIDTH=159 HEIGHT=12 ALT=""></TD>
   </TR>
   <TR>
      <TD background="images/index_05.png" height="16">
         <b>
         <font face="Verdana" size="1" color="#FFFF00">
<MARQUEE width="159" SCROLLAMOUNT=1 behavior="scroll" onMouseOver='this.stop()' onMouseOut='this.start()' height="12" scrolldelay="1"><?
   $sc[czas]       =   180;
   $sc[host]       =   "78.129.158.229";
   $sc[port]       =   1946;?>
<?  $sc[template]   =  "<b> [genre]</b>";

#   $sc[template]   =   "<b>Status (On/Off/err) :</b> [status]<br><b>GG DJ-a:</b> [gg]<br><b>Dj:</b> [genre]<br><b>Ilu sluchaczy aktualnie/maksymalnie/peak:</b> [ile]/[max]/[peak]<br>";

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]);

echo $sc[template];

$nag = "statystyki porbane z www.eshoutcast.info";
$text = '';
?></Marquee></font></b></TD>
   </TR>
   <TR>
      <TD height="14">
         <IMG SRC="images/index_06.png" WIDTH=159 HEIGHT=14 ALT=""></TD>
   </TR>
   <TR>
      <TD background="images/index_07.png" height="19">
         <b>
         <font face="Verdana" size="1" color="#FFFF00">
  &nbsp;
  <?
   $sc[czas]       =   180;
   $sc[host]       =   "121.15.121.215";
   $sc[port]       =   2594;?>
<?  $sc[template]   =  "<b> [ile]</b>";

#   $sc[template]   =   "<b>Status (On/Off/err) :</b> [status]<br><b>GG DJ-a:</b> [gg]<br><b>Dj:</b> [genre]<br><b>Ilu sluchaczy aktualnie/maksymalnie/peak:</b> [ile]/[max]/[peak]<br>";

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]);

echo $sc[template];

$nag = "statystyki pobrane z eshoutcast.info";
$text = '';
?></Marquee></font></b></TD>
   </TR>
   <TR>
      
   </TR>
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
&nbsp;</HTML>


teraz moj problem, co dodac i gdzie, by gdy serwer będzie wyłączony wyświetlał się tekst: Aktualnie nie nadajemy. ?
Awatar użytkownika
luka237
~user
 
Posty: 87
Dołączenie: 02 Lut 2007, 12:31



Powróć do Grafika & Webmastering

Kto jest na forum

Użytkownicy przeglądający to forum: Brak zarejestrowanych użytkowników oraz 4 gości