"LIGHTBOX" doesn't use 'onclick'.. are you using the 'real deal' or something similar?
http://www.huddletogether.com/projects/lightbox2/
here's a UDT i call simply: i
Code: Select all
# i, a udt for cmsms 1.2 (v3)
# functionality similar to built-in image tag
# see comments for parameters
# by kermit 27 nov 2007;
# released under general public license v2
global $gCms;
if(isset($params['src'])) $imageSource = $params['src']; // image filename and path relative to uploads/images (no initial / if in a subdirectory)
if(isset($params['width'])) $imageWidth = $params['width']; // override actual image width
if(isset($params['height'])) $imageHeight = $params['height']; // override actual image height
if(isset($params['alt'])) $imageAlt = $params['alt']; // alt attribute for img tag, defaults to filename, use 'emptyalt' to leave empty or 'noalt' to omit from output
if(isset($params['class'])) $imageClass = $params['class']; // css class for img tag
if(isset($params['id'])) $imageId = $params['id']; // css id for img tag
if(isset($params['title'])) $imageTitle = $params['title']; // title attribute for img tag,
if(isset($params['link'])) $imageLink = $params['link']; // set to '1' to generate a link, defaults to same file. not required if either lightbox, linkstrip or linkpic is set
if(isset($params['lightbox'])) $linkLightbox = $params['lightbox']; // set to '1' to enable lightbox on link, set to 'galleryname' to enable gallery mode; requires lightbox scripts-css in page meta or template head. see http://www.huddletogether.com/projects/lightbox2/ for instructions and files; implies link should be made (no need to set link='1')
if(isset($params['linktitle'])) $linkTitle = $params['linktitle']; // title attribute for link
if(isset($params['linkclass'])) $linkClass = $params['linkclass']; // css class for link
if(isset($params['linkid'])) $linkId = $params['linkid']; // css id for link
if(isset($params['linktarget'])) $linkTarget = $params['linktarget']; // target attribute for link
if(isset($params['linkstrip'])) $linkStrip = $params['linkstrip']; // strip ALL instances of this string from src for link href (linkstrip='_thumb' will link to 'picture.jpg' if src='picture_thumb.jpg'); implies a link should be made (no need to set link='1')
if(isset($params['linkpic'])) $linkPic = $params['linkpic']; // link to this image; overrides linkstrip and implies a link should be made (no need to link='1')
$imagetag = '';
$linktag = '';
$output = '';
$imageBaseurl = $gCms->config['image_uploads_url'] . '/';
$imageBasepath = $gCms->config['image_uploads_path'] . '/';
if (empty($imageSource)) return '<!-- image tag error: src not defined -->';
$size = @getimagesize($imageBasepath . $imageSource);
if ($size === false) return '<!-- image tag error: src not found -->';
if(!isset($imageWidth) && $size[0]) $imageWidth = $size[0];
if(!isset($imageHeight) && $size[1]) $imageHeight = $size[1];
if(!isset($imageAlt)) $imageAlt = 'Image: ' . $imageSource;
$imagetag = '<img';
if(isset($imageTitle)) $imagetag .= ' title="' . $imageTitle . '"';
if($imageAlt != 'noalt')
{
if($imageAlt == 'emptyalt') $imageAlt = '';
$imagetag .= ' alt="' . $imageAlt . '"';
}
if(isset($imageWidth)) $imagetag .= ' width="' . $imageWidth . '"';
if(isset($imageHeight)) $imagetag .= ' height="' . $imageHeight . '"';
if(isset($imageClass)) $imagetag .= ' class="' . $imageClass . '"';
if(isset($imageId)) $imagetag .= ' id="' . $imageId . '"';
$imagetag .= ' src="' . $imageBaseurl . $imageSource . '"';
$imagetag .= ' />';
if (!isset($imageLink) && !isset($imageLightbox) && !isset($linkPic) && !isset($linkStrip)) return $imagetag;
$linktag = '<a';
if(isset($linkTitle)) $linktag .= ' title="' . $linkTitle . '"';
if(isset($linkClass)) $linktag .= ' class="' . $linkClass . '"';
if(isset($linkId)) $linktag .= ' id="' . $linkId . '"';
if(isset($linkTarget)) $linktag .= ' target"' . $linkTarget . '"';
if(isset($linkLightbox))
{
$linktag .= ' rel="lightbox';
if($linkLightbox != '1') $linktag .= '[' . $linkLightbox . ']';
$linktag .= '"';
}
$linktag .= ' href="' . $imageBaseurl;
if(isset($linkPic))
{
$linktag .= $linkPic;
}elseif (isset($linkStrip))
{
$linktag .= str_replace($linkStrip,'',$imageSource);
}else{
$linktag .= $imageSource;
}
$linktag .= '">';
$output = $linktag . $imagetag . '</a>';
return $output;
it's basically a rewritten {image} tag, with a few enhancements... a couple examples:
{i src='mylittlepicture.jpg' linkpic='mybigpicture.jpg' lightbox='1'}
basic syntax to show 'mylittlepicture.jpg and create a lightbox enabled link to 'mybigpicture.jpg'
{i src='picture_thumb.jpg' linkstrip='_thumb' lightbox='1'}
is the basic syntax required to show picture_thumb.jpg, and create a lightbox-enabled link to picture.jpg
if you omit linkstrip and linkpic then the link will be to the src image (with link='1')
{i src='mypic.jpg'}
is the bare minimum to display an image.
note: this isn't thoroughly tested.. but it 'works for me'.
edit: slightly modified from initial posting...
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info