Content Category Comments system

Comments system

Using integrated comment system for custom plugin

Display comment for some table on 01 May 2020

example for pnews table

Actually moving plugin comments (in a separate table) to the core comment system.

$text .= e107::getComment()->compose_comment('pnews', 'comment', $newsid, null, $title, false, 'html');;


'pnews' - is key for comments used for this table/plugin, mainly related table name

$newsid is unique ID for this table

$title is subject for comment

* @param string $table - the source table for the associated item 
* @param string $action - usually 'comment' or 'reply' 
* @param integer $id - ID of item associated with comments (e.g. news ID) 
* @param int $width - appears to not be used 
* @param string $subject 
* @param boolean $rate 
* @param boolean|string $return true, false or 'html' 
* @param boolean $tablerender 
* @return array|null|string|void

You can use render() method too, with shorter numbers of parameters.

Other links

Follow us