[siriux] lightbox.js Customization
treqx
Joined: 2006-02-13
Posts: 2 |
Posted: Mon, 2006-02-13 21:45 | |||||
Hello all, Lokesh Dhakar developed a brilliant script that allows displaying an image as an overlay to the existing page, see LightBox JS on his website. I have attempted to integrate it in the Siriux (1.0.2) theme. Please keep in mind that I am not a PHP developer so this customization will not be up to the standards which Gallery adheres to, for example, you should use the local directory. But, as a proof of concept, it will certainly give you a starting point if you want to do this for your own Gallery. Here are the steps I took (I will use the patch syntax to illustrate code changes): 1) Download the 5 files from the download section of the page linked above 38,39c38,39 < var loadingImage = 'loading.gif'; < var closeButton = 'close.gif'; --- > var loadingImage = 'http://localhost/gallery2/themes/siriux/images/loading.gif'; > var closeButton = 'http://localhost/gallery2/themes/siriux/images/close.gif'; 284c284 < --- > 5) Modify the lightbox.css (#lightboxDetail) to align the caption to the left. This is a minor cosmetic change to make sure that the caption and the View Photo URL are left-aligned on the overlay 9a10 > text-align: left; 6) Modify templates/theme.tpl (version 1.5) to include the lightbox stylesheet and script in the HEAD section 12c12 < --- > 19a20 > <link rel="stylesheet" type="text/css" href="{g->theme url="lightbox.css"}"/> 28a30,32 > > <script type="text/javascript" src="{g->theme url="lightbox.js"}"></script> > 7) Modify theme.inc (version 1.5) to load the resized images IDs in the ShowAlbumPage function so that they are available to album.tpl 103a104,111 > > /* Lightbox customization - Fetch resize IDs */ > foreach ($childIds as $childId){ > list ($ret, $resizeTable) = GalleryCoreApi::fetchResizesByItemIds(array($childId)); > if (isset($resizeTable[$childId][0])) { > $theme['resizeId'][$childId] = $resizeTable[$childId][0]->getId(); > } > } 8) Modify templates/album.tpl (version 1.5) to change the thumbnail URL to point the resized picture and use Lightbox to overlay it. (Replace the line right underneath <div class="gallery-thumb">) Lightbox will show whatever you pass in title as a caption to the overlay. Mine looks a bit complicated because I wanted to add a link to the normal photo view. 59c59 < <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}"> --- > <a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.resizeId[$child.id]`"}" title='{$child.title|markup}<br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">View Photo Page</a>' rel="lightbox"> And that's it! I also use the SquareThumbs module, set the thumbnail size to 100 and set 20 items per page. I have attached two screenshots (sorry, I do not have a demo site available) 1) Album page before clicking on thumbnail Cheers,
|
||||||
Posts: 48
what is the "patch syntax" for code changes you speak of? I'm having a hard time interpreting your edits. Can you explain?
Posts: 1
Hi !
Its not working for me...
in the album overview the loading .gif appears but nothing happen...
sure because there gallery should load a page...not a picture !
Could you attach your zipped siriux folder ?
Or post more information...where the excatly youve modified the files ?
THX
X_Burner
Posts: 2
Hi,
The patch syntax is based on the UNIX patch command, in hindsight, probably not the best way to post the changes...
Please find attached a zip file containing my Siriux theme directory, backup your existing siriux theme first as this one does use the siriux directory.
Cheers
Posts: 118
Is there a way to make this working without JavaScript "transparently"?
* If JavaScript is available => display photo with LightBox
* If JavaScript is *not* available => display photo page like before the patch
Posts: 107
Ah, nice. Maybe you'd consider updating it for the newer G2 version (right now it's not compatible) and rename it so it can co-exist with Siriux?
I'd also recommend LightBox 2.0.2, which is the latest and even 2.0.2+ which is modification that can handle more gracefully:
http://www.huddletogether.com/2006/03/29/lightbox-v20/#comment-2424
http://baZzz.com/lightbox/lightbox2.02+.zip
Eduo
---
www.eduo.info
www.eduo.info/gallery/
www.hamsterspit.com
Posts: 4
I'm sorry to dig up an old post, but I'd like to implement this on my gallery. The problem is that both lightbox.js and gallery have both changed and I have no clue how to do this. I tried my best to adapt the instructions to the new version of lightbox and theme, but It just doesn't work. It would be greatly appreciated if someone could modify the theme and include the new version of lightbox or at least tell me what I need to do. Thanks.
Posts: 3
i too would love to see how to do this. I'm in love with lightbox ever since i found it a few days ago and would absolutly love to get it
Posts: 26
hi,
I was just browsing around the site to try to figure out how I would build a theme incorporating the light box script. It looks like u may have beaten me to it though! Although admittedly I haven't looked at ur method in enough detail to figure out if it is exactly what i want though.
My idea is to have a one webpage a bit like a splash screen that when clicked on came up with not a slide show as such but this white box. Basicly it would collaberate all images from say an album.
--
Website: http://me.sllewellyn.com
Gallery: http://www.something-beautiful.org/mygallery
Posts: 25
I'm still trying to intergrate LIghtbox into Siriux 1.1. Has anyon ebeen sucessful doing this? and if so could you play upload your siriux folder or the modified files? I've wrestled for this for about 6 hours, and I still can no tget it to work.
Posts: 48
Bucky, are you using WordPress? The new version of the Lightbox plugin attempts to wrap G2 images but fails. Closer, anyway.
Posts: 25
Its just a stand alone gallery, I really like h0bbel's design he used on his site, http://www.opticalpork.com
I haven't found his theme avaiable, so I read through the thread (http://gallery.menalto.com/node/50101) and tried everythign I could, and still it doesn't work.
The most sucessful thing I did was put on h0bbels theme.tpl and albulm.tpl in my local folder, and when you click the image it acts as if it's going to work, but you just get the continious loading image. My current status is here: http://www.enternetcoders.com/jstafford/main.php
Let me know if you have any ideas, if you'd liek I'm available on aolim as ibuckstah and I also have other messengers too.
Thanks.
Posts: 48
Weird, that's the exact same symptoms on Gallery images I'm seeing with the latest WordPress Lightbox plugin. Hmm, gotta be a solution, but I know way less about Gallery theming and plugins than WordPress.
Posts: 25
Thats not what I wanted to here, lol. I wish I could figure it out, it's been bugging me ton's. I'm really trying this out on this gallery, and it's going to be my personal gallery, and if I can get it all working, I have a website that could very much benifit from this also. Man oh man, nothing is ever easy, lol.
Posts: 48
I take it you've contacted h0bbel about his implementation? Any help there?
Posts: 25
I messaged him last night, don't know how often he checks his messages or such though, I might post on his thread, which is what I inteaded to do, but I was in the wrong tab :\.
Thanks.
Posts: 107
I guess it all depends on what kind of integration you want:
http://www.eduo.info/2006/04/04/los-15-mejores-paisajes-urbanos/
I decided I didn't want the integration in Gallery itself, although it'd be nice. What I really wanted was integration of lightbox in wordpress for the images I included from G2.
Plugins:
Wordpress:
- WPG2: http://www.blogyourphotos.com/
- Lightbox2: http://www.4mj.it/lightbox
Gallery2:
- DirectImage
So now I include the images from WPG2's interface, change the /v/ with /i/ in the URLs and add the 'rel="lightbox"' bits. I'd want a Lightbox Siriux theme but, to be true, I have no use for anything in any themes until embedded galleries can call their own themes, independently from the theme being used in the album itself.
Eduo
---
www.eduo.info
www.eduo.info/gallery/
www.hamsterspit.com
Posts: 2
Hi!
Anybody have a working siriux_lightbox theme?
I tried genzil's version with fix (theme.inc 104. line), but i have same problem like ingoman.
I got empty resizedId
example: http://goro.obiserver.hu/gallery/
Posts: 68
For others stumbling across this discussion, I recently added a Lightbox JS integration tutorial for Gallery 2.1.2 to this forum. http://gallery.menalto.com/node/55329 . Maybe it will help you!
-Sara
Posts: 1
People opine that the college essay writing supposes the really time consuming process. However, people rely on the <a href="http://quality-papers.com">essay writing</a> service assistance every time when that is demanded.