1. Function LoadComment in chronocomments.php (add line 63)
01function LoadComment($commentid, $comment_item){
02 global $mainframe;
03 $database =& JFactory::getDBO();
04 $configs = JComponentHelper::getParams('com_chronocomments');
05 //load current comment data
06 $query = "SELECT * FROM #__chrono_comments WHERE id = '".$commentid."'";
07 $database->setQuery( $query );
08 $commentx = $database->loadObject();
09 //define comment elements
10 //$comment_elements = array('id', 'name', 'email', 'url', 'text', 'datetime', 'rating', 'title');
...
51 //render the comment template
52 $comment_elements = array(
53 'id' => $commentx->id,
54 'name' => censor($commentx->name),
55 'email' => $commentx->email,
56 'url' => $commentx->url,
57 'text' => censor(bb2html($commentx->text)),
58 'datetime' => '<a href="#commentID'.$commentx->id.'">'.JHTML::_('date', $commentx->datetime, JText::_( 'DATETIMEFORMAT' )).'</a>',
59 'rating' => $commentx->rating,
60 'parentid' => $commentx->parentid,
61 'avatar' => $avatar ? $avatar : JURI::Base().'components/com_chronocomments/images/avatar1.png',
62 'userid' => $commentx->userid,
63 'title' => $commentx->title
64 );
65 foreach($comment_elements as $comment_element_name => $comment_element_value){
66 $current_comment_item = preg_replace("/\\{comment_".$comment_element_name."\\}/", $comment_element_value, $current_comment_item);
67 }
68 return str_replace("{REPLIES}", $comment_items, $current_comment_item);
69}
2. templates\comment-item.html.php (lines 9 to 11 added)
01<div class="comment-item" id="commentID{comment_id}">
02 <div class="comment-item-header"><a name="commentID{comment_id}"></a>
03 {a_comment_avatar}<img src="{comment_avatar}" alt="avatar" class="avatar" width="26" height="26" />{/a_comment_avatar}
04 <{if_comment_url}a href="{comment_url}"{/if_comment_url} class="nickname-link">{comment_name}</{if_comment_url}a{/if_comment_url}>{if_user_reputation}<span class="bullet">•</span> <div class="rep-score"><div class="rep-score-left"></div><div class="rep-score-center">{user_reputation}</div><div class="rep-score-right"></div></div>{/if_user_reputation}
05 <div class="rating">
06 <div class="score" id="score{comment_id}">{comment_rating}</div> <div id="plus_{comment_id}" class="rating-plus" onmouseover="showPlus(this.id);" onClick="addPlus({comment_id});" onmouseout="hidePlus(this.id);"> </div> <div id="minus_{comment_id}" class="rating-minus" onmouseover="showMinus(this.id);" onClick="addMinus({comment_id});" onmouseout="hideMinus(this.id);"> </div>
07 </div>
08 </div>
09 <div class="comment-title">
10 {comment_title}
11 </div>
.../...
3. Screenshot
![](http://nsm01.casimages.com/img/2009/06/23//090623042154709173940699.jpg)
I checked that I had saved data in the table, this part works.
You can say me what I have forget ?
NB : If Max think this hack is interesting, I could send to him by private message or even all publish. It is not yet completely finished, particularly in the administration and also for this display problem.