Файл: social12/myguest.php
Строк: 26
<?php
require 'sid.php';
require 'config.php';
$link = connect_db();
list($user, $id, $ps) = check_login($link);
whorm(0, 'guests');
include 'head.php';
include 'navigator.php';
echo $div_title . 'Гости' . $div_end . $div_left;
if (isset($_GET['clean'])) {
mysql_query("DELETE FROM `my_guest` WHERE `user` = '$user[id]'");
header('Location: myguest.php?' . $ref);
}
$look = mysql_result(mysql_query("SELECT COUNT(*) FROM `my_guest` WHERE `user` = '$user[id]'"), 0);
$n = new navigator($look, 10, '?');
$view = mysql_query("SELECT * FROM `my_guest` WHERE `user` = '$user[id]' ORDER BY `time` DESC {$n->limit}");
if ($look != FALSE) {
$i = 0;
mysql_query("UPDATE `my_guest` SET `look` = '0' WHERE `look` = '1' AND `user` = '$user[id]'");
while($a = mysql_fetch_assoc($view)) {
echo ($i ++ % 2) ? $div_tworazdel : $div_razdel;
echo nikus($a['who']) . '<br/>' . user_inf($nk, 'xstatus') . ' (' . gmdate('Gч. iмин.', (time() - $a['time'])) . ' назад)' . $div_end;
}
echo $n->navi();
} else {
echo 'Не найдено!<br/>';
}
echo '<img src="ico/delete.gif" alt=""/> <a href="myguest.php?clean">Очистить гостей</a>';
echo $div_end;
include 'foot.php';
?>