Member
Member
snagt   2006-12-13, 15:39
#1

Is it somehow possible to include a piece of code somewhere that does:
`if albumname equals "illustration" or "photography" or "paintings", use album.php,

else if albumname equals (everything else) use album2.php`
?

That would be lovely - and save me from having to install zenphoto twice! (This is because I want the thumbnails on the illustration etc. pages to look very different than those on the other pages..)

Developer
Developer
trisweb   2006-12-13, 22:36
#2

If the changes aren't that drastic, you could even do that switch in album.php itself.

`if($_zp_current_album->getFolder() == "foldername") {

// Do special thumbnails

} else {

// Do regular thumbnails.

`

Otherwise, if you want to separate other things, hack your index.php (in the root zp directory) to look something like this around these lines

`...

if (in_context(ZP_IMAGE)) {

include("$themepath/$theme/image.php");

} else if (in_context(ZP_ALBUM) && $_zp_current_album->getFolder() == "specialfolder") {

include("$themepath/$theme/albumspecial.php");

} else if (in_context(ZP_ALBUM)) {

include("$themepath/$theme/album.php");

} else if...

`

The one with the folder check has to come before the one without.

Good luck!

Unregistered
Unregistered
Guest   2007-03-20, 13:11
#3

Could this work with sub-albums, using getParent?

Developer
Developer
trisweb   2007-03-20, 21:57
#4

Absolutely.

Unregistered
Unregistered
Guest   2007-03-21, 11:13
#5

Great! But...

If you have the following directory structure...

  • albums

collections
** aw05
aw06
ss05
ss06
*** etc.

press
** elle-02.2007
vice-06.2006
*** etc.

--

... and if you wanted to use, eg. a custom image-press.php template for anything in the press directory, you'd need to do a check for every possible parent (elle, vice, etc.).

Or is there a function to check the 'root' parent?

Thanks

Developer
Developer
trisweb   2007-03-21, 19:58
#6

getAlbumArray($album->name) will give you an in-order array of the album path, just check the first element.

Alternatively you can just search for the folder name in the path;
if (strpos($album->name, "myalbumname/") !== false)
Either way will work.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.