Author Topic: [almost MOD] Threaded comments (needs cleaning and adjusting)  (Read 3845 times)

0 Members and 1 Guest are viewing this topic.

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Dear friends,

I felt like my site needed an urgent need for threaded comments.
One level of comments or even two level only (with YouTube-like comments available with one of the Mods) was not enogh for my needs so I decided to do something different....

I found a class online and adjusted it to fit the 4images structure....
If the admins or code gurus of 4images will create a MOD out of it that would be great... I feel that it's much much simpler than the YouTube like commening MOD...

So after a week of struggle (I am not a pro PHP programmer :lol:) I made it work... sample screen shot attached.

Thanks guys for 4images and I thought I'd share something with the community!

Here is the code from details.php
It needs to be cleaned from my other MODs, so for those of you who just follow the instructions - DO NOT USE MY CODE before you clean it... and ALWAYS BACKUP your files before changing anythig:

you will need and additional field in your comments table... please try to make a MOD out of it for everyone, since I really do not have any more time for this ))))


//-----------------------------------------------------
//--- Show Comments NEW STYLE--------------------------
//-----------------------------------------------------

if ($image_allow_comments == 1) {

  
$sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_response, c.response, 
          c.comment_headline, c.comment_text, c.comment_ip, 
	
	
  c.comment_date"
.get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq").", 
	
	
  u.full_name, c.comment_rating,c.comment_votes,c.comment_rating_users, c.comment_parent
          FROM "
.COMMENTS_TABLE." c
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.image_id = 
$image_id
          ORDER BY c.comment_date "
.(COMMENTS_ORDER "DESC" "ASC")."";
//        LIMIT $offset, $commentperpage"; line for paging comments

  
$result $site_db->query($sql);
  
debug($sql);
  
$comment_row1 = array();
  while (
$row $site_db->fetch_array($result)) {
    
$comment_row1[] = $row;
  }
  
//$site_db->free_result($result);
  
$num_comments1 sizeof($comment_row1);

  
class 
Threaded_comments  {  // thanks to http://www.jongales.com/blog/2009/01/27/php-class-for-threaded-comments/
	
 var 
$one_comment"";
	
 var 
$all_out"";
     public 
$parents  = array();  
     public 
$children = array();  

     
//  @param array $comments       
     
function __construct($comments) {
         foreach (
$comments as $comment)  
         {
             if (
$comment['comment_parent'] == 0)  
             {  
                 
$this->parents[$comment['comment_id']][] = $comment;  
             }  
             else  
             {  
                 
$this->children[$comment['comment_parent']][] = $comment;  
             }  
         }  
     }  
   
      
//@param array $comment 
      //@param int $depth 
     
Private function format_comment($comment_row$depth)  {

	
 
//include(ROOT_PATH."ajaxcomments.php");

	
 global 
$site_db$site_sess$site_template$config$user_table_fields$image_row$lang$user_info$image_allow_comments$row_bg_number$cat_id;
	
 
//**********************************************************************
	
 
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
	
  
	
  
$comment_by_owner = ($image_row['user_id'] == $comment_row['user_id']) ? 0;
	
  
      
$comment_user_email "";
      
$comment_user_email_save "";
      
$comment_user_mailform_link "";
      
$comment_user_email_button "";
      
$comment_user_homepage_button "";
      
$comment_user_icq_button "";
      
$comment_user_profile_button "";
      
$comment_user_status_img REPLACE_EMPTY;
      
$comment_user_name format_text($comment_row['comment_user_name'], 2);
      
$comment_full_name $comment_row['full_name'];
      
$comment_user_info $lang['userlevel_guest'];
      
$comment_headline format_text($comment_row['comment_headline'], 0$config['wordwrap_comments'], 00);
      
$comment_user_id $comment_row['user_id'];
  
    
// for comments avatars
    
$sql2 "SELECT user_id, user_avatar, user_avatar_type, user_avatar_width,
    user_avatar_height FROM phpbb_users
    WHERE username = '"
.$comment_row['comment_user_name']."'";
    
$result2 $site_db->query($sql2);
	
$row2 $site_db->fetch_array($result2);
  
	
if (empty (
$row2['user_avatar'])) {
	
	
//$comment_user_avatar = get_user_avatar($row2['user_avatar'], $row2['user_avatar_type'], $row2['user_avatar_width'], $row2['user_avatar_height']); 
	
	
$comment_user_avatar "";
	
	

	
	
else {
	
	

	
	
if (
$row2['user_avatar_type'] == 1) {
	
	
$comment_user_avatar "<img src='".PHPBB3_URL."/download/file.php?avatar=".$row2['user_avatar']."'>";
                } else {
                
$comment_user_avatar "<img src='".$row2['user_avatar']."'>";
                }
        }       
    
// end comment avatars
	

	
//PM link
	
$phpbbuser $row2['user_id'];
	

	
$send_pm_comment = ($user_info['user_level'] != GUEST) ? "<a href='/forum/ucp.php?i=pm&mode=compose&u=".$phpbbuser."' target='blank'>".$lang['send_pm']."</a>" "";
	

	
  if (isset(
$comment_row[$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
        
	
	
$comment_user_name format_text($comment_row[$user_table_fields['user_name']], 2);
        
$comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/"$comment_user_id$url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
        
$comment_user_profile_button "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";
        
$comment_user_status_img = ($comment_row[$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$user_table_fields['user_invisible']]) && $comment_row[$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";
        
$comment_user_homepage = (isset($comment_row[$user_table_fields['user_homepage']])) ? format_url($comment_row[$user_table_fields['user_homepage']]) : "";
        if (!empty(
$comment_user_homepage)) {
          
$comment_user_homepage_button "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
        }
	
	

	
	

	
	
//new option - full name from phpBB
        
$comment_full_name = (isset($comment_row[$user_table_fields['full_name']])) ? $comment_row[$user_table_fields['full_name']] : "";
        if (!empty(
$comment_full_name)) {
          
$comment_user_full_name iconv('utf-8''windows-1251'$comment_full_name);
        }
	
	
//end new option - full name from phpBB
	
	

	
	

	
	
$comment_user_icq = (isset($comment_row[$user_table_fields['user_icq']])) ? format_text($comment_row[$user_table_fields['user_icq']]) : "";
        if (!empty(
$comment_user_icq)) {
          
$comment_user_icq_button "<a href=\"http://www.icq.com/people/about_me.php?uin=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://status.icq.com/online.gif?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
        }

        if (!empty(
$comment_row[$user_table_fields['user_email']]) && (!isset($comment_row[$user_table_fields['user_showemail']]) || (isset($comment_row[$user_table_fields['user_showemail']]) && $comment_row[$user_table_fields['user_showemail']] == 1))) {
          
$comment_user_email format_text($comment_row[$user_table_fields['user_email']]);
          
$comment_user_email_save format_text(str_replace("@"" at "$comment_row[$user_table_fields['user_email']]));
          if (!empty(
$url_mailform)) {
            
$comment_user_mailform_link $site_sess->url(preg_replace("/{user_id}/"$comment_user_id$url_mailform));
          }
          else {
            
$comment_user_mailform_link $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          
$comment_user_email_button "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }

        if (!isset(
$comment_row[$user_table_fields['user_level']]) || (isset($comment_row[$user_table_fields['user_level']]) && $comment_row[$user_table_fields['user_level']] == USER)) {
          
$comment_user_level $lang['userlevel_user'];
        }
        elseif (
$comment_row[$user_table_fields['user_level']] == ADMIN) {
          
$comment_user_level $lang['userlevel_admin'];
        }
        elseif (
$comment_row[$user_table_fields['user_level']] == MODERADOR) { 
          
$comment_user_level $lang['userlevel_moderador']; 
        } 

        
$comment_user_info = (isset($comment_row[$user_table_fields['user_joindate']])) ? $lang['join_date']." ".format_date($config['date_format'], $comment_row[$user_table_fields['user_joindate']]) : "";
        
$comment_user_info .= (isset($comment_row[$user_table_fields['user_comments']])) ? " | <a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showcomments&user_id=".$comment_user_id)."\">".$lang['comments']." ".$comment_row[$user_table_fields['user_comments']]."</a>" "";
      }

      
$comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row['comment_ip'] : "";

      
$admin_links "";
      if (
$user_info['user_level'] == ADMIN || ($user_info['user_level'] == MODERADOR && $user_info['user_moderador_comentarios'] == 1)) {
      
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      
//removed below so that the owner of the image can not edit or delete comments to his photos
	
  
//elseif ($is_image_owner) {
      //  $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
      //  $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      //}
	
  
	
  if (
$comment_by_owner == && $hide_author == 1) {
	
	
	
$show_comment 0
	
  } else { 
	
	
	
$show_comment 1
	
	
	
}
	
	
$spacer="";
	
	

         for (
$depth$depth 0$depth--) {  
             
$spacer .= "<td width=\"20\" valign=\"top\"><img src=\"./templates/dark/images/spacer.gif\" width=\"19\" height=\"19\"/></td>"
         }
	
	
	

      
$site_template->register_vars(array(
        
"comment_id" => $comment_row['comment_id'],
	
    
"lang_comments_per_page" => $lang['comments_per_page'],
        
"comment_user_id" => $comment_user_id,
	
	
"spacer" => $spacer,
        
"comment_user_status_img" => $comment_user_status_img,
        
"comment_user_name" => $comment_user_name,
        
"comment_user_info" =>  ($show_comment  == 0) ? "" $comment_user_info,
        
"comment_user_level" => $comment_user_level,
        
"comment_user_profile_button" => ($show_comment  == 0) ? "" $comment_user_profile_button,
	
	
"comment_user_profile_link" => $comment_user_profile_link,
        
"comment_user_email" => $comment_user_email,
        
"comment_user_email_save" => $comment_user_email_save,
        
"comment_user_mailform_link" => $comment_user_mailform_link,
        
"comment_user_email_button" => ($show_comment  == 0) ? "" $comment_user_email_button,
        
"comment_user_avatar" => $comment_user_avatar//new line
        
"comment_user_homepage_button" => ($show_comment  == 0) ? "" $comment_user_homepage_button,
        
"comment_user_icq_button" => ($show_comment  == 0) ? "" $comment_user_icq_button,
        
"comment_user_ip" => $comment_user_ip,
        
"comment_headline" => $comment_headline,
	
	
"comment_author_PM" => ($hide_author == 1) ? "" $send_pm_comment,
	
	

        
"responses" => $responses,
        
"response_to_id" => $response_to_id,
        
"lang_post_response" => $lang['post_response'],
	
	
"lang_comment_voters" => $lang['comment_voters'],
	
	
"lang_comment_vote" => $lang['comment_vote'],
	
	
"lang_comment_hidden" => $lang['comment_hidden'],
	
	
"lang_comment_date" => $lang['comment_date'],
        
"comment_text" => format_text($comment_row['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
        
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row['comment_date']),
        
"row_bg_number" => $row_bg_number,
        
"admin_links" => $admin_links,
        
//new field - full name
        
"comment_full_name" => $comment_full_name,
	
	
//unite all comment user fields to easily hide them
	
	
"hide_author" => $hide_author,
	
	
"comment_user_box" => ($show_comment  == 0) ? "< &#1040;&#1074;&#1090;&#1086;&#1088; &#1060;&#1086;&#1090;&#1086; >" "<a href=".$comment_user_profile_link."><b>".$comment_full_name."</b><br/>(".$comment_user_name.")<br />".$comment_user_avatar."<br />".$comment_user_level."</a>"
      
));

      if (
COMMENT_RATING_ENABLE)   {
        
$comment_row['cat_id'] = $cat_id;
        
$comment_row['image_allow_comments'] = $image_allow_comments;
	
	
  
$comment_row['comment_rating'] = (int)$comment_row['comment_rating'];
	
	
  
$links comment_rating_links($comment_row['comment_id'], $comment_row);
	
	
  
$site_template->register_vars(array(
	
	
	
"comment_rating" => $comment_row['comment_rating'],
	
	
	
"comment_rating_str" => (($comment_row['comment_rating'] > 0) ? "+" "").$comment_row['comment_rating'],
	
	
	
"comment_votes" => $comment_row['comment_votes'],
	
	
	
"comment_rating_link_good" => $links[0],
	
	
	
"comment_rating_link_bad" => $links[1],
	
	
	
"comment_class" => ($comment_row['comment_rating'] > "1" : ($comment_row['comment_rating'] < "2" "0")),
	
	
	
"comment_hide" => ($comment_row['comment_rating'] <= COMMENT_RATING_HIDE) ? 0,
	
	
	
"comment_vote_tooltip" => $lang['comment_rating_check'][$links[2]],
	
	
  ));
	
	
  
	
	
  
$site_template->register_vars(array(
	
	
  
"lang_author" => $lang['author'],
	
	
  
"lang_comment" => $lang['comment'],
	
	
  
"commentratinghide" => COMMENT_RATING_HIDE,
	
	
  
"comment_rating_enable" => COMMENT_RATING_ENABLE,
	
	
  
"ajaxcommentsurl" => $site_sess->url(ROOT_PATH."ajaxcomments.php""&"),
	
	
  
"lang_comment_rating" => $lang['comment_rating'],
	
	
  
"lang_votes" => $lang['votes'],
	
	
  
"url_id" => URL_ID,
	
	
));

	
	
$still_to_vote comment_rating_links($comment_row['comment_id'], $comment_row);
	
	
  
//check if owner rated all comments
	
	
  if (
$still_to_vote[2] == 0){
	
	
	
	
$show_reminder 1;
	
	
  } 
	
	
//end check if owner rated all comments  
	
	

	
	

	
	

	
	
}

	
	
$this->one_comment $site_template->parse_template("comment_bit_new");
	
	
$this->all_out .= $this->one_comment;
	
	
//debug ($comments);
	
	
}
   
      
//@param array $comment 
      //@param int $depth 
     
Private function print_parent($comment$depth 0) {  
         foreach (
$comment as $c)  
         {  
             
$this->format_comment($c$depth);
             if (isset(
$this->children[$c['comment_id']]))  
             {  
                 
$this->print_parent($this->children[$c['comment_id']], $depth 1);  
             }  
         }  
     }  
   
     Public function 
print_comments()  {
         foreach (
$this->parents as $c)  
         {
             
$this->print_parent($c);  
         }
	
	
 return 
$this->all_out;
	
 }
   
   } 
//end of class
	
  

	
  
  if (!
$num_comments1) {
    
$comments1 "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
  }
  else {
    
$bgcounter 0;
	
$comments1 .= "<table width=\"100%\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"border: 1px solid grey;\">\n";
	
$comments_new = new Threaded_comments($comment_row1);
	
$comments1 .= $comments_new->print_comments();
	
$comments1 .= "</table>\n";
	


  } 
//end else

  //debug($comments1);
  
  
$site_template->register_vars(array(
    
"comments" => $comments1,
    
"comments_num" => $num_comments,
    
"commentbg" => (isset($row_bg_number)) ? $row_bg_number 0,
    
"page" => $page,
    
"perpage" => $commentperpage,
  ));

  unset(
$comments1);
  unset(
$hide_author);
  
  
// MOD: Notify comments by email.
	
$sql1 "SELECT cn.field_id, cn.comment_notify_status
              FROM " 
COMMENTS_NOTIFY_TABLE " cn
              LEFT JOIN " 
USERS_TABLE " u ON (" get_user_table_field("u.""user_id") . " = cn.user_id)
              WHERE cn.image_id = " 
$image_id " AND cn.user_id = " $user_info['user_id'] . " AND " get_user_table_field("u.""user_level") . " >= '" USER "'";
       
      
$result1 $site_db->query($sql1);
      
     while (
$notify_row $site_db->fetch_array($result1)) {
          
//$field_id = $notify_row['field_id'];
          
$comment_notify_status $notify_row['comment_notify_status'];
      }
// EBD MOD: Notify comments by email.
  
  
  //-----------------------------------------------------
  //--- BBCode & Form -----------------------------------
  //-----------------------------------------------------
  
$allow_posting check_permission("auth_postcomment"$cat_id);
  
$bbcode "";
  if (
$config['bb_comments'] == && $allow_posting) {
    
$site_template->register_vars(array(
      
"lang_bbcode" => $lang['bbcode'],
      
"lang_tag_prompt" => $lang['tag_prompt'],
      
"lang_link_text_prompt" => $lang['link_text_prompt'],
      
"lang_link_url_prompt" => $lang['link_url_prompt'],
      
"lang_link_email_prompt" => $lang['link_email_prompt'],
      
"lang_list_type_prompt" => $lang['list_type_prompt'],
      
"lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    
$bbcode $site_template->parse_template("bbcode");
  }

  if (!
$allow_posting) {
    
$comment_form1 "";
  }
  else {
    
$user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
    
$comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
    
$comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";
	
$response_to = (isset($HTTP_POST_VARS['response_to']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['response_to'])), 2) : "";

    
$site_template->register_vars(array(
      
"bbcode" => $bbcode,
      
"user_name" => $user_name,
      
"comment_headline" => $comment_headline,
      
"comment_text" => $comment_text,
	
  
"response_to" => $response_to,
      
"lang_clear" => $lang['clear'],
      
"lang_clear_desc" => $lang['clear_desc'],
      
"lang_post_comment" => $lang['post_comment'],
      
"lang_name" => $lang['name'],
      
"lang_headline" => $lang['headline'],
      
"lang_comment" => $lang['comment'],
      
"lang_captcha" => $lang['captcha'],
      
"lang_captcha_desc" => $lang['captcha_desc'],
      
"captcha_comments" => (bool)$captcha_enable_comments,
	
  
	
	
"lang_comment_note" => $lang['comment_note'],
	
	
"lang_comment_tips" => $lang['comment_tips'],
	
	
"lang_comment_tip1" => $lang['comment_tip1'],
	
	
"lang_comment_tip2" => $lang['comment_tip2'],
	
	
"lang_comment_tip3" => $lang['comment_tip3'],
	
	
"lang_comment_tip4" => $lang['comment_tip4'],
	
	
"lang_comment_tip5" => $lang['comment_tip5']
	
  
    ));
    
$comment_form1 $site_template->parse_template("comment_form");
  }
  
$site_template->register_vars("comment_form"$comment_form1);
  unset(
$comment_form1);
// end if allow_comments


The comment_bit_new.html that works for me is below. Again, it needs cleaning and adjusting to your needs:
Code: [Select]
<tr>
<td width="100%">

<!-- uncomment and place this div where you want messages related to comment rating to be showed (additionally to tooltips), you can use this div to display floating messages -->
<div id="commentratingmsg"></div>
<!--mod ajax comments insert end-->

<!-- style="border: 1px solid grey;" -->
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
{spacer}
<td width="100%">

<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
  <td width="160px" class="commentrow{row_bg_number}" valign="top" align="center">
    <a name="comment{comment_id}"></a>
{comment_user_box}<br />
{if comment_user_ip}
<b>IP:</b>{comment_user_ip}
{endif comment_user_ip}
  </td>
  
  <td class="commentrow{row_bg_number}" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
         <td valign="top"><b>{comment_headline}</b></td>
<td valign="top" align="right">


<table width="100%">
<tr>
<td>
<span class="smalltext">{lang_comment_date} {comment_date}</span>
</td>
<!--mod ajax comments insert start -->
<td align="right">
{if comment_rating_enable}<span class="smalltext">{lang_comment_vote}</span>
<span id="cmsg{comment_id}" title="{comment_vote_tooltip}">
<span id="cr{comment_id}" class="comment_rating{comment_class}">{comment_rating_str}</span>
{comment_rating_link_good} {comment_rating_link_bad}
<span id="crv{comment_id}">{comment_votes}</span> <span class="smalltext">{lang_votes}</span> - <a href="javascript:showvotes({comment_id});"><span class="smalltext">{lang_comment_voters}</span></a>  <a href="http://www.fotodvor.com/blog/golovaniya-za-kommentarii-802" target="_blank"><span class="smalltext">Как голосовать?</span></a>
</span>
{endif comment_rating_enable}
<!--mod ajax comments insert end -->

{if admin_links}{admin_links}{endif admin_links}
</td>
</tr>
</table>
</td>
      </tr>
    </table>
    <hr size="1" />
<!--mod ajax comments insert start -->
<a href="#" id="cilh{comment_id}" onClick="return aCTog({comment_id});" style="{if comment_hide}display:inline;{endif comment_hide}{ifno comment_hide}display:none;{endifno comment_hide}">{lang_comment_hidden}<img id="cih{comment_id}" src="{template_image_url}/plus.png" border="0" /></a>
<div id="commentbox{comment_id}"{if comment_hide} style="display:none;"{endif comment_hide}>
<!--mod ajax comments insert end -->
{if is_admin}({comment_id}){endif is_admin}
    <div id="translate_comment_{comment_id}">{comment_text}</div>

<!-- <a href="#comment_form" onClick="get_link('{comment_headline}', '{response_to_id}')" /><b><span class="smalltext">{lang_post_response}</span></b></a> -->
{if user_loggedin}
<a href="#comment_form" onClick="get_link('{comment_headline}', '{comment_id}')" /><b><span class="smalltext">{lang_post_response}</span></b></a>
{endif user_loggedin}

{if responses}<br />{responses}<br />{endif responses}
<!--mod ajax comments insert start -->
</div>
<!--mod ajax comments insert end -->
</td>
</tr>

{if show_comment}
<tr>
  <td width="160px" class="commentrow{row_bg_number}" align="center">
    <span class="smalltext">{comment_user_status_img}</span>
  </td>
  <td class="commentrow{row_bg_number}">
    <table width="100%">
<tr>

<td align="left"><span class="smalltext">
{comment_author_PM}  |  {comment_user_info}  |  {comment_user_profile_button}  |  {comment_user_email_button}  |  {comment_user_homepage_button}  |  {comment_user_icq_button}  |  </span>
</td>

<td align="right">
<span class="smalltext">Translate: </span>
<a href="javascript:google_translate('en','comment',{comment_id});"><img src="{template_url}/images/flags/gb.png" border="0"></a>
<a href="javascript:google_translate('de','comment',{comment_id});"><img src="{template_url}/images/flags/de.png" border="0"></a>
<a href="javascript:google_translate('fr','comment',{comment_id});"><img src="{template_url}/images/flags/fr.png" border="0"></a>
<a href="javascript:google_translate('ru','comment',{comment_id});"><img src="{template_url}/images/flags/ru.png" border="0"></a>
<!-- http://www.famfamfam.com/lab/icons/flags/ -->
</td>

</tr>
</table>

  </td>
</tr>
{endif show_comment}
</table>

</td>
</tr>
</table>

</td>
</tr>