<?php

if (function_exists('iconv')) {
    $jfile = iconv('windows-1251', 'utf-8', $file);
} else {
    $jfile = $file;
}

$q = $db->query("SELECT * FROM `loads_komm` WHERE `file` = '$jfile' AND `path` = '/$l/' ORDER BY id DESC LIMIT 3");
while ($post = $db->get_row($q)) {
    $ank = get_user($post['id_user']);
    echo "<table class='list-group-item-komm'><tr><td class='icon14'>";
    avatar($ank['id'], '48', 'border-radius: 2px;');
    echo "</td><td class='null'>";

    echo "<span style='float:right;color: grey;'><small title='" . date::time($post['time']) . "'>" . date::timek($post['time']) . "</small></span>";
    echo user($ank['id']) . " ";

    echo "<br />\n";
    echo toOutput($post['msg']);
    echo "</td></tr></table>";
}

echo "<a href=\"?komm&amp;" . url("d=$l&amp;f=$file") . "\" title='Комментарии $file' class='list-group-item-null list-group-item-grey'><i class='fa fa-comments fa-fw'></i> Комментарии (" . k_komm($file, $path) . ")</a>\n";
