Different thumbnail sizes for albums...

fooj
fooj's picture

Joined: 2008-10-26
Posts: 6
Posted: Sun, 2008-10-26 17:38

Hello folks.

I am new to Gallery and I am trying to tweak the SquareThumbs module. I have copied the SquareThumbs folder and did a bunch of search replace to create a new module that seems to be functioning. However, I am not sure how to implement some of the changes I want. They are:

1. Have one size thumbnail (highlite?) for albums and another for photos. (similar to http://frommel.net/gallery/ )

I have been able to change the code to generate the "long landscape" aspect ratio that I want but it applies it to everything.
There is some code in the squarethumbToolkit.class file that assigns values to $arg, so I have been trying to wrap this in an if statement to check if it is an album but I have not had any luck.

if ($child.canContainChildren) {
	$args = ($width > $height*5/2) ? array( 100*(1-(5*$height/2)/$width)/2, 0, 100*(5*$height/2)/$width, 100 ) : array( 0, 100*(1-((2*$width/5)/$height))/2, 100, 100*((2*$width/5)/$height) );
}
else{
	$args = ($width > $height) ? array( 100*(1-$height/$width)/2, 0, 100*$height/$width, 100 ) : array( 0, 100*(1-$width/$height)/2, 100, 100*$width/$height );
}

2. I would also like to move the inputs for specifying sizes from the "edit album" page to the "Site Admin" page for this new module.

So, any help with this would be greatly appreciated.

Thanks,

fooj

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2008-10-26 18:22

1. debug your code by using echo statements to trace execution paths, and things like "print_r($child)" to see what's happening.

2. That will likely need a lot of re-engineering. Edit Album pages are for settings specific to individual albums (and their children) whereas "Site Admin" pages are for site-wide settings. You need carefully to consider how you might want the size settings from a gallery-wide site-admin page to be applied on an album-by-album basis, then use those requirements to work out what code changes you need to make.

 
sciway

Joined: 2008-03-17
Posts: 16
Posted: Thu, 2009-01-29 16:32

Any updates on this ticket. I would Love to know how to have the album thumbnails be somehow distinguishable from the regular photos.

Thanks!

Cedric