e107help.org Q&A
0 like 0 dislike

I'm trying to add comments to my plugin but something isnt adding up. Plugin maker suggests that I use the function renderComments.. I dont know if Im missing something or not.

private function renderComments()




         * Returns a rendered commenting area. (html) v2.x

         * This is the only method a plugin developer should require in order to include user comments.

         * @param string $plugin - directory of the plugin that will own these comments.

         * @param int $id - unique id for this page/item. Usually the primary ID of your plugin's database table.

         * @param string $subject

         * @param bool|false $rate true = will rendered rating buttons, false will not.

         * @return null|string



        $plugin = 'game_reviews';

        $id = 1;

        $subject = 'My games item subject';

        $rate = true;


        $ret = e107::getComment()->render($plugin, $id, $subject, $rate);


        $ns->tablerender($ret['caption'],$ret['comment_form']. $ret['comment']);



e107 version 2.2.1
in Plugins by (27 points) 1 4 8
closed by

2 Answers

0 like 0 dislike
Best answer

Solved on Gitter. 

For future reference, the code to use is the following: 

        $plugin = 'game_reviews';

        $id = 1;

        $subject = 'My games item subject';

        $rate = true;


        $ret = e107::getComment()->render($plugin$id$subject$rate);


        $ns->tablerender($ret['caption'],$ret['comment_form']. $ret['comment']);

This will be added to the developer documentation.  

by (2.8k points) 7 10 10
selected by
Moc, it is not working, moving to github.
0 like 0 dislike
Did you add e_comment addon for your plugin? And then rescanned plugin directory?

EDITED. See comment bellow
by (2.0k points) 16 47 57
edited by
I guess I'm doing something wrong. How do I get the comment form to appear, etc? I guess it isn't as easy as just e107::getComment()->render();?
Can you share (part of) your code you use in a Gist? https://gist.github.com/
Then we can help you out better :)
Please find me on Gitter to have a chat. This is basic PHP stuff that is the issue, not e107 specific :) Your current code is messy and also very vulnerable to security risks.
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
962 questions
1,362 answers
2,404 users