Просмотр файла element_profile_user.php

Размер файла: 3.16Kb
<?php
require_once './element_options/element_options.php';
	if (!$user) { header('Location: /'); exit; }
	
	if (!$id OR $id == $user['lost_id']) {
		$wear_item = users_wear_item($user['lost_id']);
		$shoot_item = users_shoot_item($user['lost_id']);
	
		$title = 'Мой персонаж';
		require_once './element_include/element_head.php';
		require_once './element_include/element_header_user_true.php';
		require_once './element_include/element_profile_user_true.php';
		require_once './element_include/element_foot_user_true.php';
	} else {
		$profile_user = cache_user($id);
	
			if (!$profile_user) {
				$title = 'Персонаж не найден';
				$error1 = '<span class="small">Выбранный Вами персонаж не существует, либо был удален, если вы считаете это ошибкой, обратитесь пожалуйста в <a class="small yellow" href="/support">техническую поддержку</a></span>';
				require_once 'element_error_page.php';
				exit;
			}
		$nex_level1 = (element_settings_game('lost_max_level') > $profile_user['lost_level']) ? ($profile_user['lost_level'] + 1) : $profile_user['lost_level'];
		$cache_level_nex1 = readcache('element_level_exp'.$nex_level1);
			if (empty($cache_level_nex1)) {
			$cache_level_nex1 = mysql_fetch_array(mysql_query("SELECT `lost_exp` FROM `element_level` WHERE `lost_level` = '$nex_level' LIMIT 1"));
			writecache('element_level_exp'.$nex_level, $cache_level_nex1);
			}
		$wear_item = users_wear_item($profile_user['lost_id']);
		
		$priglashenie = readcache('element_v_gorod_user'.$id);
		$create_level = element_settings_game('lost_town_create_lvl');
		$profile_exp = explode(' ', $profile_user['lost_exp']);
		$title = 'Персонаж "'.$profile_user['lost_login'].'"';
		require_once './element_include/element_head.php';
		require_once './element_include/element_header_user_true.php';
		
			if ($go == 'gorod' AND $user['lost_town'] > 0 AND $profile_user['lost_level'] >= $create_level) {
			if ($town_other[0] < 3 AND $town_other[0] >= 0 AND $profile_user['lost_town'] == 0 AND $profile_user['lost_race'] == $user_town['lost_race'] AND empty($priglashenie)) {
				$priglashenie = array('user_id_kto' => $user['lost_id'], 'lost_town' => $user['lost_town']);
				writecache('element_v_gorod_user'.$id, $priglashenie);
				
				echo '<div class="nf2 small p5 mb5 small cntr lngreen mlra">';
				echo 'Приглашение в город успешно отправлено';
				echo '</div>';
			}
			}
			
		if ($profile_user['lost_town'] > 0) {
			$user_town = cache_town($profile_user['lost_town']);
		}
			
		$user_altar = SetAltar($profile_user['lost_town_altar'], $profile_user['lost_town_altar_time'], $profile_user['lost_town']);
		if ($user_altar['update'] == true) $profile_user = SetParams($profile_user, 0, 0, 0, true);
		
		if ($user['lost_town'] > 0) {
			$user_town = cache_town($user['lost_town']);
			$town_other = explode(':', $user['lost_town_other']);
		}
		
		require_once './element_include/element_profile_user_false.php';
		require_once './element_include/element_foot_user_true.php';
	}
?>