It looks like I misunderstood the purpose of the chronocmments module. It shows the latest comments on all pages.
I would like to display the comments for the current page in a module.
I see that the component retrieves comments for the current page with this SELECT
I tried to apply the test pageid = JRequest::getVar('pageid') in the chronocomments module like this
But that causes the module to disappear - no error messages
Any ideas what I am doing wrong?
I would like to display the comments for the current page in a module.
I see that the component retrieves comments for the current page with this SELECT
$query = "SELECT * FROM #__chrono_comments WHERE component = '".JRequest::getVar('component')."' AND pageid= '".JRequest::getVar('pageid')."' AND parentid='0' AND published='1' AND verify='1' ORDER BY datetime ASC".$limit;
I tried to apply the test pageid = JRequest::getVar('pageid') in the chronocomments module like this
$extra = " AND a.pageid= '" . JRequest::getVar('pageid') . "'";
if($params->get( 'limitsections', '' ))$extra .= " AND b.sectionid IN (".$params->get( 'limitsections', '' ).")";
if($params->get( 'limitcategories', '' ))$extra .= " AND b.catid IN (".$params->get( 'limitcategories', '' ).")";
$query = "SELECT a.*, b.title AS articletitle FROM #__chrono_comments AS a, #__content AS b WHERE a.pageid = b.id AND a.published='1' AND a.verify='1'".$extra." ORDER BY a.datetime ".$params->get( 'order', 'ASC' )." LIMIT 0,".$params->get( 'commentscount', 5 );
But that causes the module to disappear - no error messages
Any ideas what I am doing wrong?
This topic is locked and no more replies can be posted.