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?
You would have to use this:
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.
I'm calling getLatestComments() in my theme's album.php.
For testing purposes i'm just printing the comment itself.
My code:
`
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 need to make sure $_zp_current_image is set. It is only within next_image() or on image.php itself.
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.
@jalves:
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.