Файл: pages/user.php
Строк: 128
<?php
include '../engine/includes/start.php';
Core::add_words('user.ini');
$id = !$id ? $user_id : $id;
if ($sql->query('SELECT COUNT(*) FROM `user` WHERE `id` = '.$id)->result() == 0)
{
Core::stop();
}
$ank = $sql->query('SELECT * FROM `user` WHERE `id` = '.$id)->fetch();
$set['title'] = __('Личная страница :nick', array(':nick' => $ank['nick']));
include H.'engine/includes/head.php';
$cache = new Cache(tmpDir . 'user[id=' . $id . ';lang='.Core::$language.'].swc');
if (!$cache->life())
{
ob_start();
//echo '<div class="menu_razd">'.Core::user_show($ank).'</div>';
//echo Core::user_avatar($ank['id']).'<br />';
switch ($ank['group_access'])
{
case 2:
$group = __('Модератор');
break;
case 3:
$group = __('Администратор');
break;
case 10:
$group = __('Создатель');
break;
}
$arr['post'] =
(empty($ank['ank_name'])
? null : __('Имя').': ' . $ank['ank_name'] . '<br />') .
__('Пол').': ' . ($ank['pol'] == 1
? __('Мужской') : __('Женский')) . '<br />' .
(isset($group) ? __('Должность').': '.$group .'<br />':'').
(empty($ank['ank_city'])
? null : __('Город').': '.$ank['ank_city'] . '<br />');
if ($ank['ank_d_r'] != NULL &&
$ank['ank_m_r'] != NULL &&
$ank['ank_g_r'] != NULL)
{
$ank['mes'] = __(date('F', mktime(0, 0, 0, $ank['ank_m_r'], $ank['ank_d_r'], $ank['ank_g_r'])));
$ank['ank_age'] = date('Y') - $ank['ank_g_r'];
if (date('n') < $ank['ank_m_r'])
{
$ank['ank_age'] = $ank['ank_age'] - 1;
}
elseif (date('n') == $ank['ank_m_r'] && date('j') < $ank['ank_d_r'])
{
$ank['ank_age'] = $ank['ank_age'] - 1;
}
$arr['post'] .= __('Дата рождения: :day - :month :year', array(':day' => $ank['ank_d_r'], ':month' => $ank['mes'], ':year' => $ank['ank_g_r'])) . '<br />' .
__('Возраст: :old', array(':old' => $ank['ank_age'])) .' <br />';
}
$arr['post'] .=
(empty($ank['ank_icq'])
? null: 'Icq: '. $ank['ank_icq']. '<br />' ).
(empty($ank['ank_mail'])
? null : 'E-mail: '.$ank['ank_mail']. '<br />') .
(empty($ank['ank_n_tel'])
? null : __('Телефон').': '.$ank['ank_n_tel']. '<br />') .
(empty($ank['ank_o_sebe'])
? null : __('О себе').': '.$ank['ank_o_sebe']. '<br />') .
__('Баллы').': '.$ank['balls'].'<br />'.
__('Регистрация').': '.Core::time($ank['date_reg']).'<br />'.
__('Посл. посещение').': '.Core::time($ank['date_last']);
echo Core::user_show($ank, $arr, 'new');
$res = mysqli_query($sql->db, 'select `file` from `module_services` where `use_in` ="anketa"');
while($file = $sql->result($res))
{
include_once H . $file;
}
$cache->write();
}
echo $cache->read();
if ($user_id && $ank['id'] != $user_id)
{
echo '<a href="/pages/mail.php?act=mail&id='.$id.'"><div class="link">'.__('Написать').'</div></a>';
}
if ($user_id == $id)
{
echo '<a href="anketa.php"><div class="menu_razd">'.__('Редактировать').'</div></a>';
}
elseif ($moder)
{
if ($ank['group_access'] < $user['group_access'])
{
echo
'<a href="/admin/users/ban.php?act=ban&id='.$id.'"><div class="link">'.__('Бан').'</div></a>'. ($admin ?
'<a href="/admin/users/edit.php?id='.$id.'"><div class="link">'.__('Редактировать').'</div></a>'.
'<a href="/admin/users/delete.php?id='.$id.'"><div class="link">'.__('Удалить пользователя').'</div></a>' : null);
}
}
echo '<a href="/"><div class="link">'.__('Главная').'</div></a>';
include H.'engine/includes/foot.php';