2012 (main folder) flowers (sub folder unpublished) birds insects ----------------------- Now GetAlbums will list 2012 and flowers but anything under flowers will NOT show up..
YEP solved ... false alarm. My main function with "getAlbums()" call my subalbums function I just missed that I needed to do getAlbums( null, null, null, null, true ) also so it can find all unpublished "NESTED" subfolders never had that situation before.
Comments
The last one.
$albums = $gallery->getAlbums( null, null, null, null, true );
Will not work if an unpublished album is under another unpublished album
---------------------
2012 (main folder)
flowers (sub folder unpublished)
birds
insects
-----------------------
Now GetAlbums will list 2012 and flowers but anything under flowers will NOT show up..
Even with care listed as TRUE.
`
function getSubAlbums( $gallery, $album )
{
$list = array();
$albumObj = new Album( $gallery, $album );
$albumID = $albumObj->getID();
$parentID = getItemByID( "albums", $albumID );
if ( $albumObj->isDynamic() || !$albumID )
return $list;
$subalbums = $albumObj->getAlbums();
$subalbums = $parentID->getAlbums();
if ( is_array( $subalbums ) ) {
foreach ( $subalbums as $subalbum ) {
$list[] = $subalbum;
$list = array_merge( $list, getSubAlbums( $gallery, $subalbum ) );
} //$subalbums as $subalbum
} //is_array($subalbums)
return $list;
}
`
`
function getSubAlbums( $gallery, $album )
{
$list = array();
$albumObj = new Album( $gallery, $album );
$albumID = $albumObj->getID();
$parentID = getItemByID( "albums", $albumID );
if ( $albumObj->isDynamic() || !$albumID )
return $list;
$subalbums = $albumObj->getAlbums( null, null, null, null, true );
$subalbums = $parentID->getAlbums( null, null, null, null, true );
if ( is_array( $subalbums ) ) {
foreach ( $subalbums as $subalbum ) {
$list[] = $subalbum;
$list = array_merge( $list, getSubAlbums( $gallery, $subalbum ) );
} //$subalbums as $subalbum
} //is_array($subalbums)
return $list;
}
`