The ImageSlideShow module from briask.com is an excellent and simple image gallery which shows any images from a designated folder and have one link from the images. Clients (and I see on Briask's own forum) have asked whether it would be possible to have individual links to individual images. This hack allows you to link any image to any url. First rename your images with a sequence of numbers like so -
Upload them to your image folder for the ImageSlideShow module. Open up the file modules/mod_briaskISS/mod_briaskISS.xml in your editor and go to line 55 and add these lines underneath. Add as many new input boxes as you need for your links. --> <param name="URL1" type="text" size="100" default = "http://www.joomla.org" label="URL1" description = "URL1 to link to when Slideshow image is clicked."/> <param name="URL2" type="text" size="100" default = "http://www.joomla.org" label="URL2" description = "URL2 to link to when Slideshow image is clicked."/> <param name="URL3" type="text" size="100" default = "http://www.joomla.org" label="URL3" description = "URL3 to link to when Slideshow image is clicked."/> <param name="URL4" type="text" size="100" default = "http://www.joomla.org" label="URL4" description = "URL4 to link to when Slideshow image is clicked."/> The ImageSlideShow module backend will look like this now. Now open up the file modules/mod_briaskISS/mod_briaskUtility.php in your editor and go to line 221 and add these lines underneath. These just fetch the new url parameters. --> $picURL1 = $params->get('URL1', 0); $picURL2 = $params->get('URL2', 0); $picURL3 = $params->get('URL3', 0); $picURL4 = $params->get('URL4', 0); Then down to line approx. 347 echo '<li><a href="'.$picURL.'"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>'; Comment this out and add the following -> //echo '<li><a href="'.$picURL.'"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>'; $number = preg_replace("/[^0-9]/", '', $file); // ditch anything that is not a number switch ($number) { case 1: $picURLx = $picURL1; break; case 2: $picURLx = $picURL2; break; case 3: $picURLx = $picURL3; break; case 4: $picURLx = $picURL4; break; } echo '<li><a href="'.$picURLx.'"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>';and again for the Case 2 (open in new window) echo '<li><a href="'.$picURL.'" target="_blank"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>';Change to.. //echo '<li><a href="'.$picURL.'" target="_blank"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>'; $number = preg_replace("/[^0-9]/", '', $file); // ditch anything that is not a number switch ($number) { case 1: $picURLx = $picURL1; break; case 2: $picURLx = $picURL2; break; case 3: $picURLx = $picURL3; break; case 4: $picURLx = $picURL4; break; } echo '<li><a href="'.$picURLx.'" target="_blank"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>'; Now the individual images will link to the required links. |
|
Last Updated on Saturday, 26 December 2009 00:35 |