View Single Post
Old 6th August 2004, 04:11   #304
llyodbanks
Junior Member
 
Join Date: Aug 2004
Posts: 1
testing







ip : 219.95.84.254
url: http://www.usm.net.my
image filename: back.png

any1 can c that e.g. from:
i saved the file as
http://www.freepgs.com/excalibur/sigcode.phps ,

should i display target from
http://www.freepgs.com/excalibur/sigcode.php

the full code i use is

Quote:

<?php
// Ruff Dawg's 'Now Playing Sig w/ Background v. 1.5 May 7, 2004
// Special thanks to the originator, DJ Rampage

// This image you can call immediately from an html file in the image tag
// (i.e. <img src="black.php">) easy huh?

Header("Content-type: image/png");

/////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////*Configurables*//////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

/////////////////////*Background Picture File*////////////////////////

/* Replace "sicpic.png" with your own
picture file (must be a .png) */

$im = imagecreatefrompng("back.png");

/////////////////////////////*Host Information*/////////////////////////////

$host = "219.95.84.254"; // No 'http://' in the host
$port = "8000";

//////////////////////////////////*Text Colors*////////////////////////////////

// text colors are in RGB

$text_color1 = ImageColorAllocate($im,0,153,255);

////////////////////////////////////*Text Size*/////////////////////////////////

$text_size = "3";

//////////////////////////////*Text Alignment*/////////////////////////////

//X alignment

$x1 = "78";
$x2 = "78";

//Y alignment

$y1 = "24";
$y2 = "44";

///////////////////////////*Offline Message*///////////////////////////////

$offline1 = "Radio is Currently Offline";
$offline2 = "Please Check Again Later";


//////////////////////////////////////////////////////////////////////////////////////////////////
/////*DON'T TOUCH THE CODE BELOW UNLESS//////////
///YOU KNOW EXACTALLY WHAT YOU ARE DOING*//
///////////////////////////////////////////////////////////////////////////////////////////////

$fp = fsockopen("$host", $port, &$errno, &$errstr, 30);
if(!$fp) {
$success=2;
}
if($success!=2){ //if connection
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp);
$page = ereg_replace(".*<body>", "", $page); //extract data
$page = ereg_replace("</body>.*", ",", $page); //extract data
$numbers = explode(",",$page);
$currentlisteners=$numbers[0];
$connected=$numbers[1];
if($connected==1)
$wordconnected="yes";
else
$wordconnected="no";
$peaklisteners=$numbers[2];
$maxlisteners=$numbers[3];
$reportedlisteners=$numbers[4];
}

if($success!=2 && $connected==1){

$song=explode(" - ",$numbers[6]);

$string1= $song[0];
$string2= $song[1];

}

else {
$string1= $offline1;
$string2= $offline2;
}

$px = (imagesx($im)-5*strlen($string1))/2;
ImageString($im,$text_size,$x1,$y1,$string1,$text_color1);
$px = (imagesx($im)-5*strlen($string2))/2;
ImageString($im,$text_size,$x2,$y2,$string2,$text_color1);

ImagePng($im);
imagedestroy($im);
?>

Last edited by llyodbanks; 6th August 2004 at 04:32.
llyodbanks is offline   Reply With Quote