Old 11th April 2011, 22:51   #1
Junior Member
Join Date: Feb 2009
Posts: 1
[PHP] Shoutcast status image

I've been searching high and low, and I can't find anything that works.

if anyone could please edit this PHP to work so that it gets the shoutcast info from 7.html instead of MySQL?

Thank-you in advance!

PHP Code:

//--( set varibles here
$dbun "<mysql-username>";
$dbpw "<mysql-password>";
$dbnm "<mysql-database>";
$dbtb "<mysql-tablename>";
$frshimgurl "path/to/dynamic_banner.jpg";
$listener_c "0";
$listener_m "0";
$current_so "-n/a-";

//--( grab database info
$dbcn = @mysql_connect("localhost""$dbun""$dbpw") or $php_err "master database connection error (1)<br>";
$db   = @mysql_select_db($dbnm$dbcn) or $php_err "master database connection error (2)<br>";

$sql_0a "SELECT * FROM $db_table";
$res_0a mysql_query($sql_0a$dbcn);
    if (
$row_0a mysql_fetch_array($res_0a)) {
$listener_c $row_0a["listener_c"];
$listener_m $row_0a["listener_m"];
$current_so $row_0a["current_song"];
//--( end script

  //-----( print image

header("Content-Type: image/jpeg");
$im   imagecreatefromjpeg($frshimgurl);
$font1 ImageColorAllocate ($im255255255);
$font2 ImageColorAllocate ($im000);
$font3 ImageColorAllocate ($im150150150);
$cst_lentgh strlen($current_so);
    if (
$cst_lentgh >= "43") { $song_summary substr($current_so039)." ..."; }
    else { 
$song_summary $current_so; }
$hourdiffab   "0";
$timeadjustab = ($hourdiffab 60 60);
$curdateab    date("g:i A",time() + $timeadjustab);
$img_time     "$curdateab EST";
$img_date     date("M d, Y");
    if (
$im) {
ImageString($im26926"Now Playing: "$font3);
ImageString($im26940"We currently have ".$listener_c." of ".$listener_m." listeners tuned in and jamming!"$font3);
ImageString($im22849"$img_date - $img_time"$font1);
rsfm is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Site Design

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump