Junior Member
Junior Member
billkerr   2011-09-27, 23:16
#1

Hi,

I would like to use PHP if else statements to show different elements on my page depending on the location within the album/subalbum structure.

My albums:

[list]
[*]Parent album

Sub-album

Album 1
[*]Album 2
[/list]

How can I check if I am in a parent album, a sub-album, or the album itself?

Thanks.

Member
Member
sbillard   2011-09-27, 23:18
#2

there is an object method for the parent: $obj->getParent(). This will return NULL for albums which are the parent.

Administrator
Administrator
acrylian   2011-09-28, 08:40
#3

And using the template function getParentAlbums() you can even count the array returned (null as well if there are no parents) to find out on what level you are.

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