This snippet is still in the works, and is fairly specialized for my needs. Dimmy has been nice enough to help me so far. It is based on the MooSlidshow snippet, also by Dimmy.
In my case;
[!lightshow? &folder=`[+title+]` &set_name=`[+title+]` &sometv=`[+title+]`!]
The page title is the folder, and the lightshow identifier, and the alternative text for the link...
<?php
$path = "slide/babies/$folder/";
$slides = array();
if ($dh = @opendir($path)) {
while(($file = readdir($dh)) !== false) {
if ( !preg_match('/\.thumb*/',$file) && preg_match('@.png$|.gif$|.jpg$|.PNG$|.GIF$|.JPG$@', $file) && $file != '.' && $file != '..' && $file != 'thumb.jpg') {
$slides[] = $file;
}
}
}
// shuffle($slides); //Enable random
$num = count($slides);
$output = "";
for($i=0;$i<$num;$i++) {
$output .= "<a href='$path$slides[$i]' rel='lightbox[$set_name]' title='[+species+] - [+title+] $[+price+]' >.</a> <br />";
}
return $output;
?>
At this point, specifying a folder name will read the images from said folder and populate the links. The links (except the initial one) is meant to display as a "." in a hidden area of the page, or behind the thumbnail.
I have tinkered around quite a bit and I can not get it to work properly; I need the thumbnail as a lightbox link to trigger the show. I can get it to work somewhat, but it appears my TV’s are being ignored on that certain call. Other than this, everything is working.
The bunk output is
<img alt=" Thumbnail" src="slide/babies//thumb.jpg"/>
as taken from firebug. It should look like this
<img alt="[b]FOLDER[/b] Thumbnail" src="slide/babies/[b]FOLDER[/b]/thumb.jpg"/>
FOLDER being the ’title’ TV. Somewhere in there I need it to create the lightbox link from the [+title+]/thumb.jpg image. I did get this to work, but it displayed it once for every image in the folder... I am not by any means a coder, but I have made some fair mods and fixes to the original code provided to me. Here is the code that I need in here somewhere;
<a href="slide/babies/[+title+]/FIRST IMAGE"><img src="/slide/babies/[+title+]/thumb.jpg" alt="[+title+] Thumbnail" /></a>
Well I guess there was one more step than I thought, isolating the first image - since thumb.jpg is actually a thumbnail and the other images are not thumbnail size. This is to simplify things, making one thumbnail instead of a thumbnail for every image. If someone wanted to go crazy and inline direct resize in here that would be really awesome, but I’m dreaming.
This is a simple but useful snippet. I hope we can get this finished so others may use it.
Thanks!