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:
http://www.opticalpork.com

You can download the script here:
http://baZzz.com/lightbox/lightbox2.02+.zip

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.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2006-06-06 17:02

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

 
lqd

Joined: 2006-06-05
Posts: 7
Posted: Tue, 2006-06-06 17:51

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

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2006-06-06 18:20

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

 
lqd

Joined: 2006-06-05
Posts: 7
Posted: Tue, 2006-06-06 18:31

I found it on a site which listed lightbox as a download and it pointed to your gallery.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2006-06-06 18:43

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

 
lqd

Joined: 2006-06-05
Posts: 7
Posted: Tue, 2006-06-06 21:57

Hmm...

http://codex.gallery2.org/index.php/Gallery2:Theme_Ideas

There it was, didn't realize it was this site... stupid me...

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-06-07 19:32

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:

 {* Add Lightbox javascript and CSS *}
    <link rel="stylesheet" type="text/css" href="{g->theme url="lightbox.css"}"/>
    <script type="text/javascript" src="{g->theme url="js/lightbox.js"}"></script>
    <script type="text/javascript" src="{g->theme url="js/scriptaculous.js?load=effects"}"></script>

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

<div class="gallery-thumb">
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.resizeId[$child.id]`"}" title='<h4>{$child.title|markup}</h4><br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">View Photo Page</a>' rel="lightbox[photos]">
{if isset($child.thumbnail)}
            {g->image item=$child image=$child.thumbnail}
          {else}
            {g->text text="no thumbnail"}
          {/if}
        </a>
      </div>

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

 
lqd

Joined: 2006-06-05
Posts: 7
Posted: Wed, 2006-06-07 19:38

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!

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-06-07 21:29

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

 
lqd

Joined: 2006-06-05
Posts: 7
Posted: Wed, 2006-06-07 21:53

It's been a couple hours now, I can't get this too work.. :(

 
lqd

Joined: 2006-06-05
Posts: 7
Posted: Sat, 2006-06-10 03:51

not going to work.. :( i'll wait untill you finish your theme... this is driving me nuts..

thanks for the tips anyway...

 
SharpDoggy

Joined: 2006-05-28
Posts: 3
Posted: Sun, 2006-06-11 00:56

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 :(

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Mon, 2006-06-12 21:27

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

 
igeoffi

Joined: 2006-02-18
Posts: 9
Posted: Mon, 2006-06-19 06:42

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.

 
Blackrider

Joined: 2006-06-19
Posts: 12
Posted: Fri, 2006-06-23 09:30

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

 
igeoffi

Joined: 2006-02-18
Posts: 9
Posted: Tue, 2006-06-20 18:08

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

<div class="gallery-thumb">
          <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}" rel="lightbox[photos]">
          {if isset($child.thumbnail)}
            {g->image item=$child image=$child.thumbnail}
          {else}
            {g->text text="no thumbnail"}
          {/if}
          </a>
        </div>

and this is in the head in my theme.tpl file

 {* Add Lightbox javascript and CSS *}
    <link rel="stylesheet" type="text/css" href="{g->theme url="lightbox.css"}"/>
    <script type="text/javascript" src="{g->theme url="js/lightbox.js"}"></script>
    <script type="text/javascript" src="{g->theme url="js/scriptaculous.js?load=effects"}"></script>
    <script type="text/javascript" src="{g->theme url="js/prototype.js"}"></script>

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 :(

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Tue, 2006-06-20 21:03

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

 
igeoffi

Joined: 2006-02-18
Posts: 9
Posted: Wed, 2006-06-21 03:42
 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-06-21 06:54

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

 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Wed, 2006-06-21 16:56

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:

        /* Add resizedId to child values */
        foreach ($childIds as $childId){
                list ($ret, $resizeTable) = GalleryCoreApi::fetchResizesByItemIds(array($childId));
                if (isset($resizeTable[$childId][0])) {
                        $theme['resizeId'][$childId] = $resizeTable[$childId][0]->getId();
                }
        }

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?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Wed, 2006-06-21 17:39

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

 
igeoffi

Joined: 2006-02-18
Posts: 9
Posted: Thu, 2006-06-22 04:33

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

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Thu, 2006-06-22 06:56

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

 
luxo

Joined: 2006-06-22
Posts: 3
Posted: Thu, 2006-06-22 07:46

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.

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Thu, 2006-06-22 08:08

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

 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Thu, 2006-06-22 12:21

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&amp;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

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Thu, 2006-06-22 16:11

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

 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Thu, 2006-06-22 18:52

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?

 
luxo

Joined: 2006-06-22
Posts: 3
Posted: Thu, 2006-06-22 20:21

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. :-)

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Thu, 2006-06-22 21:42

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

 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Thu, 2006-06-22 22:15

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.

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Thu, 2006-06-22 23:36

I'm doing this too and I got a bit farther then you did genzil. Here is what I used.

{if $child.canContainChildren}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
{else}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="lightbox[photos]">
{/if}

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.

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Thu, 2006-06-22 23:39

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.

 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Fri, 2006-06-23 10:10
Quote:
'm doing this too and I got a bit farther then you did genzil. Here is what I used.

{if $child.canContainChildren}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
{else}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="lightbox[photos]">
{/if}

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 can get that and have been able to from the start, that's what demonstrates that the javascript works.

Quote:
I'm not sure what the $theme.resizeId[$child.id] is suppost to do for you though.

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.

Quote:
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.

Ah, in which case the values are not being set as far as I can see.

 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Fri, 2006-06-23 13:22
Quote:
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!

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.

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Fri, 2006-06-23 15:45

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

{*
 * $Revision: 1.3 $
 * If you want to customize this file, do not edit it directly since future upgrades
 * may overwrite it.  Instead, copy it into a new directory called "local" and edit that
 * version.  Gallery will look for that file first and use it if it exists.
 *}
{g->callback type="core.LoadPeers" item=$item|default:$theme.children.0
	     windowSize=$windowSize|default:null}
{assign var="data" value=$block.core.LoadPeers}

{if !empty($data.peers)}
<div class="{$class}">
  {if !empty($last)}
  {foreach from=$data.peers item=peer}
    {assign var="title" value=$peer.title|default:$peer.pathComponent}
    {if ($peer.peerIndex > $last)}
      <a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$peer.id`"}" title='<h4>{$peer.title|markup}</h4><br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$peer.id`"}">View Photo Page</a><br>{g->block type=exif.ExifInfo item=`$peer`}'rel="lightbox[photos]">
	
      </a>
    {/if}
  {/foreach}
  {else}
    {foreach from=$data.peers item=peer}
    {assign var="title" value=$peer.title|default:$peer.pathComponent}
    {if ($peer.peerIndex < $first)}
      <a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$peer.id`"}" title='<h4>{$peer.title|markup}</h4><br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$peer.id`"}">View Photo Page</a><br>{g->block type=exif.ExifInfo item=`$peer`}'rel="lightbox[photos]">
	
      </a>
    {/if}
  {/foreach}
  {/if}
</div>
{/if}

Then at the top of album.tpl paste this in.

{assign var="total" value=0}
{assign var="first" value=0}
{assign var="last" value=0}
{math equation="x * y" x=$theme.params.columns y=$theme.params.rows assign=total}
{if ($theme.currentPage > 1)}
{math equation="(x - 1) * y + 1" x=$theme.currentPage y=$total assign=first}
{g->block type="core.PeerList" class="Peers" windowSize=$theme.childCount first=$first}
{/if}

Then paste this part in replacing the link in two places

{if $child.canContainChildren}
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
{else}
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" title='<h4>{$child.title|markup}</h4><br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">View Photo Page</a><br>{g->block type=exif.ExifInfo item=`$child`}' rel="lightbox[photos]">
{/if}

Then at the end of that file paste this.

{if ($theme.currentPage < $theme.totalPages)}
{math equation="x * y" x=$theme.currentPage y=$total assign=last}
{g->block type="core.PeerList" class="Peers" windowSize=$theme.childCount last=$last}
{/if}

Then in theme.tpl at this right before the </head>

{* Add prototype javascript library *}
<script type="text/javascript" src="{g->theme url="js/prototype.js"}"></script>
{* Add Lightbox javascript and CSS *}
<link rel="stylesheet" type="text/css" href="{g->theme url="lightbox.css"}"/>
<script type="text/javascript" src="{g->theme url="js/lightbox.js"}"></script>
<script type="text/javascript" src="{g->theme url="js/scriptaculous.js?load=effects"}"></script>

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

 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Fri, 2006-06-23 21:06

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.

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Fri, 2006-06-23 23:26

Try this. Maybe it will give you the resized image.

&g2_imageViewsIndex=0
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`" arg3="g2_imageViewsIndex=0"}" title='<h4>{$child.title|markup}</h4><br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">View Photo Page</a><br>{g->block type=exif.ExifInfo item=`$child`}' rel="lightbox[photos]">
 
genzil

Joined: 2003-07-26
Posts: 17
Posted: Sat, 2006-06-24 10:52

Unfortunatly not. :-(

 
igeoffi

Joined: 2006-02-18
Posts: 9
Posted: Mon, 2006-06-26 00:56

okay...
gonna give lvthunder's version a try
maybe its cuz of the resize thing in the code that screws up lightbox

 
dabs

Joined: 2006-06-26
Posts: 2
Posted: Mon, 2006-06-26 11:06

Hi,

i just want to setup the lightbox thing with my siriux theme but don't understand what you mean with:

Quote:
"Then paste this part in replacing the link in two places"

Should i insert the code snipet 2 times in the album.tpl? If so, where?

Greetz Daniel

 
Blackrider

Joined: 2006-06-19
Posts: 12
Posted: Mon, 2006-06-26 11:16

tried it. seemed easy enough, but:

Quote:
Security Violation

The action you attempted is not permitted.

Does anyone know what that is? Must be in album.tpl...

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Mon, 2006-06-26 13:46

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.

 
Blackrider

Joined: 2006-06-19
Posts: 12
Posted: Mon, 2006-06-26 14:42

lvthunder, you're right. Turned on debug now and got this:

Quote:
Error Detail -
Error (ERROR_BAD_PARAMETER) :

* in modules/core/classes/GallerySmarty.class at line 109 (GalleryCoreApi::error)
* in lib/smarty/plugins/function.math.php at line 53 (GallerySmarty::trigger_error)
* in /home/.dubhgall/dh_adm/e19.dreamhosters.com_gal_g2data/smarty/templates_c/%%371012490/%%79^798^7980FF64%%album.tpl.php at line 12
* in lib/smarty/Smarty.class.php at line 1861
* in modules/core/classes/GalleryTemplateAdapter.class at line 659 (Smarty::_smarty_include)
* in /home/.dubhgall/dh_adm/e19.dreamhosters.com_gal_g2data/smarty/templates_c/%%371012490/%%01^01C^01CF0319%%theme.tpl.php at line 119 (GalleryTemplateAdapter::theme)
* in lib/smarty/Smarty.class.php at line 1258
* in modules/core/classes/GallerySmarty.class at line 90 (Smarty::fetch)
* in modules/core/classes/GalleryTemplate.class at line 206 (GallerySmarty::fetch)
* in main.php at line 418 (GalleryTemplate::fetch)
* in main.php at line 87
* in main.php at line 80

If that's of help. Also, I think it's here

Quote:
{math equation="x * y" x=$theme.params.columns y=$theme.params.rows assign=total}

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...

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Mon, 2006-06-26 14:57

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.

 
dabs

Joined: 2006-06-26
Posts: 2
Posted: Tue, 2006-06-27 05:48

I got the same errors:

Security Violation

The action you attempted is not permitted.

Back to the Gallery
Error Detail -
Error (ERROR_BAD_PARAMETER) : Smarty error: math: parameter x is empty

    * in modules/core/classes/GallerySmarty.class at line 109 (gallerycoreapi::error)
    * in lib/smarty/plugins/function.math.php at line 53 (gallerysmarty::trigger_error)
    * in /mounted-storage/home19d/sub001/sc19888-SBYG/g2data/smarty/templates_c/%%2182596723/%%25^256^25661EA0%%album.tpl.php at line 6
    * in lib/smarty/Smarty.class.php at line 1861
    * in modules/core/classes/GalleryTemplateAdapter.class at line 659 (gallerysmarty::_smarty_include)
    * in /mounted-storage/home19d/sub001/sc19888-SBYG/g2data/smarty/templates_c/%%2182596723/%%5D^5D2^5D29E2DD%%theme.tpl.php at line 59 (gallerytemplateadapter::theme)
    * in lib/smarty/Smarty.class.php at line 1258
    * in modules/core/classes/GallerySmarty.class at line 90 (smarty::fetch)
    * in modules/core/classes/GalleryTemplate.class at line 206 (gallerysmarty::fetch)
    * in main.php at line 418 (gallerytemplate::fetch)
    * in main.php at line 87
    * in main.php at line 80

System Information
Gallery version 	2.1.1
PHP version 	4.4.2 apache
Webserver 	Servage.net Cluster (Enhanced Apache)
Database 	mysql 5.0.15-standard
Toolkits 	SquareThumb, NetPBM, Gd
Operating system 	Linux node4.c10 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT 2005 i686
Browser 	Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

:(

 
Blackrider

Joined: 2006-06-19
Posts: 12
Posted: Tue, 2006-06-27 07:10

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

Quote:
arg2="itemId=`$theme.resizeId[$child.id]`"

instead of this

Quote:
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}"

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.

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Tue, 2006-06-27 14:57

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.

 
Blackrider

Joined: 2006-06-19
Posts: 12
Posted: Tue, 2006-06-27 15:17

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?

 
Blackrider

Joined: 2006-06-19
Posts: 12
Posted: Tue, 2006-06-27 18:59

All of you: Have a look at this http://gallery.menalto.com/node/47353 Does that help?