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']); }
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']);
}
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.