<?php
require_once '../../core/set.php';
$set['title'] = 'Все микроблоги';
require_once H.'core/head.php';
require_once H.'core/panel.php';
echo '<div class="navig">'.$home. $z. $set['title'].'</div>';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_blog`"),0);
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
if ($k_post == 0) echo '<div class="menu">Микроблогов нет</div>';
$q = mysql_query("SELECT * FROM `$system[perfix]_blog` ORDER BY `id` DESC LIMIT $start, $set[p_str]");
while($blog = mysql_fetch_assoc($q)){
$avtor = mysql_fetch_assoc(mysql_query("SELECT `id`,`login` FROM `$system[perfix]_users` WHERE `id` = '".num($blog['id_user'])."'"));
echo '<div class="menu_touch"><a href="/moduls/blog/?id='.$blog['id_user'].'"><table><tr><td>';
if($blog['avatar'] == 0) echo '<img src="/files/microblog/avatar/no_avatar.jpg" alt="Аватара нет" style="max-width:60px; max-height:50px" />';
else echo '<img src="/files/microblog/avatar/'.$blog['avatar'].'.jpg" alt="Micro-Book.ru" style="max-width:60px; max-height:50px" />';
echo '</td><td>Автор: ';
echo online($avtor['id']).' '.$avtor['login'].'<br />'.text(rez_text($blog['opis']));
echo '</td></tr></table></a></div>';
}
if ($k_page>1)str('index.php?',$k_page,$page); // Вывод страниц
echo '<div class="navig">'.$home. $z. $set['title'].'</div>';
require_once H.'core/foot.php';
?>