I've updated
the Script and fix the Bug, which merge all gallerys in one page (if the slide function is used), TAKE A LOOK TO THE FIRST POST!
@sustia
I've take a short look on that highslide thing. I must say, I prefer the lightbox solution. this highslide has too much slides for me
and it is not really free to include (only for non-commercial use). anyway - that's my taste.
to include captions in highslide, it's a little bit tricky. but not impossible I think.
you need to give the enclosing <a> tag an ID and this ID will be expanded on the caption <div> by id="caption-for-ID"
here a bit code from scratch - it may not work, but maybe it show how it could work.
replace my function with that (or better compare, to understand what happen)
EDIT: This Codepart is only to use, if you want to use the Highslide script Not for lightbox!!
Code: Select all
function makelightbox($img,$thumb,$caption="",$pos="gallery_0") {
$img = base64_decode($img);
$thumb = stripslashes($thumb); // holds the pure orginal htmlcode for displaying the thumbimage
// $caption = convert_to_anything($caption); //maybe you need to check the caption for something illegal ;-)
//------------------------------
// you need a unique id for each piclink
// we generate a md5 hash of the $img - it should be unique
// if not, we add a random number ;-)
$myid = rand()."-".$img;
$id = "my_".md5($myid);
//------------------------------
//echo $id;
list($img, $width_height) = explode('?', $img);
$img = $GLOBALS["phpwcms"]["content_path"]."images/".$img; // this is the full picturepath
// we add the id to the link
$image ="<a href=\"".$img."\" id=\"".$id."\" title=\"".$caption."\" class=\"highslide\" onclick=\"return hs.expand(this)\">".$thumb."</a>";
//------------------------------
//and then we need to add the caption <div> after that
$image .="<div class=\"highslide-caption\" id=\"caption-for-".$id."\">".$caption."</div>";
//------------------------------
return $image;
}
using md5 to generate unique values is maybe stupid, but it was the fastest way, to extend the code without changing the whole replacement code and each image should be unique and to be shure, I've add a random number.
(any simple idea to make it better?)
I'm not shure, how much chars are allowed in ID Attribute, found nothing - so I think, this function should work for highslide.
greetings
marcus