Файл: pesn_voini/peseni_vojni/instalscript/engine/_inc/fnc/user.php
Строк: 58
<?
// 3020.ru - скрипты скачать можно тут
$uid= checking($_COOKIE['uid']);
$password= checking($_COOKIE['password']);
if($uid and $password) {
$BaseUser = $BaseConnect->prepare("SELECT * FROM `users` WHERE `id` = ? and `password` = ?");
$BaseUser -> execute(array($uid, $password));
$user = $BaseUser->fetch(PDO :: FETCH_ASSOC);
if(!$user) {
setcookie('uid', '', time() - 86400 * 365, '/');
setcookie('password', '', time() - 86400 * 365, '/');
}
}
$uid = number($user['id']);
if($uid == '0' && $location != true){
header("Location:/");
exit();
}
function UserEnter($uid,$password){
$uid = number($uid);
$password = checking($password);
$_SESSION['uid'] = $uid;
$_SESSION['password'] = $password;
setcookie("uid", $uid, time()+86400*365, "/");
setcookie("password", $password, time()+86400*365, "/");
}
function UserExit($uid){
unset($_SESSION['uid']);
unset($_SESSION['password']);
setcookie("uid", $uid, time()-86400*365, "/");
setcookie("password", $password, time()-86400*365, "/");
}
function user($uid,$i){
$user = fch("SELECT * FROM `users` WHERE `id` = ? LIMIT 1", array(number($uid)));
return $user[$i];
}
function user_list2($users){
$user = fch("SELECT * FROM `users` WHERE `id` = ? LIMIT 1", array(number($users)));
$list = '<img src = "/instalscript/main/img/user/class/_'.$user['class'].'.png" width="16" height="16"> '.$user['login'].'';
return $list;
}
function user_list($users){
$user = fch("SELECT * FROM `users` WHERE `id` = ? LIMIT 1", array(number($users)));
$list = '<img src = "/instalscript/main/img/user/class/_'.$user['class'].'.png" width="16" height="16"><a href="/profile/'.$user['id'].'"> '.$user['login'].'</a>';
return $list;
}
/*
function energy($users){
$user = fch("SELECT * FROM `users` WHERE `id` = ? LIMIT 1", array(number($users)));
$list = '<div class="message cntr"><font color="tomato">У вас недостаточно энергии!</font><br>Хотите восстановить энергию за 15 золота?<br><a href="?energy_all">Восстановить</a></div>';
return $list;
}
*/
function UserUpdateTime($uid){
qry("UPDATE `users` SET `time_on` = ? WHERE `id` = ? LIMIT 1", array(time(),number($uid)));
}
require_once($_SERVER['DOCUMENT_ROOT']."/instalscript/engine/_inc/fnc/user.spell.php"); // Способности
?>