Файл: plugins/user/profile.php
Строк: 23
<?php
if (isset($_GET['url']))
$profile = $db->query("SELECT * FROM `users` WHERE `login` = '".core::input($_GET['url'])."' LIMIT 1")->fetch_assoc();
if (empty($profile))
core::go("/");
$title = $profile['login'];
require (SYS.'head.php');
$posts[] = [
'image' => user::photo($profile['id']),
'title' => user::login($profile['id']),
'post' => $profile['status'] != NULL ? core::text($profile['status']) : 'Hello, world!',
];
$listing[] = [
'title' => 'Регистрация: '.core::time($profile['time_reg']),
'div' => 'block'
];
$listing[] = [
'title' => 'Посл. посещение: '.core::time($profile['time_last']),
'div' => 'block'
];
$listing[] = [
'title' => 'Должность: '.user::level($profile['id']),
'div' => 'block'
];
$listing[] = [
'title' => 'Пол: '.($profile['sex'] == 0 ? 'Девушка' : 'Парень'),
'div' => 'block'
];
$listing[] = [
'title' => 'Монет: '.$profile['money'],
'div' => 'block'
];
if (isset($user))
{
if ($user['id'] != $profile['id'])
{
$listing[] = [
'title' => 'Написать сообщение',
'url' => '/mail/'.$profile['id'].'/',
'div' => 'menu',
'icon' => 'mail'
];
}
if ($user['level'] >= 4 && $user['id'] != $profile['id'])
{
$listing[] = [
'title' => 'Удалить пользователя',
'url' => '/admin/user.delete.php?id='.$profile['id'],
'div' => 'menu',
'icon' => 'delete'
];
}
}
$smarty->assign([
'post' => $posts,
'listing' => $listing
]);
$smarty->display('posts.tpl');
$smarty->display('listing.tpl');
require_once (SYS.'foot.php');