I modified the etoGal snippet so that it works with the Lightbox JS 2.0 script (http://www.huddletog...ects/lightbox2/), which I really like.
It's just a small modification, but I thought I'd share it anyway.
I'm using etoGal 1.1 beta 3.
Download the Lightbox 2 javascript (see link).
Add to the <head> of your template file:
<link rel="stylesheet" href="http://www.yourdomain.com/yourcssdirectory/lightbox.css" type="text/css" media="screen" /> <script src="http://www.yourdomain.com/js/prototype.js" type="text/javascript"></script> <script src="http://www.yourdomain.com/js/scriptaculous.js?load=effects" type="text/javascript"></script> <script src="http://www.yourdomain.com/js/lightbox.js" type="text/javascript"></script>
Then edit the etoGal snippet accordingly.
Line 475: original code
$pics=$etomite->getIntTableRows("id,title,filename", $gtable, "gal_id='" . $pageinfo['id'] . "'",$order_by,$order_direction);
replace with$pics=$etomite->getIntTableRows("id,title,filename,descr", $gtable, "gal_id='" . $pageinfo['id'] . "'",$order_by,$order_direction);
Line 480: add below
$pictitle=eg_entities(stripslashes($pic['title']));
Line 486 (now 487): original code
$link= ( $display==embedded ? "<a href=\"" . $file . "\" target=_blank>" : "<a href=\"" . $phpself.$sep."pic=" . $pic['id'] . "\">" );replace with
$link= ( $display==embedded ? "<a href=\"" . $file . "\" target=_blank>" : "<a href='" . $file . "' rel='lightbox[".$pic['descr']."]' title='". $pictitle."'>" );
Line 489 (now 490): original code
$link="<a href='".$etomite->makeURL($picture_target,'',"?gal_id=".$pageinfo['id']."&pic=".$pic['id'] ) . "'>";replace with
$link="<a href=\"$tn_file\" rel='lightbox[".$strings['description']."]'>";
Line 490 (now 491): delete line
$pictitle=eg_entities(stripslashes($pic['title']));
Line 495: original code
$link . "<img src=\"$tn_file\" class=\"EGthumbnail\" title=\"" . $pictitle . $strings['click_to_zoom'] . "\" alt=\"" . $pictitle . $strings['click_to_zoom'] . "\" /></a>" . ($titles_in_overview=="yes" ? "<br />".$pictitle : "") . "replace with
$link . "<img src=\"$tn_file\" class=\"EGthumbnail\" title=\"" . $pictitle . " " . $strings['click_to_zoom'] . "\" alt=\"" . $pictitle . $strings['click_to_zoom'] . "\" /></a>" . ($titles_in_overview=="yes" ? "<br />".$pictitle : "") . "
Line 496: original code
</td>";replace with
</br>".$pictitle."</br><a href='".$file."' target='_blank'>» download file</a></td>";this line is optional if you want to provide a direct link to the picture
Enjoy!
Edited by Psycho Mantis, 26 January 2007 - 09:27 AM.










