Member
Member
jalves   2013-03-14, 12:37
#1

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?

Administrator
Administrator
acrylian   2013-03-14, 14:16
#2

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.

Member
Member
jalves   2013-03-14, 14:46
#3

Thank you, but the link you mentioned is going to a zenphoto reinstall login page.. is there any problem?

EDIT: It's working now! Thank you!

Administrator
Administrator
acrylian   2013-03-14, 15:07
#4

It should now work actually. My colleague did just update the site.

Member
Member
jalves   2013-03-14, 16:37
#5

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?

Administrator
Administrator
acrylian   2013-03-14, 20:40
#6

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.

Member
Member
jalves   2013-03-15, 12:08
#7

$zp_current_image is set i'm executing the code within next_image(). $_zp_current_album is set and i'm also in album.php.
What i have to do to setup the album object? Do i need to do it inside album.php?

Member
Member
jalves   2013-03-15, 13:22
#8

Hi, i'm digging around this, shouldn't $comment['folder'] = $img->$album->name; on line 3260 of template-functions.php be $comment['folder'] = $img->[b]album->name;[/b]? The album object is perfectly set.

Administrator
Administrator
acrylian   2013-03-15, 13:44
#9

I cannot answer at the moment, we will have to look later at it.

Member
Member
jalves   2013-03-15, 14:38
#10

Ok acrylian, thank you!

Member
Member
sbillard   2013-03-15, 20:14
#11

@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.

Member
Member
jalves   2013-03-18, 10:50
#12

Hi!
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.

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