Денис Павлик,
вОТ КОД $set['title'] = 'Гости';
include_once '../../sys/inc/thead.php';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guests` WHERE `id_ank` = '$user[id]'"
,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="ttl">';
echo 'Нет записей';
echo '</div>';
}
$q = mysql_query("SELECT * FROM `my_guests` WHERE `id_ank` = '$user[id]' ORDER BY `id` DESC LIMIT $start, $set[p_str]"
;
while ($post = mysql_fetch_array($q))
{
$ank = get_user($post['id_user']);
/*-----------зебра-----------*/
if ($num == 0){
echo '<div class="nav1"><table><tr>';
$num = 1;
}elseif ($num == 1){
echo '<div class="nav2"><table><tr>';
$num = 0;
}
/*---------------------------*/
echo "<td class='avatar'>";
echo ''.avatar($ank['id']) .'</td>';
echo "<td class='gut'>";
echo ''.group($ank['id']) . ' <a href="/info.php?id='.$ank['id'].'">' . $ank['nick'] . '</a> ' . medal($ank['id']) . ' ' . online($ank['id']) . '';
if ($post['read'] == 1)
echo ' <span class="new_guest">' . vremja($post['time']) . '</span><br />';
else
echo ' <span class="guest">' . vremja($post['time']) . '</span><br />';
echo '<img src="/style/icons/pochta.png" alt="*" /> <a href="/mail.php?id=' . $ank['id'] . '">Напсать сообщение</a> ';
echo '</td></tr></table></div>';
// Помечаем пост прочитанным
mysql_query("UPDATE `my_guests` SET `read` = '0' WHERE `id` = '$post[id]' LIMIT 1"
;
}
if ($k_page>1)str("?",$k_page,$page);