Файл: monst/core/pag/user.php
Строк: 179
<?
//$_users -> update(
// [
// 'id' => 8
// ],
//
// [
// '$set' => [
// 'gold' => 127
// ]
//
// ]
//);
$id = (int)$id;
if ( !$id ) {
g('/main');
}
$selected_user = $_users -> findOne(
[
'id' => $id
]
);
if ( empty($selected_user) ) {
g('/main');
}
upd_loc('view character, <a href="/id'.$id.'"><img src="'.av($id).'" alt="" class="av" style="width: 20px;"/> '.Name($id).'</a>');
if ( $selected_user['id'] == $user['id'] ) {
// quest
$upd = 0;
foreach ($quest as $q) {
if ($q['type'] == 'st' AND $user['st'] >= $q['uniq_id']) {
$quest_db[$q['id']]['count'] = 1;
$upd = 1;
}
}
//
if ( $upd ) {
$_users->update(
[
'id' => $user['id']
],
[
'$set' => [
'quest' => $quest_db
]
]
);
}
}
function user_getItemIcon($item_type) {
global $items;
if ( isset($items[$item_type] ) ) {
?>
<a href='/item<?=$items[$item_type]['id']?>'>
<img src='<?=$items[$item_type]['icon']?>' alt='' title='<?=$items[$item_type]['name']?>' class='item' style='width: 50px;'/>
</a>
<?
}
}
// ---------------------------------------------------------------------------------------------------------------------
if ( isset($_GET['invite_ok']) ) {
?> <?=$lang['user.php']['invite_ok']?><br/><br/> <?
}
if ( isset($_GET['in_clan']) ) {
?> <?=$lang['user.php']['in_clan']?><br/><br/> <?
}
if ( isset($_GET['invite_sended']) ) {
?> <?=$lang['user.php']['invite_sended']?><br/><br/> <?
}
if ( isset($_GET['user_in_group']) ) {
?> <?=$lang['user.php']['user_in_group']?><br/><br/> <?
}
if ( isset($_GET['need_part']) ) {
?> <?=$lang['user.php']['need_part']?><br/><br/> <?
}
if ( $user['id'] == $selected_user['id'] ) {
?>
<div style='text-align: center;'>
<a href='/setting'>
<div style='display: inline-block;'>
<img src='/core/i/menu/setting.png' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['user.php']['micon']['setting']?></span>
</div>
</a>
<a href='/bag'>
<div style='display: inline-block;'>
<img src='/core/i/user/bag.png?1' alt='' width='50'/><br/>
<span class='micon_text'><?=$lang['user.php']['micon']['bag']?></span>
</div>
</a>
</div>
<br/>
<?
}
?>
<br/>
<?
$find = $_item -> find(
[
'user_id' => $id,
'use' => 1
]
);
$items = [];
foreach ( $find as $item ) {
$items[$item['type']] = $item;
}
?>
<div style='text-align: center;'>
<div class='item_div'>
<?=user_getItemIcon(1)?>
</div>
<div class='item_div_center_empty'>
<img src='<?=av($selected_user['id'])?>' alt='' class='av' width='100'/>
<?
$online = Online($selected_user['l_time']);
?>
<div style='position: relative; top: -40px; left: -30px; height: 0; font-size: 50px;'>
<?=$online?>
</div>
<br/>
<span style='font-size: 15px;'><?=Name($selected_user['id'])?></span><br/>
<?
$exp_next_level = $LEVEL[$selected_user['level'] + 1];
$now_exp = $selected_user['exp'];
$exp_perc = floor($now_exp / $exp_next_level * 100);
?>
<span style='font-size: 11px; color: #777;'>
<?=$selected_user['level']?> level, <?=$selected_user['part']?> <?=$lang['user.php']['part']?>
</span>
<br/>
<span style='font-size: 9px; color: #555;'>
<?=num(floor($now_exp))?> (<?=num(floor($exp_next_level))?>), <?=$exp_perc?>%
</span>
<br/>
<br/>
<img src='/core/i/user/hp.png?3' alt='' width='15'/><span class='hp_color'><?=num($selected_user['hp'])?></span>
<img src='/core/i/user/st.png?2' alt='' width='15'/><span class='st_color'><?=num($selected_user['st'])?></span>
<img src='/core/i/user/armor.png?2' alt='' width='15'/><span class='armor_color'><?=num($selected_user['armor'])?></span>
<br/>
<?
// if ( $selected_user['vip_time'] > time() ) {
// ?>
<!-- --><?//=$lang['user.php']['vip']?><!--<br/>-->
<!-- --><?//
// }
if ( isset($selected_user['clan_id']) AND !empty($selected_user['clan_id']) ) {
$c = $_clan -> findOne(
[
'id' => $selected_user['clan_id']
]
);
?>
<br/>
<?
if ( clanicon($c['id']) ) {
?>
<a href='/clan/<?=$c['id']?>'>
<!-- <div class='opacity_backgroundcircle_im'>-->
<img src='<?=clanicon($c['id'])?>' alt='' width='70' class='clan_av'/>
<!-- </div>-->
<br/>
<span style='color: #999;'><?=$c['name']?></span>
</a>
<br/>
<?
} else {
?>
<a href='/clan/<?=$c['id']?>'>
<span style='color: #999;'><?=$c['name']?></span>
</a>
<br/>
<?
}
?>
<br/>
<?
}
?>
</div>
<div class='item_div'>
<?=user_getItemIcon(5)?>
</div>
<br/>
<div class='item_div'>
<?=user_getItemIcon(2)?>
</div>
<div class='item_div_center_empty'>
</div>
<div class='item_div'>
<?=user_getItemIcon(4)?>
</div>
<br/>
<div class='item_div'>
<?=user_getItemIcon(3)?>
</div>
<div class='item_div_center_empty'>
</div>
<div class='item_div'>
<?=user_getItemIcon(6)?>
</div>
<br/>
<div class='item_div_empty'>
</div>
<div class='item_div_center_empty'>
</div>
<div class='item_div'>
<?=user_getItemIcon(7)?>
</div>
<br/>
<div class='item_div'>
<?=user_getItemIcon(11)?>
</div>
<div class='item_div_center_empty'>
</div>
<div class='item_div'>
<?=user_getItemIcon(10)?>
</div>
<br/>
<div class='item_div'>
<?=user_getItemIcon(12)?>
</div>
<div class='item_div_center_empty'>
</div>
<div class='item_div'>
<?=user_getItemIcon(13)?>
</div>
<br/>
<div class='item_div'>
<?=user_getItemIcon(8)?>
</div>
<div class='item_div_center_empty'>
</div>
<div class='item_div'>
<?=user_getItemIcon(9)?>
</div>
</div>
<br/>
<div class='padding'>
<?
if ( $GROUP AND $GROUP['leader_id'] == $user['id'] ) {
if ( !$selected_user['group_id'] ) {
?>
<?=$lang['user.php']['no_group']?><br/>
<?
if ( $id != $user['id'] ) {
?>
<a href='/group?invite_user&user_id=<?=$selected_user['id']?>'><?=$lang['user.php']['group_invite']?></a>
<?
}
?>
<br/>
<?
}
}
?>
</div>
<?
$find = $_woodh -> findOne(
[
'user_id' => $selected_user['id']
]
);
if ( $find ) {
?>
<div class='padding'>
<img src='/core/i/woodh/zzz_1.png' alt='' width='30'/> <?=$lang['user.php']['is_sleep']?>
</div>
<?
}
if ( isset($selected_user['about']) AND !empty($selected_user['about']) ) {
$about = $selected_user['about'];
$about = str_replace("rnrnrnrn", "", $about);
$about = nl2br($about);
?>
<br/>
<div class='padding'>
<?=$about?>
</div>
<?
}
if ( $selected_user['id'] != $user['id'] ) {
?>
<!-- <div class='padding'>-->
<br/><br/>
<a href='/dialog/new/<?=$selected_user['id']?>'>
<div class='bt_black'>
<img src='/core/i/menu/dialog.png' alt='' width='15'/>
<span style='color: #999;'><?=$lang['user.php']['send_letter']?></span>
</div>
</a>
<!-- </div>-->
<?
}
if ( @!$selected_user['clan_id'] AND @$clan AND @$clan['master_id'] == $user['id'] ) {
?>
<a href='/clan/invite/<?=$selected_user['id']?>?send'><div class='bt_black'><?=$lang['user.php']['invite_to_clan']?></div></a>
<?
}
?>
<?
if ( $user['id'] == 1 ) {
?>
<br/>
<br/>
<div class='padding'>
Useragent: <?=$selected_user['user_agent']?><br/>
IP: <?=$selected_user['ip']?><br/>
<?
if ( isset($selected_user['referer']) AND !empty($selected_user['referer']) ) {
?>
Referer: <?=$selected_user['referer']?><br/>
<?
}
if ( isset($selected_user['from']) AND !empty($selected_user['from']) ) {
?>
Откуда пришёл: <?=$selected_user['from']?><br/>
<?
}
?>
<br/>
<a href='/cp/user/<?=$selected_user['id']?>'>Редактировать в Control panel</a>
</div>
<?
}
?>