@@ -2,32 +2,32 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | function sys_avatar_upload($subject_id, &$avatar_field, $prefix = 'avatar') { |
| 4 | 4 | try { |
| 5 | - $avatar_filename = $fullsize_filename = SN_ROOT_PHYSICAL . 'images/avatar/' . $prefix . '_' . $subject_id; |
|
| 5 | + $avatar_filename = $fullsize_filename = SN_ROOT_PHYSICAL.'images/avatar/'.$prefix.'_'.$subject_id; |
|
| 6 | 6 | $avatar_filename .= '.png'; |
| 7 | 7 | $fullsize_filename .= '_full.png'; |
| 8 | - if(sys_get_param_int('avatar_remove')) { |
|
| 9 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
| 8 | + if (sys_get_param_int('avatar_remove')) { |
|
| 9 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
| 10 | 10 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
| 11 | 11 | } |
| 12 | 12 | $avatar_field = 0; |
| 13 | 13 | throw new Exception(classLocale::$lang['opt_msg_avatar_removed'], ERR_NONE); |
| 14 | - } elseif($_FILES['avatar']['size']) { |
|
| 15 | - if(!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) { |
|
| 14 | + } elseif ($_FILES['avatar']['size']) { |
|
| 15 | + if (!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) { |
|
| 16 | 16 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - if($_FILES['avatar']['error']) { |
|
| 19 | + if ($_FILES['avatar']['error']) { |
|
| 20 | 20 | throw new Exception(sprintf(classLocale::$lang['opt_msg_avatar_error_upload'], $_FILES['avatar']['error']), ERR_ERROR); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if(!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) { |
|
| 23 | + if (!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) { |
|
| 24 | 24 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $avatar_size = getimagesize($_FILES['avatar']['tmp_name']); |
| 28 | 28 | $avatar_max_width = classSupernova::$config->avatar_max_width; |
| 29 | 29 | $avatar_max_height = classSupernova::$config->avatar_max_height; |
| 30 | - if($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) { |
|
| 30 | + if ($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) { |
|
| 31 | 31 | $aspect_ratio = min($avatar_max_width / $avatar_size[0], $avatar_max_height / $avatar_size[1]); |
| 32 | 32 | $avatar_image_new = imagecreatetruecolor($avatar_size[0] * $aspect_ratio, $avatar_size[0] * $aspect_ratio); |
| 33 | 33 | $result = imagecopyresized($avatar_image_new, $avatar_image, 0, 0, 0, 0, $avatar_size[0] * $aspect_ratio, $avatar_size[0] * $aspect_ratio, $avatar_size[0], $avatar_size[1]); |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | $avatar_image = $avatar_image_new; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
| 38 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
| 39 | 39 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if(!imagepng($avatar_image, $avatar_filename, 9)) { |
|
| 42 | + if (!imagepng($avatar_image, $avatar_filename, 9)) { |
|
| 43 | 43 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_writing'], ERR_ERROR); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | imagedestroy($avatar_image); |
| 48 | 48 | throw new Exception(classLocale::$lang['opt_msg_avatar_uploaded'], ERR_NONE); |
| 49 | 49 | } |
| 50 | - } catch(Exception $e) { |
|
| 50 | + } catch (Exception $e) { |
|
| 51 | 51 | return array( |
| 52 | 52 | 'STATUS' => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR, |
| 53 | 53 | 'MESSAGE' => $e->getMessage() |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | global $who; |
| 12 | 12 | |
| 13 | 13 | // $sn_group_stat_common = sn_get_groups('STAT_COMMON'); |
| 14 | - foreach($array as $key => $value) { |
|
| 15 | - if($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
| 14 | + foreach ($array as $key => $value) { |
|
| 15 | + if ($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
| 16 | 16 | continue; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | $allow_anonymous = true; |
| 30 | 30 | |
| 31 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 31 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 32 | 32 | |
| 33 | 33 | lng_include('stat'); |
| 34 | 34 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $subject_list = array( |
| 45 | 45 | 1 => array('header' => classLocale::$lang['stat_player']), |
| 46 | 46 | ); |
| 47 | -if(!$source) { |
|
| 47 | +if (!$source) { |
|
| 48 | 48 | $subject_list[2] = array('header' => classLocale::$lang['stat_allys']); |
| 49 | 49 | } |
| 50 | 50 | stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $page_count = floor($record_count / 100); |
| 115 | 115 | $pages = array(); |
| 116 | -for($i = 0; $i <= $page_count; $i++) { |
|
| 116 | +for ($i = 0; $i <= $page_count; $i++) { |
|
| 117 | 117 | $first_element = $i * 100 + 1; |
| 118 | 118 | $last_element = $first_element + 99; |
| 119 | 119 | $pages[$first_element] = array( |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | ); |
| 134 | 134 | //pdump($row); |
| 135 | 135 | |
| 136 | - if($who == 1) { |
|
| 136 | + if ($who == 1) { |
|
| 137 | 137 | $row_stat['ALLY_NAME'] = $row['ally_name']; |
| 138 | 138 | $row_stat['ALLY_ID'] = $row['ally_id']; |
| 139 | 139 | empty($row['username']) ? $row['username'] = $row['name'] : false; |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * Galaxy view |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 9 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 10 | 10 | |
| 11 | 11 | lng_include('universe'); |
| 12 | 12 | lng_include('stat'); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $uni_system = sys_get_param_int('system', $planetrow['system']); |
| 17 | 17 | $planet = sys_get_param_int('planet', $planetrow['planet']); |
| 18 | 18 | |
| 19 | -if($mode == 'name') { |
|
| 19 | +if ($mode == 'name') { |
|
| 20 | 20 | require_once('includes/includes/uni_rename.php'); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $flying_fleet_count = FleetList::fleet_count_flying($user['id']); |
| 39 | 39 | |
| 40 | -if($mode == 1) { |
|
| 41 | -} elseif($mode == 2 || $mode == 3) { |
|
| 40 | +if ($mode == 1) { |
|
| 41 | +} elseif ($mode == 2 || $mode == 3) { |
|
| 42 | 42 | $planet = $planetrow['planet']; |
| 43 | 43 | } else { |
| 44 | 44 | $uni_galaxy = $planetrow['galaxy']; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $planet = $planetrow['planet']; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies? Vector::$knownGalaxies: $uni_galaxy); |
|
| 49 | +$uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > Vector::$knownGalaxies ? Vector::$knownGalaxies : $uni_galaxy); |
|
| 50 | 50 | $uni_system = $uni_system < 1 ? 1 : ($uni_system > Vector::$knownSystems ? Vector::$knownSystems : $uni_system); |
| 51 | 51 | $planet = $planet < 1 ? 1 : ($planet > Vector::$knownPlanets + 1 ? Vector::$knownPlanets + 1 : $planet); |
| 52 | 52 | |
@@ -64,8 +64,8 @@ discard block |
||
| 64 | 64 | $PhalanxRange = GetPhalanxRange($HavePhalanx); |
| 65 | 65 | |
| 66 | 66 | $planet_precache_query = db_planet_list_in_system($uni_galaxy, $uni_system); |
| 67 | -if(!empty($planet_precache_query)) { |
|
| 68 | - foreach($planet_precache_query as $planet_row) { |
|
| 67 | +if (!empty($planet_precache_query)) { |
|
| 68 | + foreach ($planet_precache_query as $planet_row) { |
|
| 69 | 69 | $planet_list[$planet_row['planet']][$planet_row['planet_type']] = $planet_row; |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | * @var Fleet[][][] $fleet_list |
| 84 | 84 | */ |
| 85 | 85 | $fleet_list = array(); |
| 86 | -foreach($system_fleet_list->_container as $objFleetSystem) { |
|
| 87 | - if(!$objFleetSystem->isReturning()) { |
|
| 86 | +foreach ($system_fleet_list->_container as $objFleetSystem) { |
|
| 87 | + if (!$objFleetSystem->isReturning()) { |
|
| 88 | 88 | $fleet_planet = $objFleetSystem->fleet_end_planet; |
| 89 | 89 | $fleet_type = $objFleetSystem->fleet_end_type; |
| 90 | 90 | } else { |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $recycler_info = array(); |
| 100 | 100 | $planet_recyclers_orbiting = 0; |
| 101 | 101 | $recyclers_fleet = array(); |
| 102 | -foreach(sn_get_groups('flt_recyclers') as $recycler_id) { |
|
| 102 | +foreach (sn_get_groups('flt_recyclers') as $recycler_id) { |
|
| 103 | 103 | $recycler_info[$recycler_id] = get_ship_data($recycler_id, $user); |
| 104 | 104 | $recyclers_fleet[$recycler_id] = mrc_get_level($user, $planetrow, $recycler_id); |
| 105 | 105 | $planet_recyclers_orbiting += $recyclers_fleet[$recycler_id]; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $fleet_id = 1; |
| 110 | 110 | $fleets = array(); |
| 111 | 111 | $config_game_max_planet = Vector::$knownPlanets + 1; |
| 112 | -for($Planet = 1; $Planet < $config_game_max_planet; $Planet++) { |
|
| 112 | +for ($Planet = 1; $Planet < $config_game_max_planet; $Planet++) { |
|
| 113 | 113 | unset($uni_galaxyRowPlanet); |
| 114 | 114 | unset($uni_galaxyRowMoon); |
| 115 | 115 | unset($uni_galaxyRowUser); |
@@ -119,27 +119,27 @@ discard block |
||
| 119 | 119 | $uni_galaxyRowPlanet = $planet_list[$Planet][PT_PLANET]; |
| 120 | 120 | |
| 121 | 121 | $planet_fleet_id = 0; |
| 122 | - if($uni_galaxyRowPlanet['destruyed']) { |
|
| 122 | + if ($uni_galaxyRowPlanet['destruyed']) { |
|
| 123 | 123 | CheckAbandonPlanetState($uni_galaxyRowPlanet); |
| 124 | - } elseif($uni_galaxyRowPlanet['id']) { |
|
| 125 | - if($cached['users'][$uni_galaxyRowPlanet['id_owner']]) { |
|
| 124 | + } elseif ($uni_galaxyRowPlanet['id']) { |
|
| 125 | + if ($cached['users'][$uni_galaxyRowPlanet['id_owner']]) { |
|
| 126 | 126 | $uni_galaxyRowUser = $cached['users'][$uni_galaxyRowPlanet['id_owner']]; |
| 127 | 127 | } else { |
| 128 | 128 | $uni_galaxyRowUser = db_user_by_id($uni_galaxyRowPlanet['id_owner']); |
| 129 | 129 | $cached['users'][$uni_galaxyRowUser['id']] = $uni_galaxyRowUser; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if(!$uni_galaxyRowUser['id']) { |
|
| 132 | + if (!$uni_galaxyRowUser['id']) { |
|
| 133 | 133 | classSupernova::$debug->warning("Planet '{$uni_galaxyRowPlanet['name']}' [{$uni_galaxy}:{$uni_system}:{$Planet}] has no owner!", 'Userless planet', 503); |
| 134 | 134 | $uni_galaxyRowPlanet['destruyed'] = SN_TIME_NOW + 60 * 60 * 24; |
| 135 | 135 | $uni_galaxyRowPlanet['id_owner'] = 0; |
| 136 | 136 | db_planet_set_by_id($uni_galaxyRowPlanet['id'], "id_owner = 0, destruyed = {$uni_galaxyRowPlanet['destruyed']}"); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if($uni_galaxyRowUser['id']) { |
|
| 139 | + if ($uni_galaxyRowUser['id']) { |
|
| 140 | 140 | $planetcount++; |
| 141 | - if($uni_galaxyRowUser['ally_id']) { |
|
| 142 | - if($cached['allies'][$uni_galaxyRowUser['ally_id']]) { |
|
| 141 | + if ($uni_galaxyRowUser['ally_id']) { |
|
| 142 | + if ($cached['allies'][$uni_galaxyRowUser['ally_id']]) { |
|
| 143 | 143 | $allyquery = $cached['allies'][$uni_galaxyRowUser['ally_id']]; |
| 144 | 144 | } else { |
| 145 | 145 | $allyquery = db_ally_get_by_id($uni_galaxyRowUser['ally_id']); |
@@ -148,19 +148,19 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_PLANET]); |
| 151 | - if(!empty($fleets_to_planet['own']['count'])) { |
|
| 151 | + if (!empty($fleets_to_planet['own']['count'])) { |
|
| 152 | 152 | $planet_fleet_id = $fleet_id; |
| 153 | 153 | $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id); |
| 154 | 154 | $fleet_id++; |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $uni_galaxyRowMoon = $planet_list[$Planet][PT_MOON]; |
| 158 | - if($uni_galaxyRowMoon['destruyed']) { |
|
| 158 | + if ($uni_galaxyRowMoon['destruyed']) { |
|
| 159 | 159 | CheckAbandonPlanetState($uni_galaxyRowMoon); |
| 160 | 160 | } else { |
| 161 | 161 | $moon_fleet_id = 0; |
| 162 | 162 | $fleets_to_planet = flt_get_fleets_to_planet_by_array_of_Fleet($fleet_list[$Planet][PT_MOON]); |
| 163 | - if(!empty($fleets_to_planet['own']['count'])) { |
|
| 163 | + if (!empty($fleets_to_planet['own']['count'])) { |
|
| 164 | 164 | $moon_fleet_id = $fleet_id; |
| 165 | 165 | $fleets[] = tpl_parse_fleet_sn($fleets_to_planet['own']['total'], $fleet_id); |
| 166 | 166 | $fleet_id++; |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $recyclers_incoming_capacity = 0; |
| 173 | 173 | $uni_galaxyRowPlanet['debris'] = $uni_galaxyRowPlanet['debris_metal'] + $uni_galaxyRowPlanet['debris_crystal']; |
| 174 | - if($uni_galaxyRowPlanet['debris']) { |
|
| 175 | - if(!empty($fleet_list[$Planet][PT_DEBRIS])) { |
|
| 176 | - foreach($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) { |
|
| 177 | - if($objFleetToDebris->playerOwnerId == $user['id']) { |
|
| 174 | + if ($uni_galaxyRowPlanet['debris']) { |
|
| 175 | + if (!empty($fleet_list[$Planet][PT_DEBRIS])) { |
|
| 176 | + foreach ($fleet_list[$Planet][PT_DEBRIS] as $objFleetToDebris) { |
|
| 177 | + if ($objFleetToDebris->playerOwnerId == $user['id']) { |
|
| 178 | 178 | $recyclers_incoming_capacity += $objFleetToDebris->shipsGetCapacityRecyclers($recycler_info); |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -251,21 +251,21 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | tpl_assign_fleet($template, $fleets); |
| 253 | 253 | |
| 254 | -foreach(sn_get_groups('defense_active') as $unit_id) { |
|
| 254 | +foreach (sn_get_groups('defense_active') as $unit_id) { |
|
| 255 | 255 | $template->assign_block_vars('defense_active', array( |
| 256 | 256 | 'ID' => $unit_id, |
| 257 | 257 | 'NAME' => classLocale::$lang['tech'][$unit_id], |
| 258 | 258 | )); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | -foreach($cached['users'] as $PlanetUser) { |
|
| 262 | - if(!$PlanetUser) { |
|
| 261 | +foreach ($cached['users'] as $PlanetUser) { |
|
| 262 | + if (!$PlanetUser) { |
|
| 263 | 263 | continue; |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | $user_ally = $cached['allies'][$PlanetUser['ally_id']]; |
| 267 | - if(isset($user_ally)) { |
|
| 268 | - if($PlanetUser['id'] == $user_ally['ally_owner']) { |
|
| 267 | + if (isset($user_ally)) { |
|
| 268 | + if ($PlanetUser['id'] == $user_ally['ally_owner']) { |
|
| 269 | 269 | $user_rank_title = $user_ally['ally_owner_range']; |
| 270 | 270 | } else { |
| 271 | 271 | $ally_ranks = explode(';', $user_ally['ranklist']); |
@@ -288,8 +288,8 @@ discard block |
||
| 288 | 288 | )); |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | -foreach($cached['allies'] as $PlanetAlly) { |
|
| 292 | - if($PlanetAlly) { |
|
| 291 | +foreach ($cached['allies'] as $PlanetAlly) { |
|
| 292 | + if ($PlanetAlly) { |
|
| 293 | 293 | $template->assign_block_vars('alliances', array( |
| 294 | 294 | 'ID' => $PlanetAlly['id'], |
| 295 | 295 | 'NAME_JS' => js_safe_string($PlanetAlly['ally_name']), |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | //define('SN_RENDER_NAVBAR_PLANET', false); |
| 32 | 32 | |
| 33 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 33 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 34 | 34 | |
| 35 | 35 | // |
| 36 | 36 | ////$player = new Player(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $result = array(); |
| 80 | 80 | |
| 81 | -switch($mode = sys_get_param_str('mode')) { |
|
| 81 | +switch ($mode = sys_get_param_str('mode')) { |
|
| 82 | 82 | case 'manage': |
| 83 | 83 | sn_sys_sector_buy('overview.php?mode=manage'); |
| 84 | 84 | |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | $template = gettemplate('planet_manage', true); |
| 89 | 89 | $planet_id = sys_get_param_id('planet_id'); |
| 90 | 90 | |
| 91 | - if(sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
| 91 | + if (sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
| 92 | 92 | $planetrow['name'] = $new_name; |
| 93 | 93 | // $new_name = db_escape($new_name); |
| 94 | 94 | db_planet_set_by_id($planetrow['id'], "`name` = '{$new_name}'"); |
| 95 | - } elseif(sys_get_param_str('action') == 'make_capital') { |
|
| 95 | + } elseif (sys_get_param_str('action') == 'make_capital') { |
|
| 96 | 96 | try { |
| 97 | 97 | sn_db_transaction_start(); |
| 98 | 98 | $user = db_user_by_id($user['id'], true, '*'); |
@@ -101,15 +101,15 @@ discard block |
||
| 101 | 101 | // $user = $global_data['user']; |
| 102 | 102 | // $planetrow = $global_data['planet']; |
| 103 | 103 | |
| 104 | - if($planetrow['planet_type'] != PT_PLANET) { |
|
| 104 | + if ($planetrow['planet_type'] != PT_PLANET) { |
|
| 105 | 105 | throw new exception(classLocale::$lang['ov_capital_err_not_a_planet'], ERR_ERROR); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if($planetrow['id'] == $user['id_planet']) { |
|
| 108 | + if ($planetrow['id'] == $user['id_planet']) { |
|
| 109 | 109 | throw new exception(classLocale::$lang['ov_capital_err_capital_already'], ERR_ERROR); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - if($user_dark_matter < classSupernova::$config->planet_capital_cost) { |
|
| 112 | + if ($user_dark_matter < classSupernova::$config->planet_capital_cost) { |
|
| 113 | 113 | throw new exception(classLocale::$lang['ov_capital_err_no_dark_matter'], ERR_ERROR); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -126,16 +126,16 @@ discard block |
||
| 126 | 126 | ); |
| 127 | 127 | sn_db_transaction_commit(); |
| 128 | 128 | sys_redirect('overview.php?mode=manage'); |
| 129 | - } catch(exception $e) { |
|
| 129 | + } catch (exception $e) { |
|
| 130 | 130 | sn_db_transaction_rollback(); |
| 131 | 131 | $result[] = array( |
| 132 | 132 | 'STATUS' => $e->getCode(), |
| 133 | 133 | 'MESSAGE' => $e->getMessage(), |
| 134 | 134 | ); |
| 135 | 135 | } |
| 136 | - } elseif(sys_get_param_str('action') == 'planet_teleport') { |
|
| 136 | + } elseif (sys_get_param_str('action') == 'planet_teleport') { |
|
| 137 | 137 | try { |
| 138 | - if(!uni_coordinates_valid($new_coordinates = array( |
|
| 138 | + if (!uni_coordinates_valid($new_coordinates = array( |
|
| 139 | 139 | 'galaxy' => sys_get_param_int('new_galaxy'), |
| 140 | 140 | 'system' => sys_get_param_int('new_system'), |
| 141 | 141 | 'planet' => sys_get_param_int('new_planet'))) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | // $planetrow = $global_data['planet']; |
| 153 | 153 | |
| 154 | 154 | $can_teleport = uni_planet_teleport_check($user, $planetrow, $new_coordinates); |
| 155 | - if($can_teleport['result'] != ERR_NONE) { |
|
| 155 | + if ($can_teleport['result'] != ERR_NONE) { |
|
| 156 | 156 | throw new exception($can_teleport['message'], $can_teleport['result']); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | db_planet_set_by_gspt($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'], PT_ALL, |
| 164 | 164 | "galaxy = {$new_coordinates['galaxy']}, system = {$new_coordinates['system']}, planet = {$new_coordinates['planet']}, planet_teleport_next = {$planet_teleport_next}"); |
| 165 | 165 | |
| 166 | - if($planetrow['id'] == $user['id_planet']) { |
|
| 166 | + if ($planetrow['id'] == $user['id_planet']) { |
|
| 167 | 167 | db_user_set_by_id($user['id'], "galaxy = {$new_coordinates['galaxy']}, system = {$new_coordinates['system']}, planet = {$new_coordinates['planet']}"); |
| 168 | 168 | } |
| 169 | 169 | |
@@ -176,17 +176,17 @@ discard block |
||
| 176 | 176 | 'MESSAGE' => classLocale::$lang['ov_teleport_err_none'], |
| 177 | 177 | ); |
| 178 | 178 | sys_redirect('overview.php?mode=manage'); |
| 179 | - } catch(exception $e) { |
|
| 179 | + } catch (exception $e) { |
|
| 180 | 180 | sn_db_transaction_rollback(); |
| 181 | 181 | $result[] = array( |
| 182 | 182 | 'STATUS' => $e->getCode(), |
| 183 | 183 | 'MESSAGE' => $e->getMessage(), |
| 184 | 184 | ); |
| 185 | 185 | } |
| 186 | - } elseif(sys_get_param_str('action') == 'planet_abandon') { |
|
| 186 | + } elseif (sys_get_param_str('action') == 'planet_abandon') { |
|
| 187 | 187 | // if(sec_password_check($user['id'], sys_get_param('abandon_confirm'))) { |
| 188 | - if(classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) { |
|
| 189 | - if($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) { |
|
| 188 | + if (classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) { |
|
| 189 | + if ($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) { |
|
| 190 | 190 | $destroyed = SN_TIME_NOW + 60 * 60 * 24; |
| 191 | 191 | db_planet_set_by_id($user['current_planet'], "`destruyed`='{$destroyed}', `id_owner`=0"); |
| 192 | 192 | db_planet_set_by_parent($user['current_planet'], "`destruyed`='{$destroyed}', `id_owner`=0"); |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | message(classLocale::$lang['ov_delete_wrong_planet'], classLocale::$lang['colony_abandon'], 'overview.php?mode=manage'); |
| 197 | 197 | } |
| 198 | 198 | } else { |
| 199 | - message(classLocale::$lang['ov_delete_wrong_pass'] , classLocale::$lang['colony_abandon'], 'overview.php?mode=manage'); |
|
| 199 | + message(classLocale::$lang['ov_delete_wrong_pass'], classLocale::$lang['colony_abandon'], 'overview.php?mode=manage'); |
|
| 200 | 200 | } |
| 201 | - } elseif( |
|
| 201 | + } elseif ( |
|
| 202 | 202 | ($hire = sys_get_param_int('hire')) && in_array($hire, sn_get_groups('governors')) |
| 203 | 203 | && ( |
| 204 | 204 | !get_unit_param($hire, P_MAX_STACK) || |
@@ -213,8 +213,8 @@ discard block |
||
| 213 | 213 | $user = db_user_by_id($user['id'], true); |
| 214 | 214 | $planetrow = db_planet_by_id($planetrow['id'], true); |
| 215 | 215 | $build_data = eco_get_build_data($user, $planetrow, $hire, $planetrow['PLANET_GOVERNOR_ID'] == $hire ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0); |
| 216 | - if($build_data['CAN'][BUILD_CREATE]) { |
|
| 217 | - if($planetrow['PLANET_GOVERNOR_ID'] == $hire) { |
|
| 216 | + if ($build_data['CAN'][BUILD_CREATE]) { |
|
| 217 | + if ($planetrow['PLANET_GOVERNOR_ID'] == $hire) { |
|
| 218 | 218 | $planetrow['PLANET_GOVERNOR_LEVEL']++; |
| 219 | 219 | $query = '`PLANET_GOVERNOR_LEVEL` + 1'; |
| 220 | 220 | } else { |
@@ -240,8 +240,8 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | lng_include('mrc_mercenary'); |
| 242 | 242 | int_planet_pretemplate($planetrow, $template); |
| 243 | - foreach(sn_get_groups('governors') as $governor_id) { |
|
| 244 | - if($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) { |
|
| 243 | + foreach (sn_get_groups('governors') as $governor_id) { |
|
| 244 | + if ($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) { |
|
| 245 | 245 | continue; |
| 246 | 246 | } |
| 247 | 247 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | 'PAGE_HINT' => classLocale::$lang['ov_manage_page_hint'], |
| 294 | 294 | )); |
| 295 | 295 | |
| 296 | - foreach($result as &$a_result) { |
|
| 296 | + foreach ($result as &$a_result) { |
|
| 297 | 297 | $template->assign_block_vars('result', $a_result); |
| 298 | 298 | } |
| 299 | 299 | |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | default: |
| 304 | 304 | sn_sys_sector_buy(); |
| 305 | 305 | |
| 306 | - if(sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
| 306 | + if (sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
| 307 | 307 | $planetrow['name'] = $new_name; |
| 308 | 308 | $new_name_safe = db_escape($new_name); |
| 309 | 309 | db_planet_set_by_id($planetrow['id'], "`name` = '{$new_name_safe}'"); |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | |
| 334 | 334 | $planet_count = 0; |
| 335 | 335 | $planets_query = db_planet_list_sorted($user, false, '*'); |
| 336 | - foreach($planets_query as $an_id => $UserPlanet) { |
|
| 336 | + foreach ($planets_query as $an_id => $UserPlanet) { |
|
| 337 | 337 | sn_db_transaction_start(); |
| 338 | 338 | $UserPlanet = sys_o_get_updated($user, $UserPlanet['id'], SN_TIME_NOW, false, true); |
| 339 | 339 | sn_db_transaction_commit(); |
@@ -344,16 +344,16 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | $planet_fleet_id = 0; |
| 346 | 346 | $fleet_list = $template_planet['fleet_list']; |
| 347 | - if($fleet_list['own']['count']) { |
|
| 347 | + if ($fleet_list['own']['count']) { |
|
| 348 | 348 | $planet_fleet_id = "p{$UserPlanet['id']}"; |
| 349 | 349 | $fleets_to_planet[$UserPlanet['id']] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id); |
| 350 | 350 | // $fleet_id++;tpl_parse_fleet_sn |
| 351 | 351 | } |
| 352 | - if($UserPlanet['planet_type'] == PT_MOON) { |
|
| 352 | + if ($UserPlanet['planet_type'] == PT_MOON) { |
|
| 353 | 353 | continue; |
| 354 | 354 | } |
| 355 | 355 | $moon = db_planet_by_parent($UserPlanet['id']); |
| 356 | - if($moon) { |
|
| 356 | + if ($moon) { |
|
| 357 | 357 | $moon_fill = min(100, floor($moon['field_current'] / eco_planet_fields_max($moon) * 100)); |
| 358 | 358 | } else { |
| 359 | 359 | $moon_fill = 0; |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | tpl_assign_fleet($template, $fleets); |
| 394 | 394 | |
| 395 | 395 | $lune = $planetrow['planet_type'] == PT_PLANET ? db_planet_by_parent($planetrow['id']) : db_planet_by_id($planetrow['parent_planet']); |
| 396 | - if($lune) { |
|
| 396 | + if ($lune) { |
|
| 397 | 397 | $template->assign_vars(array( |
| 398 | 398 | 'MOON_ID' => $lune['id'], |
| 399 | 399 | 'MOON_IMG' => $lune['image'], |
@@ -405,15 +405,15 @@ discard block |
||
| 405 | 405 | $planet_fill = $planet_fill > 100 ? 100 : $planet_fill; |
| 406 | 406 | |
| 407 | 407 | $planet_recyclers_orbiting = 0; |
| 408 | - foreach(sn_get_groups('flt_recyclers') as $recycler_id) { |
|
| 408 | + foreach (sn_get_groups('flt_recyclers') as $recycler_id) { |
|
| 409 | 409 | $planet_recyclers_orbiting += mrc_get_level($user, $planetrow, $recycler_id); |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | int_planet_pretemplate($planetrow, $template); |
| 413 | 413 | |
| 414 | 414 | $sn_group_ques = sn_get_groups('ques'); |
| 415 | - if(!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) { |
|
| 416 | - foreach(array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) { |
|
| 415 | + if (!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) { |
|
| 416 | + foreach (array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) { |
|
| 417 | 417 | $this_que = $que['ques'][$que_id][$user['id']][$planetrow['id']]; |
| 418 | 418 | $template->assign_block_vars('ques', array( |
| 419 | 419 | 'ID' => $que_id, |
@@ -421,8 +421,8 @@ discard block |
||
| 421 | 421 | 'LENGTH' => empty($this_que) ? 0 : count($this_que), |
| 422 | 422 | )); |
| 423 | 423 | |
| 424 | - if(!empty($this_que)) { |
|
| 425 | - foreach($this_que as $que_item) { |
|
| 424 | + if (!empty($this_que)) { |
|
| 425 | + foreach ($this_que as $que_item) { |
|
| 426 | 426 | $template->assign_block_vars('que', que_tpl_parse_element($que_item)); |
| 427 | 427 | } |
| 428 | 428 | } |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | 'LENGTH' => $que_hangar_length, |
| 437 | 437 | )); |
| 438 | 438 | |
| 439 | - if(!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) { |
|
| 439 | + if (!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) { |
|
| 440 | 440 | $que_hangar_length = tpl_assign_hangar($template, $planetrow, SUBQUE_DEFENSE); |
| 441 | 441 | $template->assign_block_vars('ques', array( |
| 442 | 442 | 'ID' => SUBQUE_DEFENSE, |
@@ -448,12 +448,12 @@ discard block |
||
| 448 | 448 | $overview_planet_rows = $user['opt_int_overview_planet_rows']; |
| 449 | 449 | $overview_planet_columns = $user['opt_int_overview_planet_columns']; |
| 450 | 450 | |
| 451 | - if($overview_planet_rows <= 0 && $overview_planet_columns <= 0) { |
|
| 451 | + if ($overview_planet_rows <= 0 && $overview_planet_columns <= 0) { |
|
| 452 | 452 | $overview_planet_rows = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_rows']; |
| 453 | 453 | $overview_planet_columns = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_columns']; |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | - if($overview_planet_rows > 0 && $overview_planet_columns <= 0) { |
|
| 456 | + if ($overview_planet_rows > 0 && $overview_planet_columns <= 0) { |
|
| 457 | 457 | $overview_planet_columns = ceil($planet_count / $overview_planet_rows); |
| 458 | 458 | } |
| 459 | 459 | |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | )); |
| 511 | 511 | tpl_set_resource_info($template, $planetrow, $fleets_to_planet, 2); |
| 512 | 512 | |
| 513 | - foreach($result as &$a_result) { |
|
| 513 | + foreach ($result as &$a_result) { |
|
| 514 | 514 | $template->assign_block_vars('result', $a_result); |
| 515 | 515 | } |
| 516 | 516 | |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $id_ref = $_GET['id_ref'] ? intval($_GET['id_ref']) : 0; |
| 4 | -$id_ref = $id_ref ? '?id_ref=' . $id_ref : ''; |
|
| 4 | +$id_ref = $id_ref ? '?id_ref='.$id_ref : ''; |
|
| 5 | 5 | |
| 6 | 6 | header('HTTP/1.1 301 Moved Permanently'); |
| 7 | 7 | header("Location: login.php{$id_ref}#tab_password_reset"); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | global $user, $planetrow; |
| 17 | 17 | |
| 18 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 18 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 19 | 19 | |
| 20 | 20 | lng_include('infos'); |
| 21 | 21 | lng_include('artifacts'); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | die(); |
| 66 | 66 | break; |
| 67 | 67 | } |
| 68 | - message($Message, classLocale::$lang['tech'][UNIT_ARTIFACTS], 'artifacts.' . PHP_EX, 5); |
|
| 68 | + message($Message, classLocale::$lang['tech'][UNIT_ARTIFACTS], 'artifacts.'.PHP_EX, 5); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $template = gettemplate('artifacts', true); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | } else { |
| 38 | 38 | // TODO: This is left for backward compatibility. Appropriate code should be rewrote! |
| 39 | - $func_name = isset(classSupernova::$functions[$func_name]) && is_callable(classSupernova::$functions[$func_name]) ? classSupernova::$functions[$func_name] : ('sn_' . $func_name); |
|
| 39 | + $func_name = isset(classSupernova::$functions[$func_name]) && is_callable(classSupernova::$functions[$func_name]) ? classSupernova::$functions[$func_name] : ('sn_'.$func_name); |
|
| 40 | 40 | if (is_callable($func_name)) { |
| 41 | 41 | $result = call_user_func_array($func_name, $func_arg); |
| 42 | 42 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | function get_exchange_rate($currency_symbol) { |
| 113 | 113 | $currency_symbol = strtolower($currency_symbol); |
| 114 | - $config_field = 'payment_currency_exchange_' . $currency_symbol; |
|
| 114 | + $config_field = 'payment_currency_exchange_'.$currency_symbol; |
|
| 115 | 115 | |
| 116 | 116 | // Заворачиваем получение стоимости ММ через перекрываемую процедуру |
| 117 | 117 | $exchange_rate = floatval($currency_symbol == 'mm_' ? get_mm_cost() : classSupernova::$config->$config_field); |
@@ -623,8 +623,8 @@ discard block |
||
| 623 | 623 | $from = trim($from ? $from : classSupernova::$config->game_adminEmail); |
| 624 | 624 | |
| 625 | 625 | $head = ''; |
| 626 | - $head .= "Content-Type: text/" . ($html ? 'html' : 'plain') . "; charset=utf-8 \r\n"; |
|
| 627 | - $head .= "Date: " . date('r') . " \r\n"; |
|
| 626 | + $head .= "Content-Type: text/".($html ? 'html' : 'plain')."; charset=utf-8 \r\n"; |
|
| 627 | + $head .= "Date: ".date('r')." \r\n"; |
|
| 628 | 628 | $classConfig = classSupernova::$config; |
| 629 | 629 | $head .= "Return-Path: {$classConfig->game_adminEmail} \r\n"; |
| 630 | 630 | $head .= "From: {$from} \r\n"; |
@@ -637,10 +637,10 @@ discard block |
||
| 637 | 637 | $body = str_replace("\n", "\r\n", $body); |
| 638 | 638 | |
| 639 | 639 | if ($html) { |
| 640 | - $body = '<html><head><base href="' . SN_ROOT_VIRTUAL . '"></head><body>' . nl2br($body) . '</body></html>'; |
|
| 640 | + $body = '<html><head><base href="'.SN_ROOT_VIRTUAL.'"></head><body>'.nl2br($body).'</body></html>'; |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | - $title = '=?UTF-8?B?' . base64_encode($title) . '?='; |
|
| 643 | + $title = '=?UTF-8?B?'.base64_encode($title).'?='; |
|
| 644 | 644 | |
| 645 | 645 | return @mail($email_unsafe, $title, $body, $head); |
| 646 | 646 | } |
@@ -656,14 +656,14 @@ discard block |
||
| 656 | 656 | $classLocale = classLocale::$lang; |
| 657 | 657 | |
| 658 | 658 | return |
| 659 | - ($full || $time ? "{$time} {$classLocale['sys_day']} " : '') . |
|
| 660 | - ($full || $hours ? "{$hours} {$classLocale['sys_hrs']} " : '') . |
|
| 661 | - ($full || $minutes ? "{$minutes} {$classLocale['sys_min']} " : '') . |
|
| 659 | + ($full || $time ? "{$time} {$classLocale['sys_day']} " : ''). |
|
| 660 | + ($full || $hours ? "{$hours} {$classLocale['sys_hrs']} " : ''). |
|
| 661 | + ($full || $minutes ? "{$minutes} {$classLocale['sys_min']} " : ''). |
|
| 662 | 662 | ($full || !$time || $seconds ? "{$seconds} {$classLocale['sys_sec']}" : ''); |
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | function sys_time_human_system($time) { |
| 666 | - return $time ? date(FMT_DATE_TIME_SQL, $time) . " ({$time}), " . sys_time_human(SN_TIME_NOW - $time) : '{NEVER}'; |
|
| 666 | + return $time ? date(FMT_DATE_TIME_SQL, $time)." ({$time}), ".sys_time_human(SN_TIME_NOW - $time) : '{NEVER}'; |
|
| 667 | 667 | } |
| 668 | 668 | |
| 669 | 669 | function sys_redirect($url) { |
@@ -756,13 +756,13 @@ discard block |
||
| 756 | 756 | // usw.. |
| 757 | 757 | ); |
| 758 | 758 | |
| 759 | - $rexep = "#" . strtr(preg_quote($format), $masks) . "#"; |
|
| 759 | + $rexep = "#".strtr(preg_quote($format), $masks)."#"; |
|
| 760 | 760 | if (preg_match($rexep, $date, $out)) { |
| 761 | 761 | $ret = array( |
| 762 | - "tm_sec" => (int)$out['S'], |
|
| 763 | - "tm_min" => (int)$out['M'], |
|
| 764 | - "tm_hour" => (int)$out['H'], |
|
| 765 | - "tm_mday" => (int)$out['d'], |
|
| 762 | + "tm_sec" => (int) $out['S'], |
|
| 763 | + "tm_min" => (int) $out['M'], |
|
| 764 | + "tm_hour" => (int) $out['H'], |
|
| 765 | + "tm_mday" => (int) $out['d'], |
|
| 766 | 766 | "tm_mon" => $out['m'] ? $out['m'] - 1 : 0, |
| 767 | 767 | "tm_year" => $out['Y'] > 1900 ? $out['Y'] - 1900 : 0, |
| 768 | 768 | ); |
@@ -832,7 +832,7 @@ discard block |
||
| 832 | 832 | $functions[$function_name] = array(); |
| 833 | 833 | } elseif (!isset($functions[$function_name])) { |
| 834 | 834 | $functions[$function_name] = array(); |
| 835 | - $sn_function_name = 'sn_' . $function_name . ($sub_type ? '_' . $sub_type : ''); |
|
| 835 | + $sn_function_name = 'sn_'.$function_name.($sub_type ? '_'.$sub_type : ''); |
|
| 836 | 836 | $functions[$function_name][] = $sn_function_name; |
| 837 | 837 | } |
| 838 | 838 | |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | } |
| 900 | 900 | |
| 901 | 901 | if (isset($nick_array[NICK_GENDER])) { |
| 902 | - $result[NICK_GENDER] = '<img src="' . ($user['dpath'] ? $user['dpath'] : DEFAULT_SKINPATH) . 'images/gender_' . $nick_array[NICK_GENDER] . '.png" />'; |
|
| 902 | + $result[NICK_GENDER] = '<img src="'.($user['dpath'] ? $user['dpath'] : DEFAULT_SKINPATH).'images/gender_'.$nick_array[NICK_GENDER].'.png" />'; |
|
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | if (isset($nick_array[NICK_AUTH_LEVEL]) || isset($nick_array[NICK_PREMIUM])) { |
@@ -931,14 +931,14 @@ discard block |
||
| 931 | 931 | } |
| 932 | 932 | |
| 933 | 933 | if (isset($nick_array[NICK_CLASS])) { |
| 934 | - $result[NICK_CLASS] = '<span ' . $nick_array[NICK_CLASS] . '>'; |
|
| 934 | + $result[NICK_CLASS] = '<span '.$nick_array[NICK_CLASS].'>'; |
|
| 935 | 935 | $result[NICK_CLASS_END] = '</span>'; |
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | $result[NICK_NICK] = sys_safe_output($nick_array[NICK_NICK]); |
| 939 | 939 | |
| 940 | 940 | if (isset($nick_array[NICK_ALLY])) { |
| 941 | - $result[NICK_ALLY] = '[' . sys_safe_output($nick_array[NICK_ALLY]) . ']'; |
|
| 941 | + $result[NICK_ALLY] = '['.sys_safe_output($nick_array[NICK_ALLY]).']'; |
|
| 942 | 942 | } |
| 943 | 943 | |
| 944 | 944 | $result[NICK_HTML] = true; |
@@ -961,7 +961,7 @@ discard block |
||
| 961 | 961 | */ |
| 962 | 962 | |
| 963 | 963 | |
| 964 | - if ($render_user['user_birthday'] && ($options === true || isset($options['icons']) || isset($options['birthday'])) && (date('Y', SN_TIME_NOW) . date('-m-d', strtotime($render_user['user_birthday'])) == date('Y-m-d', SN_TIME_NOW))) { |
|
| 964 | + if ($render_user['user_birthday'] && ($options === true || isset($options['icons']) || isset($options['birthday'])) && (date('Y', SN_TIME_NOW).date('-m-d', strtotime($render_user['user_birthday'])) == date('Y-m-d', SN_TIME_NOW))) { |
|
| 965 | 965 | $result[NICK_BIRTHSDAY] = ''; |
| 966 | 966 | } |
| 967 | 967 | |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | } |
| 984 | 984 | |
| 985 | 985 | if ((isset($options['class']) && $options['class'])) { |
| 986 | - $result[NICK_CLASS] = (isset($result_options[NICK_CLASS]) ? ' ' . $result_options[NICK_CLASS] : '') . $options['class']; |
|
| 986 | + $result[NICK_CLASS] = (isset($result_options[NICK_CLASS]) ? ' '.$result_options[NICK_CLASS] : '').$options['class']; |
|
| 987 | 987 | } |
| 988 | 988 | |
| 989 | 989 | if ($render_user['ally_tag'] && ($options === true || (isset($options['ally']) && $options['ally']))) { |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | foreach ($temp as $user_id) { |
| 1012 | 1012 | $user_id = floatval($user_id); |
| 1013 | 1013 | if ($user_id) { |
| 1014 | - $user_skip_list[] = '`id` = ' . $user_id; |
|
| 1014 | + $user_skip_list[] = '`id` = '.$user_id; |
|
| 1015 | 1015 | } |
| 1016 | 1016 | } |
| 1017 | 1017 | } |
@@ -1410,7 +1410,7 @@ discard block |
||
| 1410 | 1410 | $time_left = min(floor($time_left / PERIOD_DAY), $term_original); |
| 1411 | 1411 | $cost_left = $term_original > 0 ? ceil($time_left / $term_original * $original_cost) : 0; |
| 1412 | 1412 | |
| 1413 | - array_walk_recursive($result, function (&$value) use ($cost_left) { |
|
| 1413 | + array_walk_recursive($result, function(&$value) use ($cost_left) { |
|
| 1414 | 1414 | $value -= $cost_left; |
| 1415 | 1415 | }); |
| 1416 | 1416 | } |
@@ -1465,7 +1465,7 @@ discard block |
||
| 1465 | 1465 | } |
| 1466 | 1466 | |
| 1467 | 1467 | function print_rr($var, $capture = false) { |
| 1468 | - $print = '<pre>' . htmlspecialchars(print_r($var, true)) . '</pre>'; |
|
| 1468 | + $print = '<pre>'.htmlspecialchars(print_r($var, true)).'</pre>'; |
|
| 1469 | 1469 | if ($capture) { |
| 1470 | 1470 | return $print; |
| 1471 | 1471 | } else { |
@@ -1567,7 +1567,7 @@ discard block |
||
| 1567 | 1567 | break; |
| 1568 | 1568 | } |
| 1569 | 1569 | $sort_option_inverse_closure = $sort_option_inverse ? -1 : 1; |
| 1570 | - usort($ListToSort, function ($a, $b) use ($sort_option_field, $sort_option_inverse_closure) { |
|
| 1570 | + usort($ListToSort, function($a, $b) use ($sort_option_field, $sort_option_inverse_closure) { |
|
| 1571 | 1571 | return $a[$sort_option_field] < $b[$sort_option_field] ? -1 * $sort_option_inverse_closure : ( |
| 1572 | 1572 | $a[$sort_option_field] > $b[$sort_option_field] ? 1 * $sort_option_inverse_closure : 0 |
| 1573 | 1573 | ); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 4 | 4 | |
| 5 | 5 | $template = gettemplate('viewreport', true); |
| 6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
| 3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
| 4 | 4 | |
| 5 | 5 | $template = gettemplate('viewreport', true); |
| 6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |