*checking in*
Solstis
oh, good. then It must juet be my comp witht e error. now who wasn't to explain the random sig + img map ?
Oooh! Has anyone answered this yet? That's what I have right now! Unless she wants the more complicated one where when the image changes, so does the sigmap associated. I don't know how to do that.
Yet.
BUT! To do what I have, you need either
A) A site host that allows remote linking,
or
B) A place that will store your images separately.
I'm assuming you have one of the two, since you already have an image map.
If you are using A, then you use
this .php code for the randomizer:
<?php
/*
Based on code by Perpetual Dreamer and Alland.
Instructions:
Place all the files that you want into the directory of your choice,
which will be specified in the $path variable.
Then, just link to the script as a php file. Can be used in a site, such as <img src="filename.php">,
or a forum, using [img]http://yoursite.com/filename.php[/img]
Enjoy.
Rob
*/
//directory here (relative to script)
$path = 'http://YOUR URL HERE';
$i = 0;
$imgDir = opendir ($path)
while ( $file = readdir( $imgDir ) )
{
//checks that file is an image
$file_type = strrchr( $file, "." )
$is_image = eregi( "jpg|gif|png",$file_type )
if ( $file != '.' && $file != '..' && $is_image )
{ $images[$i++] = $file; }
}
closedir ($imgDir)
srand( (double) microtime()*1000000 )
$image_name = $path . '/' . $images[rand( 0,sizeof( $images ) -1 )]
$imgSize = GetImageSize( $image_name )
//ends script if no images found
if ( $i == 0 )
die()
//Display the image
readfile("$image_name")
?>
All you need to change is the URL path, ie:
//directory here (relative to script)
$path = 'http://rimedragona.t35.com/random/images';
to the directory where you have the images stored. Just make sure that those images are the only ones you have in there, or it may grab any old image you have along with the ones you actually want it to use.
If you are using B, then you use
this .php code for the randomizer:
<?php
$howMany = #; //howmany images to reandomize
srand ((double) microtime() * 948625) //seed the randomizer
$randNumber = rand(1,$howMany) //make the random Number
//select the image
switch($randNumber)
{
Case 1:
header("Location: http://www.yoururl.com/subdirectory/filename.jpg")
break;
Case 2:
header("Location: http://www.yoururl.com/subdirectory/filename.gif")
break;
/***********************************************************
* Add more case statements here if you need them:
* Case 3:
* header("Location: [new image name]")
* break;
*
* and so on...
**********************************************************/
}
?>
There are two things that change in this one.
First part:
<?php
$howMany = #; //howmany images to reandomize
You change the # to the number of images you want to randomize. You add the images below in the second part.
Second part:
Case 1:
header("Location: http://www.yoururl.com/subdirectory/filename.jpg")
break;
For each case, replace the fake url I put in above with the actual url of the image you want randomized. It can be any web-friendly image format (.gif, .jpg, .png). I strongly recommend against bitmaps. They are huge, and take forever to load, eating bandwidth like no one's business.
Then, no matter which one you choose, you put this in your sig. (That is, if you chose to name your randomizer php 'random.php' like I did)
[url=http://www.yoururl.com/random.php]<img src="http://www.yoururl.com/random.php" ismap border=0>[/url]
The only thing that changes from a regular sigmap is you are linking to a .php file instead of directly to an image. The .php file goes through the images it has listed in it, and decides which one to put up. But the hot spots have to be in the same spot on each image, and the links stay the same. So even if you have one image with a place that links to a guild, and then a different image with that same hotspot linking to a pet shop, it will only go to one or the other, not both.
Refresh a few times and look at my sig, you'll see what I mean. ^_^
Hope that helps!