e107sk.com

Content Category Comments system

Comments system (1 item)

Using integrated comment system for custom plugin Friday 01 May 2020

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.

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

Where

'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