Файл: modules/users/profile.php
Строк: 157
<?php
define('R', $_SERVER['DOCUMENT_ROOT']);
define('S', R.'/system');
require_once(R.'/system/kernel.php');
$tmp->header('user');
$idu=$db->guard($_GET['id']);
$u=$db->fass("select * from `users` where `id` = '".$idu."'");
if (!$u) {
$tmp->div('error', Language::config('error'));
$tmp->div('menu', '<a href="/">'.img('link.png').' '.Language::config('home').'</a>');
$tmp->footer();
exit();
}
$tmp->title('title', Language::config('user'). ' '.$u['login']);
User::panel();
User::banned($u['id']);
$tmp->div('main', ava($u));
if($u['level'] == 2) $lvl = '<span class="level mod">MOD</span>';
if($u['level'] == 3) $lvl = '<span class="level adm">ADM</span>';
if($u['level'] == 4) $lvl = '<span class="level dev">DEV</span>';
if (User::aut()) {
echo '<ul><div><li>'.Language::config('login').': '.$u['login'].' '.(($u['level'] > 1) ? $lvl: NULL).'</li>
<li>ID: '.$u['id'].'</li><!--<li>'.Language::config('money').': '.$u['money'].'</li>--></div><br><div>';
echo (!empty($u['name']) ? '<li>'.Language::config('name').': '.$u['name'].'</li>' : NULL );
echo (!empty($u['first_name']) ? '<li>'.Language::config('fname').': '.$u['first_name'].'</li>' : NULL );
echo '<li>'.Language::config('sex').': '.($u['sex']==1 ? Language::config('men') : Language::config('wom')).'</li>';
echo (!empty($u['country']) ? '<li>'.Language::config('country').': '.$u['country'].'</li>' : NULL );
echo (!empty($u['city']) ? '<li>'.Language::config('city').': '.$u['city'].'</li>' : NULL );
echo (!empty($u['about']) ? '<li>'.Language::config('about').': '.$u['about'].'</li>' : NULL );
echo (!empty($u['email'] && ($u['id'] == User::ID() || User::profile('level') == 4)) ? '<li>'.Language::config('email').': '.$u['email'].'</li>' : NULL );
echo (!empty($u['tg']) ? '<li>'.Language::config('tg').': <a class="link_visual" target="_blank" href="https://t.me/'.$u['tg'].'">@'.$u['tg'].'</a></li>' : NULL );
echo '</div><br><div>';
echo (!empty($u['date_last_entry']) ? '<li>'.Language::config('date_last_entry').': '.times($u['date_last_entry']).'</li>' : NULL );
echo (!empty($u['date_registration']) ? '<li>'.Language::config('date_registry').': '.times($u['date_registration']).'</li>' : NULL );
echo '</div><br></ul>';
}
echo '<hr><div class="menu"><span class="fmenu">';
if (User::aut() && $u['id'] != User::ID()) {
echo '<a href="/dialogs/dialogs'.$idu.'">'.img('send_mail.png').' '.Language::config('send_message').'</a>';
$fr = $db->fass("SELECT * FROM `friends` where `komy` = '".$idu."' and `kto` = '".User::ID()."'");
if ($fr) {
echo ($fr['status'] ? '<a href="/friends/delete'.$idu.'">'.img('del_friend.png').' '.Language::config('delete_friend').'</a>' : '<a href="/friends/delete'.$idu.'">'.img('del_friend.png').' '.Language::config('del_req_friend').'</a>');
} else {
echo '<a href="/friends/add'.$idu.'">'.img('add_friend.png').' '.Language::config('add_friend').'</a>';
}
}
echo '<a href="/friends'.$idu.'">'.img('users.png').' '.Language::config('friends').' <span>'.$db->fass_c("SELECT COUNT(*) as count FROM `friends` where `komy` = '".$idu."' and `status` = '1'").'</span></a>
<a href="/blogs/ublogs'.$idu.'">'.img('blog.png').' '.Language::config('blogs').' <span>'.$db->fass_c("SELECT COUNT(*) as count FROM `blogs` where `kto` = '".$idu."' ").'</span></a>';
if (User::profile('level') >=3) {
if (User::ID() != $u['id']) {
echo '<a href="/apanel/ban'.$u['id'].'">'.img('add_ban.png').' '.Language::config('add_ban').'</a><a href="/apanel/uedit'.$u['id'].'">'.img('edit_profile.png').' '.Language::config('edit_profile').'</a>';
}
}
echo '</span></div>';
################ WALL ##############
$wall = $db->query("select * from `wall` where `komy` = '".$u['id']."' ORDER BY time DESC");
$tmp->title('title" id="wall', Language::config('wall'));
if(isset($_REQUEST['submit'])){
$message = $db->guard($_POST['message']);
if (empty($message)) $error .= Language::config('no_message');
if (!isset($error)) {
$db->query("INSERT INTO `wall` set `kto` ='".User::ID()."', `komy` = '".$u['id']."', `message` = '".$message."', `time` = '".time()."' ");
header('location: /us'.$u['id'].'#wall');
}
}
if (User::aut()) {
while ($w=$wall->fetch_assoc()){
echo '<div class="news"><div>'.nick_new($w['kto']).' '.((User::ID() == $w['kto'] || User::level() >= 2) ? '<a class="de" href="/us'.$u['id'].'/delete'.$w['id'].'">'.img('delete.png').'</a>' : NULL).'<span class="times">'.times($w['time']).'</span><br/>' .bb(smile($w['message'])).'</div></div><hr>';
}
error($error);
$tmp->div('main', '<form method="POST" action="">'.Language::config('message').':<br/><textarea name="message">'.out($_POST['message']).'</textarea><br/><input type="submit" name="submit" value="'.Language::config('send').'"></form>');
}
$tmp->div('menu', '<hr><a href="/">'.img('link.png').' '.Language::config('home').'</a>');
$tmp->footer();
?>