Daniel,
The query you included works perfectly in phpmyadmin. It returns the comments as it should.
I took the query you included and worked it into the code of cb.mxcommenttabs.php as follows:
$query = "SELECT ac.id AS commentid, ac.parentid, ac.contentid, ac.title, ac.comment, ac.date, c.title AS titlearticle"
."\n FROM #_comment AS ac, #_content AS c"
."\n WHERE c.id = ac.contentid"
."\n AND ac.userid = '$user->id'"
."\n AND ac.published = '1' "
."\n AND c.state = '1'"
.$commentLevel
."\n ORDER BY ac.$sortBy "
."\n LIMIT " . ( $pagingParams["mxc_comments_limitstart"] ? $pagingParams["mxc_comments_limitstart"] : "0" ) . "," . $commentperpage;
The results are the same as I reported in my first post. The tab will generate the number of comments for the user and the pagination will generate and display. I still do not get the list of comments to generate and display.
I think the code the builds the list is what needs work. It is calling on the old _mxc_badwords table... I've commented out most of the code that is calling the _mxc_badwords table, but still get no joy with the comment list genrating.
$rowcounter = 0;
if ( $recordcount >0 ) {
foreach ( $rows as $row ){
if (is_callable( array( $mainframe, "getItemid" ) ) ) {
$itemid = $mainframe->getItemid( $row->contentid );
} elseif (is_callable( "JApplicationHelper::getItemid" ) ) {
$itemid = JApplicationHelper::getItemid( $row->contentid );
} else {
$itemid = null;
}
$itemidtxt = $itemid ? "&Itemid=" . (int) $itemid : "";
$return .= "<fieldset>";
$return .= "<div class='small'>";
if ( $showTitle ) {
$return .= "<b>" . _MXCPLUG_TITLEARTICLE . "</b> <a href='" . sefRelToAbs( $goItem . $row->contentid . $itemidtxt ). "'>" . stripslashes($row->titlearticle) . "</a><br />";
}
$return .= "<b>" . _MXCPLUG_DATE . "</b> " . $row->date . "<br />";
if ( $showCommentLevel ) {
$return .= "<b>" . _MXCPLUG_LEVEL . "</b> " . ( $row->parentid ? _MXCPLUG_REPLY : _MXCPLUG_COMMENT ) . "<br />";
}
$return .= "</div>";
// Bad words
// if ( $mxc_badwords ){
// $query = "SELECT * FROM jos_mxc_badwords WHERE published='1'";
// $database->setQuery( $query );
// $rowsbadwords = $database->loadObjectList();
// if ( $rowsbadwords ) {
// foreach ( $rowsbadwords as $rowbadword ) {
// $badword = trim( $rowbadword->badword );
// $replacebadword = str_repeat( '*', strlen( $badword ) );
// $replacebadword = "\$1" . $replacebadword . "\$2";
// $row->title = preg_replace("/(\W|^)$badword(\W|$)/i", $replacebadword, $row->title);
// }
// }
// }
// $return .= "<b>" . stripslashes($row->title) . "</b><br />";
//
// // Prepare smiley array
// $smiley[':)'] = "sm_smile.gif"; $smiley[':grin'] = "sm_biggrin.gif";
// $smiley[';)'] = "sm_wink.gif"; $smiley['8)'] = "sm_cool.gif";
// $smiley[':p'] = "sm_razz.gif"; $smiley[':roll'] = "sm_rolleyes.gif";
// $smiley[':eek'] = "sm_bigeek.gif"; $smiley[':upset'] = "sm_upset.gif";
// $smiley[':zzz'] = "sm_sleep.gif"; $smiley[':sigh'] = "sm_sigh.gif";
// $smiley[':?'] = "sm_confused.gif"; $smiley[':cry'] = "sm_cry.gif";
// $smiley[':('] = "sm_mad.gif"; $smiley[':x'] = "sm_dead.gif";
//
// $commentText = stripslashes( $row->comment );
// Bad words
// if ( $mxc_badwords ){
// $query = "SELECT * FROM jos_mxc_badwords WHERE published='1'";
// $database->setQuery( $query );
//rowsbadwords = $database->loadObjectList();
// if ( $rowsbadwords ) {
// foreach ( $rowsbadwords as $rowbadword ) {
// $badword = trim( $rowbadword->badword );
// $replacebadword = str_repeat( '*', strlen( $badword ) );
// $replacebadword = "\$1".$replacebadword."\$2";
// $commentText = preg_replace("/(\W|^)$badword(\W|$)/i", $replacebadword, $commentText);
// }
// }
// }
$commentText = cbmxcParse( $commentText, $smiley, $mxc_bbcodesupport, $mxc_picturesupport, $mxc_smiliesupport, $mosConfig_live_site );
$commentText = cbhtmlwrap( $commentText, $mxc_lengthwrap );
$return .= $commentText . "<br />";
$return .= "</fieldset><br />";
$rowcounter++;
}
}
Current version of the file cb.mxcommenttabs.php is attached.
cb.zip