<?php

$column = DB::GET_COLUMN("SELECT COUNT(*) FROM `BLOGS` WHERE `PRIVATE` = '0' AND `PASSWORD` = '".NULL."'");

ECHO "<div class='list-body'>";

ECHO "<div class='list-menu list-menu-title'>".ICONS('book', 15, 'fa-fw')." ".LG('Люди пишут')." <a href='/modules/?path=blogs' style='float: right;'>".LG('Все')." ".ICONS('chevron-right', 15, 'fa-fw')."</a></div>";

IF ($column == 0){ 
  
  ECHO "<div class='list-menu'>".LG('Пока нет записей').". "; 
  
  IF (ISSET($user)){
    
    ECHO "<a href='/modules/?path=blogs&section=users&id=".$user['ID']."&get=add'>".LG('Желаете добавить запись первым?')."</a>";
    
  }
  
  ECHO "</div>";
  
}

$data = DB::GET_STRING_ALL("SELECT * FROM `BLOGS` WHERE `PRIVATE` = '0' AND `PASSWORD` = '".NULL."' ORDER BY `TIME` DESC LIMIT 3");

WHILE ($list = $data->FETCH())
{
  
  REQUIRE (ROOT.'/modules/blogs/plugins/blogs_list.php');

}

ECHO "</div>";
  
?>