Page 1 of 1

Random Image with Multiple Links

Posted: Fri Sep 09, 2005 1:25 pm
by mhschus
I've worked with both the standard mod_random_image and with random_image_linker by Ben Jones, but neither of them appears to be capable of doing what I'm looking for.

Does anyone know of a module that will display a random image that will allow a different link for each image?  I know I can probably do a workaround by making a link out of an {mosimage} in the newsflash module, but I would like to have a little more  straightforward solution.

Any ideas? ???

Re: Random Image with Multiple Links

Posted: Tue Oct 04, 2005 6:09 am
by lw-d
I am looking for something similar, I have random image based quotes that I would like to link through to a specific page,

i.e quote_1 link through to quote_1.htm
    quote_2 link through to quote_2.htm

Anyway of doing this, I don't mind hacking the code.

Thanks
Lee

Re: Random Image with Multiple Links

Posted: Tue Oct 04, 2005 3:07 pm
by BetterThanJimbo
Quoted from the old forums (UltraMagna, March 2005):

In the Random Image admin area, just enter a "#" sign in the Link Parameter . Then, go to your "mod_random_image.php" file and change this (around line 65):

echo "\n";

with this:

echo "\n";



Also, be sure to use your image directory location above and change _blank back to _self if you don't wish link to another page.

Re: Random Image with Multiple Links

Posted: Thu Oct 06, 2005 8:55 pm
by zigzag
Hi,

I needed to do the same thing, I found this module 'Piks' on Joomla France, you can have a different link for each image -http://www.joomlafrance.org/telecharger ... /Piks.html

Re: Random Image with Multiple Links

Posted: Wed Dec 07, 2011 9:21 pm
by xover15
I was trying to do the same thing and couldn't find a plugin or module to do it, so I came up with a work around.

On refresh, randomly rotate images each with it's own link.

I made 3 .html files - one for each of my images with this code:

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body style="margin: 0px; padding: 0px;">
<a href="http://www.yoursite.com/url" target="_parent">
<img src="images/home_btn3.gif" />
</a>
</body>
</html>

Then I used the wrap module that comes with joomla to iframe a .php file with this in it. (randomly grabs the file type you designate '.html')

Code: Select all

<?php
$files = glob('{*.html}', GLOB_BRACE);
readfile($files[array_rand($files)]);
?>
Then used "modules anywhere" to place it where I wanted in the site.

There maybe a cleaner way to do this, but it works. Hope it helps.