e107sk.com

Display comment for some table

on Friday 01 May 2020
comments: 0

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.

0 Comments

Other links

Follow us