AZForums: Making a Randomized Image - AZForums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Making a Randomized Image Works on forums, websites..

#1 User is offline   Rokan Icon

  • AZ Guru
  • PipPipPipPipPipPipPipPipPipPip
  • View blog
Group:
+ Legendary
Posts:
6,657
Joined:
29-August 05

Post icon  Posted 19 January 2007 - 08:09 PM

A lot of ideas were taken from Oosband's Dynamic signature creation tutorial. Check that out too ;)

Example:
Posted Image



Okay, for starters, you need some images:
  • image.gif - this is the main image you will be working with; the one you will be linking to on forums and websites.
  • image.php - this is the php code, the one that is renamed and embedded into the gif image, therefore making the image run a basic php script.
  • .htaccess - this comes with almost all websites, the small file that is usually blank.
  • image1.gif, image2.gif, image3.gif... as many as you want, with whatever name you want them to be called.
Alright! Lets DO THIS!
Open up image.gif in whatever drawing software you have and make it a 1x1 pixel image, as this saves space.
Edit image.php and add this code, replacing the names with the names you chose, and numbers with numbers you chose:

<?
//Code made by Rokan, with help from Oosband.
header("Content-type: image/gif");
$img = 5; //the amount of images you have
$num = rand(1,$img); //generates random number between 1 and the number you set $img to.
$im = imagecreatefromgif("image".$num.".gif"); //creates the image, and layers it, in a way, on top of image.gif.
imagegif($im); //create the gif image itself.
imagedestroy($im); //destroy it again to save space - it only needs to be loaded once.
?>


Alright. Now, your php code, if you go to the link of your php code in your browser, should give you that generated image. All thats left is a small code in your htaccess file.

Put the following into your .htaccess file:
RewriteEngine on
RewriteRule avatar.gif avatar.php


You might well have to change the paths to the files, but apart from that it should be all working.

I thought that maybe all those with showcases or a big load of avatars that they can't choose out of could use this and show them all off.

Enjoy ^___^
0

#2 User is offline   coolboy Icon

  • AZ Beginner
  • PipPip
  • View blog
Group:
Members
Posts:
11
Joined:
19-January 07

Post icon  Posted 20 January 2007 - 12:12 AM

I seen this before <_<
Posted Image
0

#3 User is offline   Rokan Icon

  • AZ Guru
  • PipPipPipPipPipPipPipPipPipPip
  • View blog
Group:
+ Legendary
Posts:
6,657
Joined:
29-August 05

Posted 20 January 2007 - 12:33 PM

Seeing as i wrote this out in around 5 minutes randomly; I really, really doubt you have. Thanks for blaming for something I haven't done.

If you're going to blame someone for ripping, at least have proof.
0

#4 User is online   Kobius Icon

  • «• 千と千尋の神隠し •»
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • View blog
Group:
Administrator
Posts:
15,610
Joined:
25-August 05

Posted 20 January 2007 - 12:42 PM

View Postcoolboy, on Jan 20 2007, 12:12 AM, said:

I seen this before <_<

Who hasn't? But please do not spam. You have been warned.

The tutorial - easy to follow, easy to use and it's nice to have a randomized avatar or sig. Good Job.
Posted Image
0

#5 User is offline   kadomox Icon

  • Just dropped in to see what condition my condition was in
  • PipPipPipPipPipPipPipPip
  • View blog
Group:
Members
Posts:
1,743
Joined:
13-November 06

Posted 20 January 2007 - 03:37 PM

i like this tut. nice work Rokan.

Posted Image
Fade to black



0

#6 User is offline   cipcip Icon

  • AZ Mastermind
  • PipPipPipPipPipPipPipPipPip
  • View blog
Group:
Members
Posts:
2,624
Joined:
19-November 06

Posted 20 January 2007 - 03:52 PM

nice tutorial ... i`ll try it some day :P
0

#7 User is offline   Oosband Icon

  • DnB Oos
  • PipPipPipPipPipPipPipPipPipPip
  • View blog
Group:
+ Legendary
Posts:
5,527
Joined:
30-August 05
Location:
UK

Posted 01 March 2007 - 11:27 PM

LOL!
http://oosband.anizo...dom_sig/sig.gif

I made this and then saw this thread.
How very weird.

Great tutorial though, I see nothing wrong with the script either.
IPB blocks the script I used (I know why), but doesn't block yours. So I updated my script to yours and everything is good.
Thanks a lot, my sig looks great now.

This post has been edited by Oosband: 02 March 2007 - 12:00 AM

0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users