I have a random image script that I use for a couple of forum signatures, and once in a while people ask me how I make that work. There are probably plenty of examples on the web, but this is the one that I cobbled together. Besides, I haven’t posted any PHP articles yet.
Just set the directory that you want to scan for images in the $dir variable, then save the file as sig.php or something.
In your signature settings, use a forum IMG tag, but for the url, put a reference to this script where you would ordinarily put the name of the image file. The script picks an image form the directory at random, then does a redirect to the file it chose.
I make a special images directory just to hold sigs, so you could have different sig directories for different forums if you want to, Just keep tossing images in the folder and they’ll show up in the rotation.
$dir = "/put/the/path/to/your/images/directory/here";
$input = scandir("$dir");
header ("Location: $dir/" . $input[array_rand($input)]);
$files = array();
$fh = opendir($dirstr);
while (false !== ($filename = readdir($fh)))
if ($filename != "." && $filename != "..")
Hurricane Jeanne is finally out of our hair. After being told for weeks by the weather people that this was one Florida could ignore, Jeanne turned out to be a bigger pain in the ass than Frances ever was. Happily enough, our experience was very similar. We didn’t lose power, and very little damage was done to our home. The storm came in further south of us, so others didn’t fair as well. We are able to sit in comfort and count our many blessings. I only wish that it could have gone so smoothly for others as well.
So we’ve sat through Charley, Frances, and Ivan, and now it appears that Jeanne is going to come knocking at our door. We are beginning to make preparations, but we are becoming lackluster. I think everyone is just full of hurricanes at this point and ready to write the whole thing off.
Fascinating in that we as a species are adaptation machines, quickly adapting to new stimuli and adjusting to new environments, allowing us to exist in extremely hostile surroundings. However, rather than adjust to the requirements for hurricane preparedness as a necessity, we tend to adjust toward ignoring it until it goes away. I suppose step one is usually denial, so maybe this is to be expected. There is usually so much time between hurricanes that you never hit step two.
If it was a more frequent occurrence perhaps we would develop a more appropriate response, but in my 3rd year in the Melbourne area, this it the first time that a hurricane has even troubled us. Now, it’s certainly a fluke that we’re getting so many this year, but it also makes it a perfect time to be here… what are the odds that we’ll get 4 hurricanes in 6 weeks again in the future?
So the plywood goes back up tomorrow, and the office gets made ready for power outages, etc., again today, and we wonder if we should have gotten a generator (our lines are all underground, we didn’t experience any outage during Frances). The storm is expected late Saturday, just like Frances. Deju vu, all over again.
Okay, so admittedly my blog is pure crap. I haven’t made the time to update the theming, so it’s still this canned b2Evolution skin, and I don’t make the time to make new posts or anything. Shame on me. I’ll try to do better, but no promises. When you have something as insidious as City of Heroes in your system, it’s very hard to find time for things like this.
But I will try.