<?php
  
//Навигация
ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO "<a href='/modules/?path=forum'>".LG('Форум')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO LG('Новые темы');
ECHO "</div>";
  
ECHO "<div class='tmenu_body'>";  
ECHO "<a href='/modules/?path=forum&get=new' class='tmenu-33 tmenu-33-o'>".LG('Новые')."</a>";
ECHO "<a href='/modules/?path=forum&get=top' class='tmenu-33'>".LG('Популярные')."</a>";
ECHO "<a href='/modules/?path=forum' class='tmenu-33'>".LG('Разделы')."</a>";
ECHO "</div>";

//Поиск
REQUIRE (ROOT.'/modules/search/plugins/form/forum.php');

IF (ISSET($user)){ 
  
  ECHO "<div class='list'>";  
  ECHO "<a href='/modules/?path=forum&section=users' class='btn-o'>".ICONS('user', 15, 'fa-fw')." ".LG('Мои темы')."</a>";  
  ECHO "</div>";
  
}

$column = DB::GET_COLUMN("SELECT COUNT(*) FROM `FORUM_THEM`");
$spage = SPAGE($column, $page_settings);
$page = PAGE($spage);
$limit = $page_settings * $page - $page_settings;

IF ($column == 0){ 
  
  HTML::EMPTY();
  
}ELSE{
  
  ECHO "<div class='list-body'>"; 
  
}

$data = DB::GET_STRING_ALL("SELECT * FROM `FORUM_THEM` ORDER BY `TIME` DESC LIMIT ".$limit.", ".$page_settings."");

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

}

IF ($column > 0){

  ECHO "</div>";
  
}

IF ($spage > 1){ ECHO STR_PAGE('/modules/?path=forum&get=new&', $spage, $page); }

//Навигация
ECHO "<div class='navigation'>";
ECHO "<a href='/'>".ICONS('home', 25, 'fa-fw')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO "<a href='/modules/?path=forum'>".LG('Форум')."</a>";
ECHO "".ICONS('angle-right', 20, 'fa-fw')."";
ECHO LG('Новые темы');
ECHO "</div>";
  
?>