Help me with PHP PLZ!!
what does it mean by
Quote:
playing.jpgCODE
<?php
Header ('Content-type: image/jpeg');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
Header('Pragma: no-cache');// Set the dimensions
$img_width = 468;
$img_height = 50;// Create the image
$image = imagecreate(468, 50);
// Set the colours
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 128, 220, 0);// set the bg colour and border
imagefilledrectangle($image, 0, 0, $img_width, $img_height, $white);
imageline($image, 0, 0, 0, $img_height, $black); // left border
imageline($image, 0, 0, $img_width, 0, $black); // top border
imageline($image, 0, $img_height - 1, $img_width, $img_height - 1, $black); // bottom border
imageline($image, $img_width - 1, 0, $img_width - 1, $img_height - 1, $black); // right border// Get song info from the text file
$song_info = file("info.txt");
$main_info = explode(" - ", $song_info[0]);
$artist = trim($main_info[0]);
$title = trim($main_info[1]);
$real_length = $song_info[1];$for = time() - $song_info[2];
$total = trim($song_info[4]);$minutes = $for / 60;
$break = explode(".", $minutes);$current_secs = $for % 60;
$current_mins = $break[0];$length = $song_info[4];
$totalmins = $current_mins * 60;
$totalsecs = $current_secs + $totalmins;
$percent = $totalsecs / $length * 100;
$percent = round($percent, 0);$font = '/path/to/uploaded/font.ttf';
if ($for <= $total)
{
ImageTTFText ($image, 8, 0, 10, 17, $black, $font, "/me is listening to ".$artist." - ".$title);// progress bar
$width = $percent * 3;
$width = round($width, 0);imagefilledrectangle($image, 11, 22, $width, 40, $red);
imageline($image, 10, 21, 310, 21, $black); // top border
imageline($image, 10, 21, 10, 41, $black); // left border
imageline($image, 10, 41, 310, 41, $black); // bottom border
imageline($image, 310, 21, 310, 41, $black); // right borderif ($current_secs <= 9)
{
$current_secs = "0" . $current_secs;
}ImageTTFText ($image, 11, 0, $width - 7, 37, $black, $font, $percent . "%");
ImageTTFText ($image, 11, 0, 315, 37, $black, $font, $current_mins .":".$current_secs."/".$real_length);
}
else
{
ImageTTFText ($image, 8, 0, 10, 27, $black, $font, "I am currently not listening to any music");
}// output and destroy
imagepng($image);
imagedestroy($image);?>
how do i put that in to a JPG? or am i ment to create a txt file called playing.jpg with that inside it?
___________________
:: Feed The EsK!e Inside ::

