PDA

View Full Version : random imagescript


striderkz
07-25-2004, 08:25 AM
hey
how do u do tht random image thing in ure signature?

flipske
07-25-2004, 09:29 AM
$images = Array(
* * * * * * * * * Array("fname"=>"kait.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"sig2.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"idea12.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"idea2.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"barkait.jpg", "type"=>"jpg"),
* * * * * * * * * Array("fname"=>"kait.jpg", "type"=>"jpg")

* * * * * * * *);

$im = $images[rand(0, count($images)-1)];

header ("Content-type: image/" . $im['type']);

//output the bloody image directly
$handle = fopen("./" . $im['fname'], "rb");
$contents = fread($handle, filesize("./" . $im['fname']));
fclose($handle);
echo $contents;
Die();
?>

Gez
07-25-2004, 10:00 AM
you can't use php in sigs

flipske
07-25-2004, 11:26 AM
you can? put the code between [IMG] bloks?

Llamaman
07-25-2004, 11:42 AM
You can do it if .php is an acceptable extention for images in the forum you are visiting. Fortunatly i have enabled it here so you will be able to use random sig images :)

Phoenixinferno
07-25-2004, 11:43 AM
:/ so in it where do you put the links??

Dirty Socks
07-25-2004, 06:06 PM
I used random image script for sigs. But I never used it here because I couldn't get it to work. Now it does. Hmmm odd.

striderkz
07-26-2004, 04:35 AM
ani one know the code?

daprisoner
07-26-2004, 04:37 AM
Originally posted by flipske@Jul 25 2004, 12:29 PM
$images = Array(
* * * * * * * * * Array("fname"=>"kait.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"sig2.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"idea12.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"idea2.png", "type"=>"png"),
* * * * * * * * * Array("fname"=>"barkait.jpg", "type"=>"jpg"),
* * * * * * * * * Array("fname"=>"kait.jpg", "type"=>"jpg")

* * * * * * * *);

$im = $images[rand(0, count($images)-1)];

header ("Content-type: image/" . $im['type']);

//output the bloody image directly
$handle = fopen("./" . $im['fname'], "rb");
$contents = fread($handle, filesize("./" . $im['fname']));
fclose($handle);
echo $contents;
Die();
?>

thats the code

Dirty Socks
07-26-2004, 12:41 PM
There is an easier script if you save your pics a gifs. You don't have to edit in all the picture names. You just put them all in the same folder thus never having to edit in the extention. The downside to having a generator is finding a free php host.

Arez
07-26-2004, 05:14 PM
1. Upload you sigs in a place that lets you have your own folder

2. Get the Random sig .php script

3. Upload it onto the folder

4. Use the RANDOM.php in you [IMG] brackets.

Its what im doing now. Refresh and it should bring up a new one!

daprisoner
07-27-2004, 09:00 AM
ok, im lost, can someone tell me a place that i can have my own folder thingy, then Jeb, since u use it, can u tell us the easier script, and then can you tell me were do i put all that

StinkyJoe
07-27-2004, 11:22 AM
<_< http://www.clantemplates.com/forums/index.php?showtopic=5745

RvN
07-27-2004, 01:22 PM
here's the php file that I use for my sig

http://www.illusiongfx.com/files/sigrotation.zip

just put in a folder with a bunch of sigs and link to it. then let the rotating begin...

excel542
07-28-2004, 04:19 PM
Tahts cool and new info for me, didnt know you could use PHP in an image, well I dont know much about PHP anywayz so...