Jump to content


etoGal & Lightbox JS 2.0


  • You cannot reply to this topic
2 replies to this topic

#1 Psycho Mantis

    Etomite Forum Fan

  • Member
  • Pip
  • 113 posts

Posted 25 January 2007 - 09:22 PM

Hi all.

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']."&amp;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'>&raquo; 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.


#2 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 26 January 2007 - 10:22 AM

Thanks Psycho!

Roughly equivalent functionality using Thickbox rather than Lightbox is provided in EtoGalThumbs12preliminary, available in the files thread (and documented in the documentation section). (I used thickbox for this rather than lightbox as I found Thickbox works better for me, but this may be a result of deficiencies in the graphics driver of my antiquated (2003) PC.)

EtogalThumbs allows much greater control over which images are shown than etogal

#3 Maarten

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 01 May 2009 - 02:29 PM

Like this one!

I've implemented it with the current Lightbox JS v2.04

In adition to above steps, you need to ad in the <HEAD> part of your template:
<script src="http://yourwebsite/js/builder.js" type="text/javascript"></script>

Edited by Maarten, 01 May 2009 - 02:30 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users