Файл: user/guests.php
Строк: 55
<?php
require_once '../sys/inc/start.php';
require_once '../sys/inc/compress.php';
require_once '../sys/inc/sess.php';
require_once '../sys/inc/settings.php';
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/user.php';
only_reg();
$set['title'] = 'Мои гости';
require_once '../sys/inc/thead.php';
aut();
$new = mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` WHERE `id_ank` = '$user[id]' AND `read`='1'"),0);
if ($new != 0){
mysql_query("UPDATE `myguests` SET `read`='0' WHERE `id_ank`='$user[id]' AND `read`='1' LIMIT $new");
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `myguests` 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 "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет посещений";
echo "</td></tr></table>";
}
$q = mysql_query("SELECT * FROM `myguests` WHERE `id_ank` = '$user[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_array($q)){
$ank = get_user($post['id_user']);
if ($post['count'] == 1 || $post['count'] >= 5 && $post['count'] <= 21 || $post['count'] >= 25 && $post['count'] <= 1111111111){
$kol = "раз";
}elseif ($post['count'] >= 2 && $post['count'] <= 4 || $post['count'] >= 22 && $post['count'] <= 24) {
$kol = "раза";
}
echo "<table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right'><font color = 'grey'>" . vremja($post['time'])."</font></div>";
user($ank['id']);
echo "<br />";
echo "<img src = '/style/icons/eye1.png' /> Посещал".( $user['sex'] == 0 ? 'а' : '' )." $post[count] $kol";
echo "</td></tr></table>";
}
if ($k_page > 1) {
str("?", $k_page, $page);
}
require_once '../sys/inc/tfoot.php';