View Single Post
Old 05-02-2007, 04:28 PM   #9
AnimeSpirit
SBLive! Veteran
 
AnimeSpirit's Avatar
 
Join Date: Dec 2006
Location: Nowhere
Age: 41
Posts: 1,659
Rep Power: 260 AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future AnimeSpirit has a brilliant future
Send a message via Yahoo to AnimeSpirit
Quote:
Originally Posted by BrainSmashR
Is pulling live data from my database and displaying it in a gif signature image that refreshes every time you refresh the page what you would consider complex? I notice you don't have one.....

Don't let the fact that I use iframes fool you into thinking I don't have nearly a decade of experience running my own website, Anime....
Actually, displaying dynamic data in a GIF is very simple. I don't use one on my site for 2 reasons: 1. None of my sites have data that change so drastically throughout the day; 2. Everytime someone views a page that has such a banner on it, it must query your database for the info in order to make it, which puts a huge strain on the server when you've got that banner displayed in 100+ places and people are hitting those pages 500+ times a day.

Don't get me wrong, dynamic banners a great idea, but it's better for your server's peformance to set a script that creates this image and updates it at specific times of the day instead of everytime the banner is loaded. Set a CRON job to run your banner update script once a day and that would probably be efficient enough and won't eat your server resources alive.

Here's a simple script I wrote a while back to write a text string to an existing graphic file.
PHP Code:
$string "Some text";
$NewImage =imagecreatefromjpeg("pic.jpg");
$TextColor imagecolorallocate($NewImage255255255);
imagestring($NewImage5205$string$TextColor);
imagejpeg($NewImage); //Output image to browser or save to path 
It would be very simple to point this at an existing background image and query for some data to place in it.

If you want, let's jump to the computer forums and continue this. We can share code if you want. I've got some tricks you might like.
__________________
Confuscious says~

Last edited by AnimeSpirit; 05-02-2007 at 04:39 PM.
AnimeSpirit is offline   Reply With Quote