Here is a trick some of you might want to try, or just know about: how to display a random signature of yours in a forum that doesn't provide an option for it.
It's easy, and doesn't require any particular knowledge.
The problem is: you want to display one random pic from a list of pics, but the forum doesn't provide any plugin that would let you do it.
The solution: put the regular "img" tags in your signature, but instead of an URL to a picture, we are going to put an URL for a script I coded that will «display» (that's a bit more complicated than that, coders will know what I'm talking about) a random pics from a folder. Both the script and the folders containing the pics will be located on a remote host.
The web host
First off, you will need a (free) web host on which to store all the tags you want to display. Just google « free web host », you will need it to allow PHP (99.99% of free web hosts provide PHP).
Now that you have your host, create a folder called img on it and put all your pics in it. Then create a file called index.php, and copy/paste the following code in it: rndpic.php.
Fire up your favorite browser, and browse the URL of that index file (that is: http://[free-web-host.com]/index.php).
If you did the above steps correctly, you should see a pic of yours… refresh the page a couple times, you will see another random pic being displayed !
We are almost done, you did the hardest part
The web forward
Now, some of you might say: « We are done, all we have to do is put
[img]http://[free-web-host.com]/index.php[/img]
in the signature, and it will display a random pic like it does on my browser ». You are right, that would theoricaly work but IP board (GT) doesn't allow 'php' as picture extension (the [img] tags expect the link to bee the one of a pic, in our case it links to a PHP script).
So… we have to cheat. We need to make a web forwarding from an url that allows anything to be put at its end (http://web-forward.com/a.gif) to our script (http://[free-web-host.com]/index.php).
In order to do so, I used a free web forwarding website called AFRAID. Create a free account on it, then browse the Registry section and click on a domain name (I used us.to). Then, on the new page put these settings:
Subdomain: pick an unique name for your web forward, I choosed izrndpic Destination: http://[free-web-host.com]/index.php
Click Save, check the Cloak case on the next page, then Save again. You should see your freshly created web forward URL at the center of the page, in a list.
Now let's see if the web forwarding works: in your browser, try to browse the web forward URL, it should redirect you to the URL you previously put as Destination.
If it's not working, wait for a couple minutes a retry, sometimes the web forward take a few minutes to be set.
Last step: try to use your web forwarded URL with a random picture name at its end, e.g http://[subdomain.domain]/a.gif
If it doesn't redirect you to the random picture script, pick another domain name in the registry.
The last step
Now you're all set !
Edit your signature in GT with that fake URL you just created (http://[subdomain.domain]/a.gif), and it will display a random picture !
You can see the trick working in my own signature: it displays an Albanian/Canadian/Slovakian flag randomly.
Note about the script
The script is a PHP script and was made by me. It handles png, jpg and gif files, and detects the file type according to its ]MIME-type.
I allow you to do whatever you want with it (edit, redistribute, etc…), just be careful when you edit it (basically the only things you should be allowed to edit are the $fmt array and the IMG_DIR define).
Have fun !
This post has been edited by ironzorg: 25 August 2011 - 09:07 AM

Help











