ZenphotoCMS Forum
Customizing comments display - 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: Customizing comments display (/thread-10679.html)



Customizing comments display - tosca - 2012-12-28

I would like to change the comments display layout on the image page. I've succeeded for the form part, using the documentation on this page: http://www.zenphoto.org/documentation/plugins/_zp-extensions---comment_form.php.html#functionprintCommentForm
But I haven't found any way to modify the remaining information... Is there a way to customize the 'printCommentForm' function?

Thanks for your answer.




Customizing comments display - acrylian - 2012-12-28

You can create custom forms if you mean that. How is explained right at the beginning of that page.

If you wish to have different functionality you need as always create your own custom plugin.




Customizing comments display - tosca - 2012-12-28

As I've previously said, I've already modified the form.

But the 'printCommentForm' is not only displaying the form; it also in charge of the existing comments (before the form) and the RSS link (after the form) display.
I would like to make some changes in the generated HTML but I don't find the 'printCommentForm' function; could you tell me where it is located, so I can use it as a model.

Thanks for helping.




Customizing comments display - acrylian - 2012-12-28

As already said you have to make your own custom plugin. That is naturally where the function is located.




Customizing comments display - Mark R - 2012-12-28

If you mean that you don't like the way the print function spits everything out I'm guessing you just want to make something similar for your theme. In that case I usually just make a customized function and place it in my theme function file.

The printCommentForm function is located in,
zp-core\zp-extensions\comment_form.php




Customizing comments display - acrylian - 2012-12-28

Not fully correct, it is in zp-core/zp-extensions/comment_form/functions.php right next to the comment_form file.




Customizing comments display - tosca - 2012-12-28

I'm sorry, guys: I had already searched the comment_form extension but couldn't find this specific function 'printCommentForm' anywhere; not even in the relevant functions.php file.
That was the purpose of my initial question: where can I find it, so I can analyze how it works?

Thanks for the 'right' hint. ;-)




Customizing comments display - acrylian - 2012-12-28

Sorry, I assume since you found the form file you also saw the other parts. Just as a general rule: Most extensions consist of a php .file and optionally a folder with one or more additional files.




Customizing comments display - tosca - 2012-12-28

acrylian, up to now, I've had no problem in finding functions or whatever element I was looking for: using the online documentation, I usually can find the name of the file where the function I need is defined.

But this time, it's different, and I don't understand why nor how... There is a 'printCommentForm' that is called to from the image.php file. I understand it uses the comment form that is in the zp-extensions/comment_form and I have already customized this form.
But I have absolutely no clue concerning the whereabouts of the actual function I'm looking for: what I'm sure, it is not in this specific extension (there are only 2 files...); it's not in the comment class file either. So where could it be?

I need to organize differently the HTML produced for the existing comments, but I don't know where the relevant source is 'hidden'! There should be somewhere a function printCommentForm; my question is: "in which file is it?"




Customizing comments display - tosca - 2012-12-28

OK, I got it!
There are 2 different files with the same name comment_form.php:

  • the one I had found is in zp-extensions/comment_form, and didn't provide what I was looking for...
  • but the one that is directly in zp-extensions is the 'right' one where all the HTML is.

So Mark has the right answer, but I didn't pay attention to it, as I hadn't realized there were 2 .php files with the same name in 'almost' the same place.

In fact, I found this while I was investigating on another issue, so you might soon get another question on another matter! ;-)

Thanks to everyone for helping.




Customizing comments display - acrylian - 2012-12-28

Just to summarize:

  • zp-extensions/comment_form/functions.php does have all the functions incl. html output for theme and backend
  • zp-extensions/comment_form/comment_form.php is the actual comment form itself you can have as a custom one of either in /plugins/comment_form/comment_form.php or /themes//comment_form/comment_form.php`
  • zp-extensions/comment_form.php is just the base plugin file.



Customizing comments display - tosca - 2012-12-29


Thank you very much for the explanation. It is welcomed.

-)