@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) { |
|
| 3 | +if ((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) { |
|
| 4 | 4 | $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
| 5 | 5 | } |
| 6 | 6 | |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | // $dm_db_name = pname_resource_name(RES_DARK_MATTER); |
| 29 | 29 | $exchangeTo = in_array($exchangeTo = sys_get_param_int('exchangeTo'), sn_get_groups('resources_trader')) ? $exchangeTo : 0; |
| 30 | - if($exchangeTo && is_array($tradeList = $_POST['spend'])) { |
|
| 30 | + if ($exchangeTo && is_array($tradeList = $_POST['spend'])) { |
|
| 31 | 31 | $value = 0; |
| 32 | 32 | $qry = array(); |
| 33 | 33 | |
| 34 | 34 | sn_db_transaction_start(); |
| 35 | - if($planetrow['id_owner']) { |
|
| 35 | + if ($planetrow['id_owner']) { |
|
| 36 | 36 | $global_data = sys_o_get_updated($user, $planetrow, SN_TIME_NOW); |
| 37 | 37 | $planetrow = $global_data['planet']; |
| 38 | 38 | } |
@@ -41,27 +41,27 @@ discard block |
||
| 41 | 41 | $user = db_user_by_id($user['id'], true); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - foreach(sn_get_groups('resources_trader') as $resource_id) { |
|
| 44 | + foreach (sn_get_groups('resources_trader') as $resource_id) { |
|
| 45 | 45 | $amount = floatval($tradeList[$resource_id]); |
| 46 | - if($amount < 0) { |
|
| 46 | + if ($amount < 0) { |
|
| 47 | 47 | $debug->error('Trying to supply negative resource amount on Black Market Page', 'Hack Attempt', 305); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) { |
|
| 50 | + if ($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) { |
|
| 51 | 51 | continue; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | $resource_db_name = pname_resource_name($resource_id); |
| 55 | - if($exchangeTo == RES_DARK_MATTER) { |
|
| 55 | + if ($exchangeTo == RES_DARK_MATTER) { |
|
| 56 | 56 | $sign = '+'; |
| 57 | 57 | $amount = floor($tradeList[RES_DARK_MATTER] / 3 * $rates[RES_DARK_MATTER] / $rates[$resource_id]); |
| 58 | 58 | $value += $amount; |
| 59 | 59 | } else { |
| 60 | 60 | $value += floor($amount * $rates[$resource_id] / $rates[$exchangeTo]); |
| 61 | - if($resource_id == RES_DARK_MATTER) { |
|
| 61 | + if ($resource_id == RES_DARK_MATTER) { |
|
| 62 | 62 | $amount = 0; |
| 63 | 63 | } else { |
| 64 | - if(mrc_get_level($user, $planetrow, $resource_id, true) < $amount) { |
|
| 64 | + if (mrc_get_level($user, $planetrow, $resource_id, true) < $amount) { |
|
| 65 | 65 | $intError = MARKET_NO_RESOURCES; |
| 66 | 66 | break; |
| 67 | 67 | } |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if($amount) { |
|
| 73 | + if ($amount) { |
|
| 74 | 74 | $qry[] = "`{$resource_db_name}` = `{$resource_db_name}` {$sign} {$amount}"; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if($exchangeTo != RES_DARK_MATTER) { |
|
| 78 | + if ($exchangeTo != RES_DARK_MATTER) { |
|
| 79 | 79 | $amount = floor($value); |
| 80 | 80 | $exchange_to_db_name = pname_resource_name($exchangeTo); |
| 81 | 81 | $qry[] = "`{$exchange_to_db_name}` = `{$exchange_to_db_name}` + {$amount}"; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $intError = $value <= 0 ? MARKET_ZERO_DEAL : $intError; |
| 87 | 87 | $intError = mrc_get_level($user, null, RES_DARK_MATTER) < $operation_cost ? MARKET_NO_DM : $intError; |
| 88 | 88 | |
| 89 | - if($intError == MARKET_DEAL) { |
|
| 89 | + if ($intError == MARKET_DEAL) { |
|
| 90 | 90 | $qry = implode(', ', $qry); |
| 91 | 91 | $table = $planetrow['id_owner'] ? 'planets' : 'users'; |
| 92 | 92 | |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | 'EXCHANGE_TO_RESOURCE_ID' => $exchangeTo, |
| 112 | 112 | )); |
| 113 | 113 | |
| 114 | - foreach(sn_get_groups('resources_trader') as $resource_id) { |
|
| 115 | - if($resource_id == RES_DARK_MATTER) { |
|
| 114 | + foreach (sn_get_groups('resources_trader') as $resource_id) { |
|
| 115 | + if ($resource_id == RES_DARK_MATTER) { |
|
| 116 | 116 | $amount = floor(mrc_get_level($user, null, RES_DARK_MATTER) - $config->rpg_cost_trader); |
| 117 | 117 | } else { |
| 118 | 118 | $amount = floor(mrc_get_level($user, $planetrow, $resource_id)); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | $query = db_user_list_to_celebrate($config->user_birthday_range); |
| 10 | 10 | |
| 11 | - while($row = db_fetch($query)) |
|
| 11 | + while ($row = db_fetch($query)) |
|
| 12 | 12 | { |
| 13 | 13 | $row['username'] = db_escape($row['username']); |
| 14 | 14 | rpg_points_change($row['id'], RPG_BIRTHDAY, $config->user_birthday_gift, "Birthday gift for user {$row['username']} ID {$row['id']} on his birthday on {$row['user_birthday']}. Gift last gaved at {$row['user_birthday_celebrated']}"); |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | print($round); |
| 28 | 28 | print('<table border=1>'); |
| 29 | 29 | print('<tr align="left">'); |
| 30 | - foreach($header as $key => $value) |
|
| 30 | + foreach ($header as $key => $value) |
|
| 31 | 31 | { |
| 32 | - if(is_array($value)) |
|
| 32 | + if (is_array($value)) |
|
| 33 | 33 | { |
| 34 | 34 | continue; |
| 35 | 35 | } |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | ); |
| 62 | 62 | |
| 63 | 63 | print('<tr align="right">'); |
| 64 | - foreach($debug_unit_crossfire_result as $key => $value) |
|
| 64 | + foreach ($debug_unit_crossfire_result as $key => $value) |
|
| 65 | 65 | { |
| 66 | - if(is_array($value)) |
|
| 66 | + if (is_array($value)) |
|
| 67 | 67 | { |
| 68 | 68 | continue; |
| 69 | 69 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | 'START_NAME' => $planetrow['name'], |
| 28 | 28 | ); |
| 29 | 29 | |
| 30 | - if(!empty($TargetPlanet)) { |
|
| 30 | + if (!empty($TargetPlanet)) { |
|
| 31 | 31 | $template_route += array( |
| 32 | 32 | 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']], |
| 33 | 33 | 'END_COORDS' => uni_render_coordinates($TargetPlanet), |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | $template->assign_block_vars('fleets', $template_route); |
| 39 | 39 | |
| 40 | 40 | $sn_groups_fleet = sn_get_groups('fleet'); |
| 41 | - foreach($fleetarray as $ship_id => $ship_count) { |
|
| 42 | - if(in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
| 41 | + foreach ($fleetarray as $ship_id => $ship_count) { |
|
| 42 | + if (in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
| 43 | 43 | // $ship_base_data = get_ship_data($ship_id, $user); |
| 44 | 44 | $template->assign_block_vars('fleets.ships', array( |
| 45 | 45 | 'ID' => $ship_id, |
@@ -57,11 +57,10 @@ discard block |
||
| 57 | 57 | $fleet_capacity += get_unit_param($Ship, P_CAPACITY) * $Count; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : |
|
| 61 | - (isset($missiontype[MT_HOLD]) ? 12 : 0); |
|
| 62 | - if($max_duration) { |
|
| 60 | + $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : (isset($missiontype[MT_HOLD]) ? 12 : 0); |
|
| 61 | + if ($max_duration) { |
|
| 63 | 62 | $config_game_speed_expedition = ($target_mission == MT_EXPLORE && $config->game_speed_expedition ? $config->game_speed_expedition : 1); |
| 64 | - for($i = 1; $i <= $max_duration; $i++) { |
|
| 63 | + for ($i = 1; $i <= $max_duration; $i++) { |
|
| 65 | 64 | $template->assign_block_vars('duration', array( |
| 66 | 65 | 'ID' => $i, |
| 67 | 66 | 'TIME' => pretty_time(ceil($i * 3600 / $config_game_speed_expedition)), |
@@ -80,7 +79,7 @@ discard block |
||
| 80 | 79 | // $TableTitle = uni_render_planet_full($planetrow) . ' => ' . uni_render_planet_full($temp); |
| 81 | 80 | |
| 82 | 81 | $sn_group_resources = sn_get_groups('resources'); |
| 83 | - for($i = 0; $i<3; $i++) { |
|
| 82 | + for ($i = 0; $i < 3; $i++) { |
|
| 84 | 83 | $amount = $planetrow[$sn_group_resources[$i]] - ($i == 2 ? $consumption : 0); |
| 85 | 84 | $template->assign_block_vars('resources', array( |
| 86 | 85 | 'ID' => $i, |
@@ -90,7 +89,7 @@ discard block |
||
| 90 | 89 | )); |
| 91 | 90 | } |
| 92 | 91 | |
| 93 | - if($sn_module['unit_captain']->manifest['active'] && ($captain = $sn_module['unit_captain']->unit_captain_get($planetrow['id'])) && $captain['unit_location_type'] == LOC_PLANET) { |
|
| 92 | + if ($sn_module['unit_captain']->manifest['active'] && ($captain = $sn_module['unit_captain']->unit_captain_get($planetrow['id'])) && $captain['unit_location_type'] == LOC_PLANET) { |
|
| 94 | 93 | $template->assign_vars(array( |
| 95 | 94 | 'CAPTAIN_ID' => $captain['unit_id'], |
| 96 | 95 | 'CAPTAIN_LEVEL' => $captain['captain_level'], |
@@ -111,9 +110,9 @@ discard block |
||
| 111 | 110 | // 'TableTitle' => $TableTitle, |
| 112 | 111 | |
| 113 | 112 | 'speedallsmin' => sys_get_param_float('speedallsmin'), |
| 114 | - 'speed' => sys_get_param_int('speed') , |
|
| 113 | + 'speed' => sys_get_param_int('speed'), |
|
| 115 | 114 | |
| 116 | - 'fleet_group' => sys_get_param_id('fleet_group') , |
|
| 115 | + 'fleet_group' => sys_get_param_id('fleet_group'), |
|
| 117 | 116 | 'acs_target_mr' => sys_get_param_str('acs_target_mr'), |
| 118 | 117 | |
| 119 | 118 | 'MAX_DURATION' => $max_duration, |
@@ -4,9 +4,9 @@ discard block |
||
| 4 | 4 | { |
| 5 | 5 | $strPacked = "{$type}!"; |
| 6 | 6 | |
| 7 | - foreach($combat as $fleetID => $fleetCompress) |
|
| 7 | + foreach ($combat as $fleetID => $fleetCompress) |
|
| 8 | 8 | { |
| 9 | - foreach($fleetCompress as $key => $value) |
|
| 9 | + foreach ($fleetCompress as $key => $value) |
|
| 10 | 10 | { |
| 11 | 11 | $value = intval($value); |
| 12 | 12 | $strPacked .= "{$key},{$value};"; |
@@ -22,29 +22,29 @@ discard block |
||
| 22 | 22 | $fleet_id = 0; |
| 23 | 23 | |
| 24 | 24 | $arr_data_unpacked = explode('!', $str_data); |
| 25 | - foreach($arr_data_unpacked as $data_piece) |
|
| 25 | + foreach ($arr_data_unpacked as $data_piece) |
|
| 26 | 26 | { |
| 27 | - if(!$data_piece) |
|
| 27 | + if (!$data_piece) |
|
| 28 | 28 | { |
| 29 | 29 | continue; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if($data_piece == 'A' || $data_piece == 'D') |
|
| 32 | + if ($data_piece == 'A' || $data_piece == 'D') |
|
| 33 | 33 | { |
| 34 | 34 | $fleet_type = $data_piece; |
| 35 | 35 | continue; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $arr_unit_strings = explode(';', $data_piece); |
| 39 | - foreach($arr_unit_strings as $str_unit_string) |
|
| 39 | + foreach ($arr_unit_strings as $str_unit_string) |
|
| 40 | 40 | { |
| 41 | - if(!$str_unit_string) |
|
| 41 | + if (!$str_unit_string) |
|
| 42 | 42 | { |
| 43 | 43 | continue; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $arr_unit_data = explode(',', $str_unit_string); |
| 47 | - if($arr_unit_data[1]) |
|
| 47 | + if ($arr_unit_data[1]) |
|
| 48 | 48 | { |
| 49 | 49 | $unpacked[$fleet_type][$fleet_id][$arr_unit_data[0]] = intval($arr_unit_data[1]); |
| 50 | 50 | } |
@@ -64,48 +64,48 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $player_id = $player_id == -1 ? count($combat_data[UBE_PLAYERS]) : $player_id; |
| 66 | 66 | |
| 67 | - foreach($side_info as $fleet_data) |
|
| 67 | + foreach ($side_info as $fleet_data) |
|
| 68 | 68 | { |
| 69 | 69 | $combat_data[UBE_PLAYERS][$player_id][UBE_NAME] = $attacker ? 'Attacker' : 'Defender'; |
| 70 | 70 | $combat_data[UBE_PLAYERS][$player_id][UBE_ATTACKER] = $attacker; |
| 71 | 71 | |
| 72 | 72 | $combat_data[UBE_FLEETS][$player_id][UBE_OWNER] = $player_id; |
| 73 | - foreach($fleet_data as $unit_id => $unit_count) |
|
| 73 | + foreach ($fleet_data as $unit_id => $unit_count) |
|
| 74 | 74 | { |
| 75 | - if(!$unit_count) |
|
| 75 | + if (!$unit_count) |
|
| 76 | 76 | { |
| 77 | 77 | continue; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $unit_type = get_unit_param($unit_id, P_UNIT_TYPE); |
| 81 | 81 | |
| 82 | - if($unit_type == UNIT_SHIPS || $unit_type == UNIT_DEFENCE) |
|
| 82 | + if ($unit_type == UNIT_SHIPS || $unit_type == UNIT_DEFENCE) |
|
| 83 | 83 | { |
| 84 | 84 | $combat_data[UBE_FLEETS][$player_id][UBE_COUNT][$unit_id] = $unit_count; |
| 85 | 85 | } |
| 86 | - elseif($unit_type == UNIT_RESOURCES) |
|
| 86 | + elseif ($unit_type == UNIT_RESOURCES) |
|
| 87 | 87 | { |
| 88 | 88 | $combat_data[UBE_FLEETS][$player_id][UBE_RESOURCES][$unit_id] = $unit_count; |
| 89 | 89 | } |
| 90 | - elseif($unit_type == UNIT_TECHNOLOGIES) |
|
| 90 | + elseif ($unit_type == UNIT_TECHNOLOGIES) |
|
| 91 | 91 | { |
| 92 | 92 | $combat_data[UBE_PLAYERS][$player_id][UBE_BONUSES][$ube_convert_techs[$unit_id]] += $unit_count * get_unit_param($unit_id, P_BONUS_VALUE) / 100; |
| 93 | 93 | } |
| 94 | - elseif($unit_type == UNIT_GOVERNORS) |
|
| 94 | + elseif ($unit_type == UNIT_GOVERNORS) |
|
| 95 | 95 | { |
| 96 | - if($unit_id == MRC_FORTIFIER) |
|
| 96 | + if ($unit_id == MRC_FORTIFIER) |
|
| 97 | 97 | { |
| 98 | - foreach($ube_convert_techs as $ube_id) |
|
| 98 | + foreach ($ube_convert_techs as $ube_id) |
|
| 99 | 99 | { |
| 100 | 100 | $combat_data[UBE_FLEETS][$player_id][UBE_BONUSES][$ube_id] += $unit_count * get_unit_param($unit_id, P_BONUS_VALUE) / 100; |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | - elseif($unit_type == UNIT_MERCENARIES) |
|
| 104 | + elseif ($unit_type == UNIT_MERCENARIES) |
|
| 105 | 105 | { |
| 106 | - if($unit_id == MRC_ADMIRAL) |
|
| 106 | + if ($unit_id == MRC_ADMIRAL) |
|
| 107 | 107 | { |
| 108 | - foreach($ube_convert_techs as $ube_id) |
|
| 108 | + foreach ($ube_convert_techs as $ube_id) |
|
| 109 | 109 | { |
| 110 | 110 | $combat_data[UBE_PLAYERS][$player_id][UBE_BONUSES][$ube_id] += $unit_count * get_unit_param($unit_id, P_BONUS_VALUE) / 100; |
| 111 | 111 | } |
@@ -17,12 +17,12 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | global $lang; |
| 19 | 19 | |
| 20 | - $TargetAdress = sprintf ($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']); |
|
| 20 | + $TargetAdress = sprintf($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']); |
|
| 21 | 21 | |
| 22 | 22 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
| 23 | 23 | |
| 24 | 24 | $TheMessage = $lang['sys_colo_no_colonizer']; |
| 25 | - if($fleet_array[SHIP_COLONIZER] >= 1) |
|
| 25 | + if ($fleet_array[SHIP_COLONIZER] >= 1) |
|
| 26 | 26 | { |
| 27 | 27 | $TheMessage = $lang['sys_colo_notfree']; |
| 28 | 28 | if (!$mission_data['dst_planet'] || empty($mission_data['dst_planet'])) |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | // Can we colonize more planets? |
| 33 | 33 | $TheMessage = $lang['sys_colo_maxcolo']; |
| 34 | - if($iPlanetCount < get_player_max_colonies($src_user_row)) |
|
| 34 | + if ($iPlanetCount < get_player_max_colonies($src_user_row)) |
|
| 35 | 35 | { |
| 36 | 36 | // Yes, we can colonize |
| 37 | 37 | $TheMessage = $lang['sys_colo_badpos']; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | if ($NewOwnerPlanet) |
| 43 | 43 | { |
| 44 | 44 | $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok']; |
| 45 | - msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); |
|
| 45 | + msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); |
|
| 46 | 46 | |
| 47 | 47 | $fleet_array[SHIP_COLONIZER]--; |
| 48 | 48 | $fleet_row['fleet_amount']--; |
@@ -9,28 +9,28 @@ discard block |
||
| 9 | 9 | $avatar_filename = $fullsize_filename = SN_ROOT_PHYSICAL . 'images/avatar/' . $prefix . '_' . $subject_id; |
| 10 | 10 | $avatar_filename .= '.png'; |
| 11 | 11 | $fullsize_filename .= '_full.png'; |
| 12 | - if(sys_get_param_int('avatar_remove')) |
|
| 12 | + if (sys_get_param_int('avatar_remove')) |
|
| 13 | 13 | { |
| 14 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
| 14 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
| 15 | 15 | { |
| 16 | 16 | throw new Exception($lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
| 17 | 17 | } |
| 18 | 18 | $avatar_field = 0; |
| 19 | 19 | throw new Exception($lang['opt_msg_avatar_removed'], ERR_NONE); |
| 20 | 20 | } |
| 21 | - elseif($_FILES['avatar']['size']) |
|
| 21 | + elseif ($_FILES['avatar']['size']) |
|
| 22 | 22 | { |
| 23 | - if(!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) |
|
| 23 | + if (!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) |
|
| 24 | 24 | { |
| 25 | 25 | throw new Exception($lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - if($_FILES['avatar']['error']) |
|
| 28 | + if ($_FILES['avatar']['error']) |
|
| 29 | 29 | { |
| 30 | 30 | throw new Exception(sprintf($lang['opt_msg_avatar_error_upload'], $_FILES['avatar']['error']), ERR_ERROR); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if(!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) |
|
| 33 | + if (!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) |
|
| 34 | 34 | { |
| 35 | 35 | throw new Exception($lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
| 36 | 36 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $avatar_size = getimagesize($_FILES['avatar']['tmp_name']); |
| 39 | 39 | $avatar_max_width = $config-> avatar_max_width; |
| 40 | 40 | $avatar_max_height = $config-> avatar_max_height; |
| 41 | - if($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) |
|
| 41 | + if ($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) |
|
| 42 | 42 | { |
| 43 | 43 | $aspect_ratio = min($avatar_max_width / $avatar_size[0], $avatar_max_height / $avatar_size[1]); |
| 44 | 44 | $avatar_image_new = imagecreatetruecolor($avatar_size[0] * $aspect_ratio, $avatar_size[0] * $aspect_ratio); |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | $avatar_image = $avatar_image_new; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
| 50 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
| 51 | 51 | { |
| 52 | 52 | throw new Exception($lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - if(!imagepng($avatar_image, $avatar_filename, 9)) |
|
| 55 | + if (!imagepng($avatar_image, $avatar_filename, 9)) |
|
| 56 | 56 | { |
| 57 | 57 | throw new Exception($lang['opt_msg_avatar_error_writing'], ERR_ERROR); |
| 58 | 58 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | |
| 10 | -function flt_planet_capture(&$fleet_row, &$combat_data) {return sn_function_call('flt_planet_capture', array(&$fleet_row, &$combat_data, &$result));} |
|
| 10 | +function flt_planet_capture(&$fleet_row, &$combat_data) {return sn_function_call('flt_planet_capture', array(&$fleet_row, &$combat_data, &$result)); } |
|
| 11 | 11 | function sn_flt_planet_capture(&$fleet_row, &$combat_data, &$result) { |
| 12 | 12 | return $result; |
| 13 | 13 | } |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | $destination_user = $mission_data['dst_user']; |
| 18 | 18 | $destination_planet = $mission_data['dst_planet']; |
| 19 | 19 | |
| 20 | - if(!$fleet_row) { |
|
| 20 | + if (!$fleet_row) { |
|
| 21 | 21 | return null; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - if( |
|
| 24 | + if ( |
|
| 25 | 25 | // Нет данных о планете назначения или её владельце |
| 26 | 26 | empty($destination_user) || empty($destination_planet) || !is_array($destination_user) || !is_array($destination_planet) |
| 27 | 27 | || |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | $combat_data = sn_ube_report_load(sys_get_param_str('cypher')); |
| 17 | 17 | |
| 18 | - if($combat_data != UBE_REPORT_NOT_FOUND) { |
|
| 18 | + if ($combat_data != UBE_REPORT_NOT_FOUND) { |
|
| 19 | 19 | sn_ube_report_generate($combat_data, $template_result); |
| 20 | 20 | $template = gettemplate('ube_combat_report', $template); |
| 21 | 21 | $template->assign_vars(array( |