Get a array list of subalbums

GetAlbums()does not list sub-albums in the gallery. I have been searching on a way to do it without querying the database directly.
I tried a for loop GetAlbums($i) and GetAlbum($i) with seems logical did not work
Any help will be appreciated.

Comments

  • acrylian Administrator, Developer
    You have to use getAlbums() on an album object to get it's direct sub albums. So for all levels you need to do this recursively.
  • ok bet.
  • There is an admin function--`genAlbumList()` that will give you a list of all the albums a user has the right to upload to. (actually, you can specify the rights you desire, the default is upload)
  • I like that better ... no need to load folders that a user can see anyway..but it does not work ...\
    \
    Fatal error: Call to undefined method Gallery::genAlbumList() in /public_html/clients.philbertphotography.com/themes/copy_of_default/image.php on line 88
  • acrylian Administrator, Developer
    It is an admin function so you would have to load the admin functions file. Admin functions are of course not available on the front end.
  • And it is not an object method, so you just call the function.
  • Ok got you .. thanks for your help ... I removed all the legacy and Mysql codes.
  • vincent3569 Member, Translator
    hi

    I wish to improve google map plugin : I wish to display all pictures (with geo data, of course) of the gallery on a map, with a link from gallery page for example.

    do you think the function `genAlbumList()` may help me to do that ?
  • acrylian Administrator, Developer
    Yes, as you need the album objects to get the images. Do you really want to do that? If you have a lot of images this could possibly slow down the site quite a bit.
  • do not forget that this is currently an ADMIN function, so you will have to load those on the front end.
Sign In or Register to comment.