<?php
  
ECHO "<div class='list-menu'>";

ECHO "<table style='width: 100%;'><tr>";

ECHO "<td class='comments-avatar'>";
ECHO USER::AVATAR($list['USER_ID'], 50);
ECHO "</td>";
  
ECHO "<td class='comments-info'>";
ECHO USER::LOGIN($list['USER_ID'], 0, 1);
  
ECHO "<br /><span class='time'>".STIME($list['TIME'])."</span>";
ECHO "</td>";
  
ECHO "</tr></table>";
  
ECHO "<div style='margin-top: 8px; margin-bottom: 8px;'>";

IF ($list['ACTIVE'] == 0){

  ECHO "".ICONS('lock', 17, 'fa-fw')." ";
  
}

ECHO "<a href='/modules/?path=forum&section=show&id=".$list['ID']."'><b>";

IF ($list['BAN'] == 0){
  
  ECHO "".CROP_TEXT(TEXT_ABSOLUTE($list['NAME']), 0, 80)."";
  
}ELSE{
  
  ECHO "".LG('Содержимое скрыто')."<br />";
  ECHO "<small><font color='#FA9D96'>".ICONS('lock', 15, 'fa-fw')." ".LG('Тема заблокирована')."</font></small>";
  
}

ECHO "</b></a></div>";

ECHO "<div style='margin-top: 5px; margin-bottom: 5px; color: gray; font-size: 12px;'>";
ECHO "".LG('Последний комментарий от').":";

$comments = DB::GET_STRING("SELECT `USER_ID`,`ID` FROM `FORUM_THEM_COMMENTS` WHERE `THEM_ID` = '".$list['ID']."' ORDER BY `TIME` DESC LIMIT 1");

IF (ISSET($comments['ID'])){
  
  $account = DB::GET_STRING("SELECT `LOGIN`,`ID` FROM `USERS` WHERE `ID` = '".$comments['USER_ID']."' LIMIT 1");
  
  ECHO " <a href='/id".$account['ID']."' style='color: black;'><b>".$account['LOGIN']."</b></a>";
  
}ELSE{
  
  $account = DB::GET_STRING("SELECT `LOGIN`,`ID` FROM `USERS` WHERE `ID` = '".$list['USER_ID']."' LIMIT 1");
  
  ECHO " <a href='/id".$account['ID']."' style='color: black;'><b>".$account['LOGIN']."</b></a>";

}

ECHO "</div>";
  
$count_like = DB::GET_COLUMN("SELECT COUNT(*) FROM `FORUM_THEM_LIKES` WHERE `THEM_ID` = '".$list['ID']."'");
$count_eye = DB::GET_COLUMN("SELECT COUNT(*) FROM `FORUM_THEM_EYE` WHERE `THEM_ID` = '".$list['ID']."'");
$count_comments = DB::GET_COLUMN("SELECT COUNT(*) FROM `FORUM_THEM_COMMENTS` WHERE `THEM_ID` = '".$list['ID']."'");
  
ECHO "<a href='/modules/?path=forum&section=show&id=".$list['ID']."' class='btn-o'>".ICONS('heart', 15, 'fa-fw')." ".$count_like."</a>";
  
ECHO "<a href='/modules/?path=forum&section=show&id=".$list['ID']."' class='btn-o'>".ICONS('comment', 15, 'fa-fw')." ".$count_comments."</a>";
  
ECHO "<a href='/modules/?path=forum&section=show&id=".$list['ID']."' class='btn-o' style='float: right;'>".ICONS('eye', 15, 'fa-fw')." ".$count_eye."</a>";
  
ECHO "</div>";
  
?>