Zonar
Новичок
Вывод статистики на изображение.
Доброго времени суток уважаемые кодеры.
Сегодня пере домнойстал такой вопрос.
Есть интернет радио.
Есть скрипт который выводит статистику в режиме online
Собственно сабж :
Нужно данные выводить на картинку, в будущем для подписи на форуме .
Увы я не знаю как это воплотить в реальность. Помогите , будьте так любезны. Спасибо.
P.S -Картинка будет моя )
Доброго времени суток уважаемые кодеры.
Сегодня пере домнойстал такой вопрос.
Есть интернет радио.
Есть скрипт который выводит статистику в режиме online
PHP:
<?php /*================================================================*\ || ############################################################## || || # ICEcast info script v1.0 # || || # by Johnny [icq 319-058] # || || # # || || # [ ASTeam - Advanced Security Team ] # || || # [url]http://www.asteam.ru[/url] | [url]http://www.asteam.ru/forum/[/url] # || || ############################################################## || \*================================================================*/ // define (NameStation, '/nrj'); //******* ******* define (RadioOff, ' '); //******* ******* //******* : 0 - , 1 - ; ******* define (StreamTitle, 1); define (StreamTitleText, ' : '); //define (StreamDescription, 1); define (StreamDescriptionText, ' - '); //define (ContentType, 1); define (ContentTypeText, ' - '); //define (MountUptime, 1); define (MountUptimeText, ' : '); //define (Bitrate, 1); define (BitrateText, ' : '); define (CurrentListeners, 1); define (CurrentListenersText, '<b> Online :</b> '); //define (PeakListeners, 1); define (PeakListenersText, ' : '); //define (StreamGenre, 1); define (StreamGenreText, ' : '); //define (StreamURL, 1); define (StreamURLText, ' : '); define (CurrentSong, 1); define (CurrentSongText, ' - ' ); define (NoStream, ' ');//******* ******* define (Separator, ' '); //******* ******* //******* ******* $file = file_get_contents('http://moeradio.ru:10000'); //******* ******* $start = strpos($file, 'Mount Point : (' . NameStation . ') :') or $start = 0; if ($start < 1) exit(RadioOff); //******* , ******* $start += strlen('Mount Point : (' . NameStation . ') :'); $file = substr($file, $start); $file = substr($file, 0, strpos($file, 'Mount Point')); //******* ******* //############################################################## //******* ******* //******* ******* if (StreamTitle == 1) { if (preg_match('#<td>Stream Title:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { $streamtitle = $m[1]; echo StreamTitleText, $streamtitle, Separator; } else echo StreamTitleText, NoStream, Separator; } //******* ******* if (StreamDescription == 1) { if (preg_match('#<td>Stream Description:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { $streamdesc = $m[1]; echo StreamDescriptionText, $streamdesc, Separator; } else echo StreamDescriptionText, NoStream, Separator; } //******* ******* if (ContentType == 1) { if (preg_match('#<td>Content Type:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { $contenttype = $m[1]; echo ContentTypeText, $contenttype, Separator; } else echo ContentTypeText, NoStream, Separator; } //******* ******* //if (MountUptime == 1) { // if (preg_match('#<td>Mount Uptime:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { // $mountuptime = $m[1]; // echo MountUptimeText, $mountuptime, Separator; // } else echo MountUptimeText, NoStream, Separator; //} //******* ******* //if (Bitrate == 1) { // if (preg_match('#<td>Bitrate:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { // $bitrate = $m[1]; // echo BitrateText, $bitrate, Separator; // } else echo BitrateText, NoStream, Separator; //} //******* ******* if (CurrentListeners == 1) { if (preg_match('#<td>Current Listeners:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { $currentlisteners = $m[1]; echo CurrentListenersText, $currentlisteners, Separator; } else echo CurrentListenersText, NoStream, Separator; } //******* - ******* //if (PeakListeners == 1) { // if (preg_match('#<td>Peak Listeners:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { // $peaklisteners = $m[1]; // echo PeakListenersText, $peaklisteners, Separator; // } else echo PeakListenersText, NoStream, Separator; //} //******* ******* //if (StreamGenre == 1) { // if (preg_match('#<td>Stream Genre:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { // $streamgenre = $m[1]; // echo StreamGenreText, $streamgenre, Separator; // } else echo StreamGenreText, NoStream, Separator; //} //******* ******* //if (StreamURL == 1) { // if (preg_match('#<td>Stream URL:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { // $streamurl = $m[1]; // echo StreamURLText, $streamurl, Separator; // } else echo StreamURLText, NoStream, Separator; //} //******* ******* if (CurrentSong == 1) { if (preg_match('#<td>Current Song:<\/td><td class=\"streamdata\">(.*)<\/td>#Ui', $file, $m)) { $currentsong = $m[1]; echo CurrentSongText, $currentsong, Separator; } else echo CurrentSongText, NoStream, Separator; } ?>
Нужно данные выводить на картинку, в будущем для подписи на форуме .
Увы я не знаю как это воплотить в реальность. Помогите , будьте так любезны. Спасибо.
P.S -Картинка будет моя )