Member
Member
elrol   12-01-2009, 06:04
#1

Just a question, but how would I effectively echo the commentson part of this array that shows in the data section of an album?

`
Array
(
[0] => Album Object
(
[name] => folder-name
[exists] => 1
[images] =>
[subalbums] =>
[parent] =>
[parentalbum] =>
[gallery] => Gallery Object
(
[albumdir] => /path/to/album
[albums] =>
[options] =>
[theme] => zen_theme
[themes] =>
)

        [searchengine] =>
        [comments] =>
        [commentcount] =>
        [index] =>
        [themeoverride] =>
        [data] => Array
            (
                [id] => 1
                [parentid] =>
                [folder] => folder-name
                [title] => Folder Name
                [desc] =>
                [date] => 0000-00-00 00:00:00
                [place] =>
                [show] => 1
                [closecomments] => 0
                [commentson] => 0 -- this is the one i want to get the value for?
                [thumb] => randomly selected
                [mtime] =>
                [sort_type] => Filename
                [subalbum_sort_type] => Manual
                [sort_order] =>
                [image_sortdirection] => 0
                [album_sortdirection] => 0
                [hitcounter] => 0
                [password] =>
                [password_hint] =>
                [total_value] => 0
                [total_votes] => 0
                [used_ips] =>
                [custom_data] =>
                [dynamic] => 0
                [search_params] =>
                [album_theme] =>
                [user] =>
            )

`
If anyone can help me please, i would much appreciate it.

Thanks to you and to the ZP staff.

Member
Member
elrol   12-01-2009, 16:21
#2

ok I figured it out on my own..

first you need to set the function to a variable

$aGalleyIndex = getParentAlbums()
then you can reference the commentson attribute using the following.

$aGalleyIndex[0]->getCommentsAllowed() // that will return the comments allowed status for the highest parent album.
this will return a true or false, so you need to put that code in an if statement.

hope this helps somebody in the future.

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