rsfm
11th April 2011, 21:51
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!
<?
//--( 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 ($im, 255, 255, 255);
$font2 = ImageColorAllocate ($im, 0, 0, 0);
$font3 = ImageColorAllocate ($im, 150, 150, 150);
$cst_lentgh = strlen($current_so);
if ($cst_lentgh >= "43") { $song_summary = substr($current_so, 0, 39)." ..."; }
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($im, 2, 69, 26, "Now Playing: ", $font3);
ImageString($im, 2, 147, 26, $song_summary, $font2);
ImageString($im, 2, 69, 40, "We currently have ".$listener_c." of ".$listener_m." listeners tuned in and jamming!", $font3);
ImageString($im, 2, 284, 9, "$img_date - $img_time", $font1);
ImageJPEG($im, '', 95);
}
?>
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!
<?
//--( 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 ($im, 255, 255, 255);
$font2 = ImageColorAllocate ($im, 0, 0, 0);
$font3 = ImageColorAllocate ($im, 150, 150, 150);
$cst_lentgh = strlen($current_so);
if ($cst_lentgh >= "43") { $song_summary = substr($current_so, 0, 39)." ..."; }
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($im, 2, 69, 26, "Now Playing: ", $font3);
ImageString($im, 2, 147, 26, $song_summary, $font2);
ImageString($im, 2, 69, 40, "We currently have ".$listener_c." of ".$listener_m." listeners tuned in and jamming!", $font3);
ImageString($im, 2, 284, 9, "$img_date - $img_time", $font1);
ImageJPEG($im, '', 95);
}
?>