Файл: history_nick.php
Строк: 26
<?php
/*
*
@Author: Freedom <by_freedom@bk.ru>
* ICQ: 2860666
*/
define('H', $_SERVER['DOCUMENT_ROOT'].'/');
foreach(array('start', 'compress', 'sess', 'home', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc)
require H.'sys/inc/'.$inc.'.php';
$id = isset($_GET['id']) ? abs((int)$_GET['id']) : NULL;
$inf = mysql_fetch_assoc(mysql_query("SELECT id,nick FROM `user` WHERE `id` = '$id' LIMIT 1"));
if (empty($inf['id'])) {
header('location: /');
die();
}
$set['title'] = 'История ников '.$inf['nick'];
require H.'sys/inc/thead.php';
title();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `history_nick` WHERE `user_id` = '$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="mess">Пока пусто...</div>';
$sql = mysql_query("SELECT * FROM `history_nick` WHERE `user_id` = '$id' ORDER BY `id` DESC LIMIT $start,$set[p_str]");
while($a = mysql_fetch_assoc($sql)) {
echo '<div class="nav1"><b>'.$a['nick_last'].'</b> -> <b>'.$a['nick_new'].'</b><br/>Изменил: '.user::nick($a['who']).' ('.vremja($a['time']).')</div>';
}
if ($k_page>1)str('?',$k_page,$page);
require_once H.'sys/inc/tfoot.php';
?>