<?php 

if ($type  ==  'groups_videos')
{
$video = mysql_fetch_assoc(mysql_query("SELECT p.*, u.level, ru.nick, ru.date_last, g.name AS 'group_name', g.public_admin, g.avatar AS 'img'
                                            FROM `groups_videos` AS p
                                            LEFT JOIN groups_users AS u ON u.id_user = p.id_user
                                            LEFT JOIN user AS ru ON p.id_user = ru.id
                                            LEFT JOIN groups AS g ON g.uid = p.id_group
                                            WHERE p.uid = '$post[id_file]'
                                            LIMIT 1"));

?>
<div class="groups">
  <div class="group-post">
    <div class="group-table">
      <div class="group-table-cell group-post-title">
        <img src="/groups/<?= ($video['img'] ? '30x30/' . $video['img'] . '.jpg' : 'style/img/group_ava_50.png')?>" class="group-small-avatar" /> 
        <? if ($video['public_admin'] == 1 && $video['level'] > 1) { ?>
          <a href="/groups/group.php?uid=<?= $video['id_group']?>"><?= text($video['group_name'])?></a>
        <? } else { ?>
          <a href="/groups/group.php?uid=<?= $video['id_group']?>"><?= text($video['group_name'])?></a><b>.:</b>  
          <a href="/info.php?id=<?= $video['id_user']?>"><?= text($video['nick'])?></a> 
          <span class="<?= ($video['date_last'] >= ($time - $set['time_online']) ? 'online' : 'offline')?>"></span>
        <? } ?>
        
        загружено новое видео 
        <span class="group-post-time">
          <?= vremja($post['time'])?>
        </span>
      </div>
    </div>
    
    <div class="flex">
      <div class="flex-block flex-video"> 
        <a href="/groups/videos.php?uid=<?= $video['id_group']?>&amp;video=<?= $video['uid']?>">
          <div class="flex-screen">
            <img src="/groups/video/320x200/<?= $video['hash']?>.jpg" class="flex-img" />
            <span class="flex-time"><?= gmdate("H:i:s", $video['duration'])?></span>
            <span class="flex-play"></span>
          </div>
          <? if ($video['name']) { ?>
            <div class="flex-photo-name">
              <?= output_text($video['name'], 1, 1, 1, 0)?>
            </div>
          <? } ?>
          
          <div class="ic-panel">
            <?php echo get_comments_count('video', $video['id_group'], $post['id_file']); ?>
          </div>
        </a>
      </div>
    </div>
</div>
<? 
}