Random Image with Multiple Links

Discuss the development and implementation of Joomla! modules here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
mhschus
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Aug 26, 2005 5:52 pm
Location: Dyersville, Iowa USA
Contact:

Random Image with Multiple Links

Postby mhschus » Fri Sep 09, 2005 1:25 pm

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? ???
Mark Schuster

lw-d
Joomla! Guru
Joomla! Guru
Posts: 980
Joined: Thu Aug 18, 2005 9:12 pm
Location: UK
Contact:

Re: Random Image with Multiple Links

Postby lw-d » Tue Oct 04, 2005 6:09 am

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

BetterThanJimbo
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Fri Aug 19, 2005 7:02 pm

Re: Random Image with Multiple Links

Postby BetterThanJimbo » Tue Oct 04, 2005 3:07 pm

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.

User avatar
zigzag
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 249
Joined: Tue Sep 20, 2005 9:03 pm
Location: Elsewhere

Re: Random Image with Multiple Links

Postby zigzag » Thu Oct 06, 2005 8:55 pm

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/fileinfo/Piks.html

xover15
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Sun Apr 26, 2009 6:11 pm

Re: Random Image with Multiple Links

Postby xover15 » Wed Dec 07, 2011 9:21 pm

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.


Return to “Modules”

Who is online

Users browsing this forum: No registered users and 1 guest