Click to See Complete Forum and Search --> : Rotating Signature Quote


bigal
10-15-2003, 10:18 AM
If you are fimilar with THESETHESE (http://www.danasoft.com) (danasoft sigs) the ones that tell your your IP and have a rotating quote on them, well a friend told me the script:



Here's how to do it.
A. Create a .htaccess
put "RedirectMatch (.*)\.jpg$ http://yourhost.com/yoursig.php" (without quotes)
* just note, you should create a folder and put everything in it or it will replace every jpg file. I couldn't get the yoursig.jpg thing to work... but you may have more luck... depends on the host

B. Create a php file.
enter this
<?php
Header("Content-type: image/jpeg");
Header("Expires: Mon, 1, 1999 05:00:00 GMT");
Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
Header("Cache-Control: no-store, no-cache, must-revalidate");
Header("Cache-Control: post-check=0, pre-check=0", false);
Header("Pragma: no-cache");

$im = imagecreatefromjpeg("your-sig-pic.jpg");
$mycolor = imagecolorclosest($im, 0, 0, 0);
$word = "Hello!";

imagestring($im, 2, 90, 13, $word, $mycolor);

Imagejpeg($im,'',90);
ImageDestroy($im);
?>

C. Create a jpeg file

And voila! Replace $word with anything you want and change, 90, 13 to whatever you want to change their location (x, and then y)





It woks as well, you request the jpg file, and it gives you it ith whatever the $word value is. But i was wondering if anyone knew how i could make it display a RANDOM quote!

Any Help greatfully receaved!
Also this may not work on Pay Hosts!

pyro
10-15-2003, 11:14 AM
Try this:

$words = array ("foo", "bar", "foobar");
srand((float) microtime() * 10000000);
$index = array_rand($words);
$word = $words[$index];

bigal
10-15-2003, 11:34 AM
That Works Brilliantly!

http://www.helzbellz.uni.cc/sig/sig.jpg

This script could also auto watermark all uploaded images aswell! (Good use) as EVERY jpg file requested is auto watermarked with the text! :D

pyro
10-15-2003, 11:43 AM
I get a 404 on that link...

Yes, GD does have some cool uses (beond dynamic sigs... :D)

bigal
10-15-2003, 12:11 PM
Sorry, typo!

And cheers for that!

http://www.hellzbellz.uni.cc/sig/sig.php

It was for FFX2.net
but i will make loadz more! :D

pyro
10-15-2003, 12:26 PM
Yep, it's rather fun, eh?