Hi!
When viewing my gallery i want to display my thumbnails as a list and show the comments of each item next to it.
Basically i want my gallery to have two columns one for the thumbnail other for the comments.
I have no problem changing my css/template to the desired layout i just can't find how to get the comments from each image..
using printLatestComments gets all comments from all images..
Is there other function?
Comments
http://www.zenphoto.org/news/zenphotos-object-model-framework
Also `getLatestComments()` has a parameter for the ID. You get the id within the image loop via said object model. Then you need to write something to out put the comments fetched.
EDIT: It's working now! Thank you!
For testing purposes i'm just printing the comment itself.
My code:
`
<?php
foreach(getLatestComments(10,"image",$_zp_current_image-
>getID()) as $commentID => $comment){
print $comment["comment"];
}
?>
`
This is throwing a Fatal error: Cannot access empty property in \zenphoto\zp-core\template-functions.php on line 3260 which is `$comment['folder'] = $img->$album->name;` but if i comment that line it works. I don't understand why $album->name is empty, it shouldn't be filled with the folder name of the gallery?
You also really need to look what getLatestComments returns and if it does return something before you start the foreach loop. Also best don't put the function into foreach itself for that reason. That will throw errors if nothing is returned as well otherwise.
$album->name is empty because the album object is not setup. On album php. $_zp_current_album is available and also within the next_album loop.
What i have to do to setup the album object? Do i need to do it inside album.php?
Indeed, if that line did read as you quote it would be wrong. But nothing near that line resembles your statement in the current builds. Nor does the line appear anywhere else that I can find.
So the suggestion would be to be sure you are running current code.
i was running zenphoto 1.4.4.1 just did an upgrade to 1.4.4.3 and the problem is solved.
It was indeed that line.
Thank you.