ZenphotoCMS Forum
Comment Pagination - Howto? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Comment Pagination - Howto? (/thread-2747.html)



Comment Pagination - Howto? - akvilon - 2008-04-25

greetings all you great Zen people,
i have a very important for me question to resolve:
is there any way to do comments pagination? is it difficult?
this would help my design so much since i dont want comments to stretch to infinity..

if there are moders or just good people out there, please help!




Comment Pagination - Howto? - akvilon - 2008-04-29

there is no answet so far, not doable than??




Comment Pagination - Howto? - acrylian - 2008-04-29

Nearly everything is doable, depending on your programming skills. Zenphoto is not setup to do that, so this would mean a lot of work. Is it that worth, do you get that much comments?




Comment Pagination - Howto? - akvilon - 2008-04-30

yes its worth it definatelly and there is a guarantee there will be lots of comments

i really need an idea or even a direction where to start with comment paginations.. is it doable only through php hardcode or database changes/additions required...

help!




Comment Pagination - Howto? - acrylian - 2008-04-30

It should be possible without hacking zenphoto core files. You will need to replace the next_commentloop with a custom function. Here are some hints, assuming that you know at least the basics of php:

You get the comments to the current selected image as an array with $comments = $_zp_current_image->getComments();
Then you have to use a foreach($comments as $comment) {.....} loop for example to list the comments. The common functions will not work, so you would have to request the db fields directly with $currentcomment['comment'] etc.

Pagination would be of course easier if you get the data directly from the database, then you could use the MySQL offset pointer to separate the results for several pages.




Comment Pagination - Howto? - akvilon - 2008-05-06

i thank you very much for the tip and helpful direction,
appreciate it!