Support Forums
Random Image PHP - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21)
+---- Thread: Random Image PHP (/showthread.php?tid=13876)

Pages: 1 2


Random Image PHP - Matt G - 11-20-2010

I need to create a random image to use as a avatar for the forums i participate on. Does anyone know of a php script which will allow me to point to

http://www.gamersboards.com/mattsavatar/avatar.php
and get the random image

i already have a folder full of jpgs but id rather have it were it uses gifs, jpgs and pngs.

Thanks a bunch
MattG


RE: Random Image PHP - Proof - 11-20-2010

If you know PHP at all it should be simple.

Put them all into an array and then use array_rand() to randomize it.



RE: Random Image PHP - Matt G - 11-20-2010

thats weird, i created it into a php file, like the following

[Image: rotate.php]

I tried to add it to the boards though but it says its invalid because its a php file, how would i get it as a signature like mattR's on mybb?


RE: Random Image PHP - Proof - 11-20-2010

(11-20-2010, 01:39 PM)MattG Wrote: thats weird, i created it into a php file, like the following

[Image: rotate.php]

I tried to add it to the boards though but it says its invalid because its a php file, how would i get it as a signature like mattR's on mybb?

Quick question, would you rather me just link you to a working sig rotator? Or do you want to have one for yourself?


RE: Random Image PHP - Matt G - 11-20-2010

no it works, but it wont setup for a avatar, if you can find one that uses /example.php/image.jpg that would be great, i've found some, but they don't work.

you know what ill do, ill rewrite it in htaccess

edit worked perfectly

dang now it does not rotate


RE: Random Image PHP - Proof - 11-20-2010

(11-20-2010, 02:15 PM)MattG Wrote: no it works, but it wont setup for a avatar, if you can find one that uses /example.php/image.jpg that would be great, i've found some, but they don't work.

you know what ill do, ill rewrite it in htaccess

edit worked perfectly

dang now it does not rotate

I've made one but it doesn't work with avatars either.

You can use this, not sure if it works for avatars.
http://sig.grumpybumpers.com/


RE: Random Image PHP - Matt G - 11-20-2010

not going to work i need one that displays it on when access the php file, not redirects.


RE: Random Image PHP - Proof - 11-20-2010

I sent you a PM, try that I am not sure if it'll work. It uses the array_rand function though.

The one I made doesn't work with avatars either.


RE: Random Image PHP - Matt G - 11-20-2010

Finally got one to work, Used MattR's which he shared with everyone, just didn't see.


RE: Random Image PHP - Proof - 11-20-2010

(11-20-2010, 03:34 PM)MattG Wrote: Finally got one to work, Used MattR's which he shared with everyone, just didn't see.

Alright, did the one I sent you in a PM work at all?