Jump to content

corlos11

Uživatel
  • Příspěvků

    3
  • Registrován

  • Aktivní

Reputace

0 Na nule
  1. Dobrý den potřeboval bych poradit s tímto kódem: openside("Status"); echo ' <?php /* // Author: dstjohn (Mediacast1/Casterclub) // Date started: 05-03-2002 (10:00A.M) // Date Ended: 05-03-2002 (6:03 P.M) // Requirements: // 1.SHOUTcast streaming server // 2.Oddcast dsp with winamp/xmms (recomended setup) // 3.Webserver with php 4.x (Recommended environment: Unix (Freebsd, Red Hat etc.. with Apache 3.x) // Support: None, post in the casterclub forums // Core script Information: // SHOUTcast Song Status was written and developed on Windows Xp with apache and php4.1.2 // Has not been tested on IIs webservers, if you do so and get it to work please let us know // At the forums (http://casterclub.com/forums) // Also has been tested on freebsd with apache, php4.1.2 and works fine. */ //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){ //for newer shoutcast servers fputs ($scfp, "GET /admin.cgi?mode=viewxml HTTP/1.1\r\nHost: $scip:$scport\r\n . User-Agent: SHOUTcast Song (author: [email protected])(Mozilla Compatible)\r\n . Authorization: Basic ".base64_encode ("admin:$scpass")."\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.' '; $y++; } //end intro xml elements //get song info and history $pageed = ereg_replace(".*", "", $page); $pageed = ereg_replace(".*", "", $pageed); $songatime = explode("", $pageed); $r=1; while($songatime[$r]!=""){ $t=$r-1; $playedat[$t] = ereg_replace(".*", "", $songatime[$r]); $playedat[$t] = ereg_replace(".*", "", $playedat[$t]); $song[$t] = ereg_replace(".*", "", $songatime[$r]); $song[$t] = ereg_replace(".*", "", $song[$t]); $song[$t] = urldecode($song[$t]); //format the date $frmt_date[$t] = date('l dS of F Y h:i:S A',$playedat[$t]); //you may edit the html below, make sure to keep variables intact echo' '.$t.'.Song: '.$song[$t].' - Played @ '.$frmt_date[$t].' '; $r++; } fclose($scfp); } ?>'; closeside(); Mám web radio-real.hostreal.eu a chtěl bych doplnit do tohoto thematu ten status radia,jak tam je jenom abych dal ip port a heslo mého radia. Děkuji za odpovědi
  2. Děkuju moc pošlu mu to
  3. Ahoj, prosím kámoš dělá generátor statusů a potřebuje poradit a nechce se mu zde registrovat.[dělá to na svůj web hostreal.eu] Jak udělat ,aby se mu tam zobrazovali vlastní obrázky. Je mu se vždy zobrazí jen černé pozadí.Tady mi poslal kód: <?php // TU SKONTROLUJEME CI BOLI ZADANE UDAJE O SERVERI, AK NIE KOD SA NEVYKONA, POKRACUJE NA SPODKU if ((isset($_GET[ipadresa]))and(isset($_GET[port]))) { header("Content-type: image/png"); // MAME OBRAZOK ////////// PARAMETRE SERVERA $ip= $_GET[ipadresa]; $port= $_GET[port]; ////////// KONIEC PARAMETRE SERVERA ////////// VYGENEROVANIE OBRAZKU $sirka = 360; // SIRKA OBRAZKU $vyska = 96; // VYSKA OBRAZKU $obrazok = ImageCreate ($sirka,$vyska); // VYPIS OBRAZKU ////////// FARBA POZADIA OBRAZKU $farba_pozadia = ImageColorAllocate ($obrazok, 0, 0, 0); // 0 = cierna ////////// KONIEC FARBY POZADIA OBRAZKU ////////// KONIEC VYGENEROVANIE OBRAZKU ////////// FARBY $color = ImageColorAllocate($obrazok, 255, 255, 255); // farba pisma 1 $color_jakub = ImageColorAllocate ($obrazok, 102, 102, 102); // to iste co pred tym ale ina farba ////////// KONIEC FARBY ////////// SA:MP FUNKCIE NIC NEPREMIENAJTE $fp = @fsockopen('udp://' . $ip, $port, $errno, $errstr, 1); if (!$fp) { ImageString($obrazok, 3, 50, 45, "Error: $errno - $errstr", $color); } else { $packet = 'SAMP'; $packet .= chr(strtok($ip, '.')); $packet .= chr(strtok('.')); $packet .= chr(strtok('.')); $packet .= chr(strtok('.')); $packet .= chr($port & 0xFF); $packet .= chr($port >> 8 & 0xFF); fwrite($fp, $packet.'i'); fread($fp, 11); $is_passworded = ord(fread($fp, 1)); $plr_count = ord(fread($fp, 2)); $max_plrs = ord(fread($fp, 2)); $strlen = ord(fread($fp, 4)); $hostname = htmlentities(fread($fp, $strlen)); $strlen = ord(fread($fp, 4)); $gamemode = htmlentities(fread($fp, $strlen)); $strlen = ord(fread($fp, 4)); $mapname = htmlentities(fread($fp, $strlen)); ////////// VPYSOVANIE TEXTU DO OBRAZKOV ImageString ($obrazok, 4, 5, 5, "$hostname", $color); ImageString($obrazok, 3, 5, 32, "IP: $ip:$port", $color); ImageString($obrazok, 3, 5, 46, "Players: $plr_count/$max_plrs", $color); ImageString($obrazok, 3, 5, 61, "GameMode: $gamemode", $color); ImageString($obrazok, 2, 265, 80, "www.hostreal.cz", $color_jakub); if ($is_passworded) { ImageString($obrazok, 3, 5, 76, "Password: Yes", $color); } else { ImageString($obrazok, 3, 5, 76, "Password: No", $color); } ////////// KONIEC VYPISOVANIA TEXTU DO OBRAZKOV fwrite($fp, $packet.'c'); fread($fp, 11); fclose($fp); } ////////// KONIEC SA:MP FUNKCIE ////////// VYTVORIME A ZNICIME OBRAZOK imagepng($obrazok); imagedestroy($obrazok); ////////// KONIEC VYTVORIME A ZNICIME OBRAZOK } else { header("Content-type: image/png"); $obrazok = ImageCreate (360,96); // VYPIS OBRAZKU $farba_pozadia = ImageColorAllocate ($obrazok, 0, 0, 0); // 0 = cierna $color = ImageColorAllocate($obrazok, 255, 255, 255); // farba pisma 1 ImageString($obrazok, 3, 50, 45, "Server nebol najdeny!", $color); ////////// VYTVORIME A ZNICIME OBRAZOK imagepng($obrazok); imagedestroy($obrazok); ////////// KONIEC VYTVORIME A ZNICIME OBRAZOK } ?> Prosím poraďte. Děkuju moc.
×
×
  • Create New...