IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
  Reply to this topicStart new topicStart Poll

 [Question][PHP] News image?

 
Svip  
Posted: Saturday, Apr 30 2005, 20:11
Quote Post


I eat babies
Group Icon
Group: Retired Staff
Joined: Nov 12, 2001

dk.gif

XXXXX



I have seen these pictures with people's post count in.

But I was wondering if it was possible to make a picture that showed the lastest news on a website ( which is mine ( so I know the tables ) )?

And how would I write such a PHP script?

I have never tried writting images in PHP. bored.gif
Users WebsitePMAOLYahooICQPlayStation Network
  Top
 

 
Jack_Knife  
Posted: Sunday, May 1 2005, 00:36
Quote Post


we usually take all niggas garments
Group Icon
Group: Leone Family Mafia
Joined: Dec 8, 2001

au.gif

XXXXX



CODE
<?

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

list(,$song) = explode("\n", file_get_contents("http://ws.audioscrobbler.com/txt/recent/Jack_Knife"));

$fontnum = 3;
$fontwidth = imagefontwidth($fontnum);
$fontheight = imagefontheight($fontnum);

$string = $song;

$img = imagecreate(strlen($string)*$fontwidth, $fontheight);

$white = imagecolorallocate($img, 0, 0, 0);
$black = imagecolorallocate($img, 255, 255, 255);

$trans = imagecolortransparent($img, $white);
imagefill($img, 0, 0, $white);

imagestring($img, $fontnum, 0, 0, $string, $black);

imagepng($img);
imagedestroy($img);

?>


That's the code for my 'now playing' image in my sig. To get the news from your site, you'd need to do a similar thing, just change the url in there, and parse the code to find the string you want within that.
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG