Code: Select all
if(!isset(params['theid'])){
die("Param: theid is required!");
}
global $gCms;
$db = &$gCms->db;
// Get number of comments
$q = "SELECT COUNT(comment_id) AS numrows FROM ".cms_db_prefix()."module_comments
WHERE page_id = ? AND module_name='News' AND active='1'"; // or 'Uploads' or whatever instead of 'News'
$dbresult = $db->Execute( $q, array($params['theid']) );
if( !$dbresult )
{
echo 'DB error: '. $db->ErrorMsg()."<br/>";
}
else
{
$num_rows_res = $dbresult->FetchRow();
$num_rows = $num_rows_res['numrows'];
($num_rows == 1 ? $sing_plur = "comment" : $sing_plur = "comments");
echo $num_rows." ".$sing_plur;
}
Code: Select all
* Invalid code entered.
* Parse error: syntax error, unexpected '[', expecting T_PAAMAYIM_NEKUDOTAYIM in /home/jklockec/public_html/admin/adduserplugin.php(100) : eval()'d code on line 1