Siriux Modification request (Cool Stuff!)
lqd
Joined: 2006-06-05
Posts: 7 |
Posted: Tue, 2006-06-06 00:08 |
Dear reader, I am very interested in running a gallery2 with Lightbox script on it, since I utilize the gallery in a small site, the pictures break my layout. For those who do not know Lightbox, this gallery2 uses it: You can download the script here: Tried to apply the intructions here: http://gallery.menalto.com/node/44443 to my theme, but that lead to disaster unfortunatly. Is there anyone out there able to make this work on the Siriux theme on a 2.1.1a Version Gallery2? and willing to share the theme in a zip file? That would be really great! I am sure lots of people would love to have this as well! If you require I am willing to make a small donation to the creator of this zip file. Thank you in advance, Lqd. |
|
Posts: 13451
Well, integrating Lightbox into Gallery 2 isn't that hard, and in fact http://opticalpork.com is my site. I'll see if I can post something like a howto later on tonight.
The opticalpork.com site is not finished by a long shot, and hasn't even been officially "released" yet.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 7
That would be awesome, I already tried to email you at info [at] optical... but it came back to me. I love the minimalization you applied to that gallery! If you like you can contact me on msn messenger: "msn [at] hard [dot] fm"
Any thanks already! :D
Posts: 13451
I don't have email set up on that domain yet, no wonder it bounced. I'll try to throw something together tonight though.
I do wonder though, where did you find it?
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 7
I found it on a site which listed lightbox as a download and it pointed to your gallery.
Posts: 13451
I would love to see a link to that.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 7
Hmm...
http://codex.gallery2.org/index.php/Gallery2:Theme_Ideas
There it was, didn't realize it was this site... stupid me...
Posts: 13451
Ah, I knew about that link.
Anyway, I'll try to recapture what I have done to integrate Lightbox v2.0 into my modified Siriux theme.
First of all, you need to add the Lightbox javascript files to your theme. I did that by adding a folder called js inside my themes directory, and placing the files there.
Then I made the additions needed to my templates/theme.tpl file to make sure that the files are included in the browser when the pages are viewed:
Make sure the code is added somewhere after the <head> tag, but before the </head> tag in the template.
I added the code to have lightbox used on the albums page in my templates/albums.tpl file
And basically thats it. You may want to tweak that a bit, and come up with different solutions than I have, but to sum it up all you need to do is to make sure the lightbox javascript is called, and that the image you want "lightboxed" has the rel="lightbox" tag in the url.
The reason I use lightbox[photos], in the code above is that this is how lightbox groups images that should be grouped together. ( http://www.huddletogether.com/projects/lightbox2/#example )
Also make sure you edit lightbox.css and update the paths to wherever you place the image files include in the lightbox download.
I hope that makes some sense. I didn't include line numbers and such above, because my modified siriux theme will not have the same line numbers as your stock one, and I might even have removed large chunks of the original code and that would render linenumbers useless. I'm pretty sure you can manage to figure out how the pieces fit together though.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 7
Thank you very much will start working on it now, I will let you know the results!
----runs off happy as a child!
Thank you!
Posts: 13451
Let me know as soon as you have something to show! ;-)
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 7
It's been a couple hours now, I can't get this too work..
Posts: 7
not going to work.. i'll wait untill you finish your theme... this is driving me nuts..
thanks for the tips anyway...
Posts: 3
I keep trying to get the lightbox to work as well, but no luck
I get to the point where it tries to pull the image up, but the photo is not being displayed. Its as if it cannot find the photo or something.
Anyway we can pursuade you to post the theme that you have done so far hehe
I want lightbox SOOOOOO bad and I cant seam to get it working
Posts: 13451
If I get the time, I'll post a more complete howto on the codex sometime soon.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 9
I got everything showing up in the source properly (all the things lightbox nees to run) but for some reason, lightbox isnt loading when I click a pic.
Posts: 12
For those Lightbox/Gallery gods out there:
I use Lightbox and it works pretty well, even grouping the images works great (rel="lightbox[{$theme.item.title|markup}]").
But then I have an album with multiple pages, showing 9 pics on one page, 24 pics all over. How would I do the navigation in Lightbox over the page boundaries? I mean, after 9 pics, the navigation would not show the next picture (pretty clear, because only 9 are shown at the moment in gallery).
And it would be handy just to click 24 images in the Lightbox overlay through, not just 9, go back to your album, change the page and click on a new image.
Is there a chance to tweak Lighbox and/or Gallery to do something like this?
Thanks!
-----
will open a new topic for this here: http://gallery.menalto.com/node/50776
Posts: 9
OKay
No clue whats wrong
i uploaded the lightbox files into themes/siriux/
so that its like
themes/siriux/js
themes/siriux/css
themes/siriux/images
etc.
and this is the code in my album.tpl file that calls lightbox
and this is in the head in my theme.tpl file
when i view my gallery, and then check the source code, everything that i added so that lightbox would run is in there but it doesnt work
Posts: 13451
igeoffi, got an URL? Looks to be ok what you have done though.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 9
http://thegallery.dbhsusb.org
Posts: 13451
Move your javascript protoype include, so it's included before the lightbox javascript.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 17
I've been watching this topic with interest for a few weeks now and today decided to have a go myself.
While I wasn't able to get it working I can see what's happening to stop it working.
Assuming that each of you has the javascript in the right place and everything else is correct, I can guess that each of you is having a problem with the following bit of code:
arg2="itemId=`$theme.resizeId[$child.id]`"
On my system there is no such variable as $theme.resizeId[$child.id] in the default Siriux theme.
I've searched around the forums and found several snippits of code that look like they might set it or similar variables, but each time without success.
So far the best bit of code I've come across is:
added just above the return in the showAlbumPage function, theme.inc file. While this should work it doesn't and I can't see why.
You need this bit to work so that the proper url is generated which lightbox can use.
Perhaps hObbel could share his bit of code with us that he has that sets the variable?
Posts: 13451
http://opticalpork.com/themes/opticalpork/templates/theme.tpl
Thats all of it. Note that this is very unstructured and not "release ready". Hope it helps.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 9
Compared my theme.tpl and yours, only paths to lightbox are diff...
can you please post your album.tpl file, i want to compare that too
thanks
Posts: 13451
The album.tpl is right there as well, check http://opticalpork.com/themes/opticalpork/templates/album.tpl
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 3
I've been following this thread as well, and I must admit it's a little disheartening to see people having so much trouble getting this to work. Still, I think I'll have to try it myself this weekend. HObbel is an inspiration (love the minimalist design too).
I wanted to point out an alternative to Lightbox called Thickbox. It has a few advantages, including a smaller file size and the ability to smoothly scale images to the size of the browser window if they are oversize. I don't know if you can get it to display all the cool metadata like you have Lightbox doing, but it's probably possible since it can also popup full HTML pages instead of images.
I'm not associated with it, I've just been researching Lightbox and its derivatives for awhile, and thought it might be useful here. So many fun options... I look forward to integrating one into gallery.
Posts: 13451
I've looked at Thickbox too, which I might very well change my site over to run it instead. It might actually help me get rid of item pages which I really don't want on that site. It should be very minimalistic, nearly a photoblog type site.
I just need to find the time to finish this thing properly and release it as a theme.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 17
It helped in as far as it confirms that I'm not doing any thing wrong as per say, I had a look at your other files (album.tpl and theme.inc) and they are also the same as mine.
I just don't get it, it looks like $theme.resizeId[$child.id] is not being set. Each of the lines in the resulting html looks like this (I've removed the extra info until I get the basics working):
<a href="/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=" rel="lightbox[photos]">
If I copy a resize url properly and past that in it works so I know it's not a problem with lightbox but with Gallery. At the url below you can see that example working at the bottom of the page.
Url: http://www.tuxx.org.uk/gallery2/v/n_hw_scotland/
Gallvery version: 2.1.1
Web server: apache-1.3.27-9.legacy
PHP version: 4.1.2
Posts: 13451
I don't know why that doesn't work for you, I run Gallery version = 2.2-cvs core 1.1.2
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 17
So how can I trace $theme.resizeId[$child.id] through the system?
I had turned debug on and that didn't help at all, or at least I couldn't find what I wanted to see. Ideally I want to print out each of the variables as I get them back from the API. Then I can see what is actually happening and at what stage it's losing the data.
In otherword how do I debug the foreach loop in theme.inc?
Posts: 3
Cool. I would think the auto-scalling feature of Thickbox would be pretty handy too for the megapixel happy types. Also funny you mention photoblog, because I'm building a moblog at the moment using Wordpress and some plugins. It would be great to find a way to integrate your theme and Gallery somehow. Anyway, good luck finishing it.
By the way, you might like this "More Cowbell" tee shirt. I get so many comments when I wear mine.
Posts: 13451
Luxo: You are aware of http://gallery.menalto.com/node/128 - right?
Genzil: I'm not really good at all this smarty stuff, I just managed to hack this together somehow.
h0bbel - Gallery Team
If you found my help useful, please consider donating to Gallery
http://h0bbel.p0ggel.org
Posts: 17
I've gone to the trouble of setting up a complete fresh gallery on an interal server, with the same results.
I downloaded a cvs copy and used that (some nice new features, love them).
Even gone as far as to grab copies of your album.tpl and theme.inc and do a diff on them. No changes that would have an effect.
Stumped.
It all hinges on getting the resize id into the html, then it will work.
I hear what you are saying h0bbel, it's just bugging me that I am so close and just can't get this final bit working.
Posts: 808
I'm doing this too and I got a bit farther then you did genzil. Here is what I used.
This way if it's an album it doesn't apply the lightbox. I'm using my own theme (greypop) and not sirux though so it might be different for you.
I'm not sure what the $theme.resizeId[$child.id] is suppost to do for you though.
I also have a way for it to get all the picures in the album but it only works right on the first page. Once I get all the bugs worked out I'll share it.
Posts: 808
genzil when you have debug mode are you looking at the pop up window or all the stuff below the page. The popup window has all the values of the variables that smarty can use.
Posts: 17
I can get that and have been able to from the start, that's what demonstrates that the javascript works.
Most of my pictures are bigger than the screen is. If I use the full/original size I can't see the whole picture, so I have to use the resized imaged. The resizeId is the id of the resized picture to 640x640 which is a size which fits on most screens.
Ah, in which case the values are not being set as far as I can see.
Posts: 17
The easy bit is hidding them on page, which you can do with a <div style="display:none">. They still get used by lightbox and the next/previous link.
The hard bit of this is to work out which images to display for that page, and which to hide. I might have a play when I've got my bit working.
Posts: 808
OK here is how I did this. I'm not sure if this is the best way or not, but....
Create a file in modules/core/templates/blocks/local/PeerList.tpl
and paste this in
Then at the top of album.tpl paste this in.
Then paste this part in replacing the link in two places
Then at the end of that file paste this.
Then in theme.tpl at this right before the </head>
Change the paths in lightbox.css and lightbox.js and I think that's it. I think this pulls the sized image but I'm not sure. I know when the browser is smaller than the picture it swrinks it down and gives you a link at the bottom to see the full size picture. The size of picture that I upload is close to the resized version.
Also I read that Google doesn't like hidden text so in this example I used links that didn't have anything in them so the links aren't hidden but you don't see anything. Also if you go to page 2 and click it still keeps them in the same order.
Here's an example http://www.lvthunder.com/gallery2/v/UtahWin05
Posts: 17
lvthunder, I've not had a look in detail but I suspect that yours works because your images aren't that big. Just big enough to fit on the screen.
Mine are much bigger so I need to use the resize image.
But it's a nice idea to use the empty links.
Posts: 808
Try this. Maybe it will give you the resized image.
Posts: 17
Unfortunatly not.
Posts: 9
okay...
gonna give lvthunder's version a try
maybe its cuz of the resize thing in the code that screws up lightbox
Posts: 2
Hi,
i just want to setup the lightbox thing with my siriux theme but don't understand what you mean with:
Should i insert the code snipet 2 times in the album.tpl? If so, where?
Greetz Daniel
Posts: 12
tried it. seemed easy enough, but:
Does anyone know what that is? Must be in album.tpl...
Posts: 808
dabs you should replace this line
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
Blackrider you need to give us more of the error message. I bet you have a typo in there somewhere or an if statement that doesn't close, but I can't tell more until I see more of the message.
Posts: 12
lvthunder, you're right. Turned on debug now and got this:
If that's of help. Also, I think it's here
of the assign block at the top of album.tpl
I commented the line and it showed no error. Also I had some values insteads of $theme.params.columns and $theme.params.rows and it worked.
Somehow it can't read $theme.params.columns (and .rows)
The resized pics would be great as well...
Posts: 808
In the smarty window that poped up in debug mode do you see $theme.params.columns and $theme.params.rows in the list. What theme are you trying to do this with? The other thing you can do is manually put those numbers in instead of the variables if you don't plan on changing it.
Posts: 2
I got the same errors:
Posts: 12
my theme is a siriux clone, and I think that the $theme.params.columns and $theme.params.rows are not set.
dabs, I think it's the same with your theme.
lvthunder, you calculate the number of images with that formula, right? What about reading the children of the album, then? Something like $theme.parents.childCount or so (it didn't work for me, but I'm not using the correct variables - I'm just a gallery newbie )
At the PeerList.tpl you do the transition from one album page to the other, correct?
genzil: use this
instead of this
in your link to get the resized images, but you have to change the code in PeerList.tpl as well.
It worked at least for me.
Posts: 808
I calculate the number of images on the screen with that fomula. Matrix and all the matrix clones have user defined rows and columns. Since it appears Siriux doesn't have that just take the math equation out and at the top where it says
{assign var="total" value=0}
replace the 0 with how ever many thumbnails are on the page at a time.I'm still not sure about the resize id. If I have time I'll look into that this weekend.
Posts: 12
Genzil: Sorry for that resizeID suggestion. I should have read the thread.
lvthunder: Figured, that it's the number of thumbnails then. The fixed number is ok, if you're working with a fixed set a page. But the number of the thumbnails of the last page of the album is not necessarily the set number. Like I usually have a set of nine, but with 24 images you have on the last page only a set of six thumbs left. So you have to calculate the value to get it all right.
The thing with resizedID. It makes me wonder, where it comes from... Is it likely that it's not available in PeerList.tpl, but in album.tpl?
Posts: 12
All of you: Have a look at this http://gallery.menalto.com/node/47353 Does that help?