@@ -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 | } |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | $mode = sys_get_param_escaped('mode'); |
| 22 | 22 | $mode = (!$mode || $mode == 'buildings') ? QUE_STRUCTURES : ($mode == 'fleet' ? SUBQUE_FLEET : ($mode == 'defense' ? SUBQUE_DEFENSE : ($mode == 'research' ? QUE_RESEARCH : $mode))); |
| 23 | 23 | |
| 24 | -if($building_sort = sys_get_param_id('sort_elements')) { |
|
| 25 | - if(!empty(classLocale::$lang['player_option_building_sort'][$building_sort])) { |
|
| 24 | +if ($building_sort = sys_get_param_id('sort_elements')) { |
|
| 25 | + if (!empty(classLocale::$lang['player_option_building_sort'][$building_sort])) { |
|
| 26 | 26 | classSupernova::$user_options[array(PLAYER_OPTION_BUILDING_SORT, $mode)] = $building_sort; |
| 27 | 27 | classSupernova::$user_options[array(PLAYER_OPTION_BUILDING_SORT_INVERSE, $mode)] = sys_get_param_id('sort_elements_inverse', 0); |
| 28 | 28 | } |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | function sn_admin_planet_edit_template(&$template, $edit_planet_row, $mode) { |
| 23 | 23 | $unit_list = sn_get_groups($mode); |
| 24 | - if(empty($unit_list)) { |
|
| 24 | + if (empty($unit_list)) { |
|
| 25 | 25 | return; |
| 26 | 26 | } |
| 27 | 27 | $name_list = classLocale::$lang['tech']; |
| 28 | 28 | |
| 29 | - foreach($unit_list as $unit_id) { |
|
| 29 | + foreach ($unit_list as $unit_id) { |
|
| 30 | 30 | $template->assign_block_vars('unit', array( |
| 31 | 31 | 'ID' => $unit_id, |
| 32 | 32 | 'NAME' => $name_list[$unit_id], |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | function admin_planet_edit_query_string($unit_id, $unit_amount, $mode) { return sn_function_call(__FUNCTION__, array($unit_id, $unit_amount, $mode)); } |
| 40 | 40 | |
| 41 | 41 | function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode) { |
| 42 | - if($unit_amount && in_array($unit_id, sn_get_groups($mode))) { |
|
| 42 | + if ($unit_amount && in_array($unit_id, sn_get_groups($mode))) { |
|
| 43 | 43 | $unit_amount = round($unit_amount); |
| 44 | 44 | $unit_name = get_unit_param($unit_id, P_NAME); |
| 45 | 45 | $result = "{$unit_name} = GREATEST(0, {$unit_name} + ({$unit_amount}))"; |
@@ -47,20 +47,20 @@ discard block |
||
| 47 | 47 | )); |
| 48 | 48 | |
| 49 | 49 | $ActualProd = floor($Prod[$BuildID]); |
| 50 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 50 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 51 | 51 | $ActualNeed = floor($Prod[STRUC_MINE_SOLAR]); |
| 52 | 52 | } else { |
| 53 | 53 | $ActualNeed = floor($Prod[STRUC_MINE_DEUTERIUM]); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $BuildStartLvl = $CurrentBuildtLvl - 2; |
| 57 | - if($BuildStartLvl < 1) { |
|
| 57 | + if ($BuildStartLvl < 1) { |
|
| 58 | 58 | $BuildStartLvl = 1; |
| 59 | 59 | } |
| 60 | 60 | $Table = ''; |
| 61 | 61 | $ProdFirst = 0; |
| 62 | - for($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
| 63 | - if($BuildID != STRUC_MOON_PHALANX) { |
|
| 62 | + for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
| 63 | + if ($BuildID != STRUC_MOON_PHALANX) { |
|
| 64 | 64 | $Prod[STRUC_MINE_METAL] = floor(mrc_modify_value( |
| 65 | 65 | $CurrentUser, |
| 66 | 66 | $CurrentPlanet, |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | )); |
| 88 | 88 | |
| 89 | 89 | $bloc['build_lvl'] = ($CurrentBuildtLvl == $BuildLevel) ? "<font color=\"#ff0000\">" . $BuildLevel . "</font>" : $BuildLevel; |
| 90 | - if($ProdFirst > 0) { |
|
| 91 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 90 | + if ($ProdFirst > 0) { |
|
| 91 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 92 | 92 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[$BuildID] - $ProdFirst)) . ")</font>"; |
| 93 | 93 | } else { |
| 94 | 94 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[STRUC_MINE_SOLAR] - $ProdFirst)) . ")</font>"; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } else { |
| 97 | 97 | $bloc['build_gain'] = ''; |
| 98 | 98 | } |
| 99 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 99 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 100 | 100 | $bloc['build_prod'] = pretty_number(floor($Prod[$BuildID])); |
| 101 | 101 | $bloc['build_prod_diff'] = pretty_number(floor($Prod[$BuildID] - $ActualProd), true, true); |
| 102 | 102 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_SOLAR]), true, true); |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM]), true, true); |
| 108 | 108 | $bloc['build_need_diff'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM] - $ActualNeed), true, true); |
| 109 | 109 | } |
| 110 | - if($ProdFirst == 0) { |
|
| 111 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 110 | + if ($ProdFirst == 0) { |
|
| 111 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 112 | 112 | $ProdFirst = floor($Prod[$BuildID]); |
| 113 | 113 | } else { |
| 114 | 114 | $ProdFirst = floor($Prod[STRUC_MINE_SOLAR]); |
@@ -133,22 +133,22 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | $str_rapid_from = ''; |
| 135 | 135 | $str_rapid_to = ''; |
| 136 | - foreach(sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
| 136 | + foreach (sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
| 137 | 137 | $enemy_data = get_unit_param($enemy_id); |
| 138 | 138 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
| 139 | 139 | |
| 140 | 140 | $rapid = floor($unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability); |
| 141 | - if($rapid >= 1) { |
|
| 141 | + if ($rapid >= 1) { |
|
| 142 | 142 | $str_rapid_to .= "{$classLocale['nfo_rf_again']} {$classLocale['tech'][$enemy_id]} <font color=\"#00ff00\">{$rapid}</font><br>"; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $rapid = floor($enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability); |
| 146 | - if($rapid >= 1) { |
|
| 146 | + if ($rapid >= 1) { |
|
| 147 | 147 | $str_rapid_from .= "{$classLocale['tech'][$enemy_id]} {$classLocale['nfo_rf_from']} <font color=\"#ff0000\">{$rapid}</font><br>"; |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if($str_rapid_to && $str_rapid_from) { |
|
| 151 | + if ($str_rapid_to && $str_rapid_from) { |
|
| 152 | 152 | $str_rapid_to .= '<hr>'; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $unit_id = sys_get_param_id('gid'); |
| 159 | -if($unit_id == RES_DARK_MATTER) { |
|
| 159 | +if ($unit_id == RES_DARK_MATTER) { |
|
| 160 | 160 | sys_redirect('dark_matter.php'); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | -if($unit_id == RES_METAMATTER) { |
|
| 163 | +if ($unit_id == RES_METAMATTER) { |
|
| 164 | 164 | sys_redirect('metamatter.php'); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | lng_include('infos'); |
| 168 | -if(!$unit_id || (!get_unit_param($unit_id) && !isset(classLocale::$lang['info'][$unit_id]))) { |
|
| 168 | +if (!$unit_id || (!get_unit_param($unit_id) && !isset(classLocale::$lang['info'][$unit_id]))) { |
|
| 169 | 169 | sys_redirect('index.php?page=techtree'); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $unit_data = get_unit_param($unit_id); |
| 175 | 175 | $unit_type = $unit_data['type']; |
| 176 | 176 | |
| 177 | -if($unit_type == UNIT_SHIPS) { |
|
| 177 | +if ($unit_type == UNIT_SHIPS) { |
|
| 178 | 178 | $template_result['UNIT_IS_SHIP'] = true; |
| 179 | 179 | |
| 180 | 180 | $ship_data = get_ship_data($unit_id, $user); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | ); |
| 191 | 191 | |
| 192 | 192 | $engine_template_info = array(); |
| 193 | - foreach($unit_data['engine'] as $unit_engine_data) { |
|
| 193 | + foreach ($unit_data['engine'] as $unit_engine_data) { |
|
| 194 | 194 | $unit_engine_data = get_engine_data($user, $unit_engine_data); |
| 195 | 195 | |
| 196 | 196 | $engine_template_info[] = array( |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | |
| 211 | 211 | $sn_data_group_combat = sn_get_groups('combat'); |
| 212 | -if(in_array($unit_id, $sn_data_group_combat)) { |
|
| 212 | +if (in_array($unit_id, $sn_data_group_combat)) { |
|
| 213 | 213 | $template_result['UNIT_IS_COMBAT'] = true; |
| 214 | 214 | |
| 215 | 215 | $unit_durability = $unit_data['shield'] + $unit_data['armor']; |
@@ -217,21 +217,21 @@ discard block |
||
| 217 | 217 | $volley_arr = $rapid_to = $rapid_from = array(); |
| 218 | 218 | $str_rapid_from = ''; |
| 219 | 219 | $str_rapid_to = ''; |
| 220 | - foreach($sn_data_group_combat as $enemy_id) { |
|
| 220 | + foreach ($sn_data_group_combat as $enemy_id) { |
|
| 221 | 221 | $enemy_data = get_unit_param($enemy_id); |
| 222 | 222 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
| 223 | 223 | |
| 224 | 224 | $rapid = $unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability; |
| 225 | - if($rapid >= 1) { |
|
| 225 | + if ($rapid >= 1) { |
|
| 226 | 226 | $volley_arr[$enemy_id]['TO'] = floor($rapid); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | $rapid = $enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability; |
| 230 | - if($rapid >= 1) { |
|
| 230 | + if ($rapid >= 1) { |
|
| 231 | 231 | $volley_arr[$enemy_id]['FROM'] = floor($rapid); |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | - foreach($volley_arr as $enemy_id => &$rapid) { |
|
| 234 | + foreach ($volley_arr as $enemy_id => &$rapid) { |
|
| 235 | 235 | $rapid['ENEMY_ID'] = $enemy_id; |
| 236 | 236 | $rapid['ENEMY_NAME'] = classLocale::$lang['tech'][$enemy_id]; |
| 237 | 237 | } |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | -if(classLocale::$lang['info'][$unit_id]['effect']) { |
|
| 252 | +if (classLocale::$lang['info'][$unit_id]['effect']) { |
|
| 253 | 253 | $template_result['UNIT_EFFECT'] = classLocale::$lang['info'][$unit_id]['effect']; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | -if($unit_data['bonus']) { |
|
| 256 | +if ($unit_data['bonus']) { |
|
| 257 | 257 | $unit_bonus = !$unit_data['bonus'] || $unit_data['bonus_type'] == BONUS_ABILITY ? '' : ( |
| 258 | 258 | ($unit_data['bonus'] >= 0 ? '+' : '') . $unit_data['bonus'] . ($unit_data['bonus_type'] == BONUS_PERCENT ? '%' : '') |
| 259 | 259 | ); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 14 | 14 | |
| 15 | -if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
| 15 | +if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
| 16 | 16 | message(classLocale::$lang['sys_blitz_page_disabled'], classLocale::$lang['sys_error'], 'overview.php', 10); |
| 17 | 17 | die(); |
| 18 | 18 | } |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $template = gettemplate('search', true); |
| 27 | 27 | |
| 28 | -if($searchtext && $type) { |
|
| 29 | - switch($type) { |
|
| 28 | +if ($searchtext && $type) { |
|
| 29 | + switch ($type) { |
|
| 30 | 30 | case "planetname": |
| 31 | 31 | // $search = db_planet_list_search($searchtext); |
| 32 | 32 | break; |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | break; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - while($row = db_fetch($search)) { |
|
| 45 | - if($type == 'playername' || $type == 'planetname') { |
|
| 44 | + while ($row = db_fetch($search)) { |
|
| 45 | + if ($type == 'playername' || $type == 'planetname') { |
|
| 46 | 46 | $template->assign_block_vars('search_result', array( |
| 47 | 47 | 'PLAYER_ID' => $row['uid'], |
| 48 | 48 | 'PLAYER_NAME' => htmlentities($row['username'], ENT_COMPAT, 'UTF-8'), |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
| 58 | 58 | 'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'), |
| 59 | 59 | )); |
| 60 | - } elseif($type == 'ally') { |
|
| 60 | + } elseif ($type == 'ally') { |
|
| 61 | 61 | $template->assign_block_vars('search_result', array( |
| 62 | 62 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
| 63 | 63 | 'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'), |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'ally' => 'sys_alliance', |
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | -foreach($search_type as $type_id => $type_lang) { |
|
| 78 | +foreach ($search_type as $type_id => $type_lang) { |
|
| 79 | 79 | $template->assign_block_vars('type', array( |
| 80 | 80 | 'ID' => $type_id, |
| 81 | 81 | 'TEXT' => classLocale::$lang[$type_lang], |
@@ -5,29 +5,29 @@ discard block |
||
| 5 | 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() |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | . '&key=' . urlencode(classSupernova::$config->server_updater_key) |
| 13 | 13 | . '&id=' . urlencode(classSupernova::$config->server_updater_id); |
| 14 | 14 | |
| 15 | -switch($mode) { |
|
| 15 | +switch ($mode) { |
|
| 16 | 16 | case SNC_MODE_REGISTER: |
| 17 | - if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) { |
|
| 18 | - if($ajax) { |
|
| 17 | + if (classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) { |
|
| 18 | + if ($ajax) { |
|
| 19 | 19 | print(SNC_VER_REGISTER_ERROR_REGISTERED); |
| 20 | 20 | } |
| 21 | 21 | die(); |
@@ -25,18 +25,18 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $check_result = sn_get_url_contents($url); |
| 28 | -if(!$check_result) { |
|
| 28 | +if (!$check_result) { |
|
| 29 | 29 | $version_check = SNC_VER_ERROR_CONNECT; |
| 30 | -} elseif(($version_check = intval($check_result)) && $version_check == $check_result) { |
|
| 30 | +} elseif (($version_check = intval($check_result)) && $version_check == $check_result) { |
|
| 31 | 31 | $version_check = $check_result; |
| 32 | 32 | } else { |
| 33 | 33 | // JSON decode if string |
| 34 | 34 | $check_result = json_decode($check_result, true); |
| 35 | 35 | $version_check = $check_result === null ? SNC_VER_UNKNOWN_RESPONSE : $check_result['version_check']; |
| 36 | 36 | |
| 37 | - switch($mode) { |
|
| 37 | + switch ($mode) { |
|
| 38 | 38 | case SNC_MODE_REGISTER: |
| 39 | - if($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) { |
|
| 39 | + if ($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) { |
|
| 40 | 40 | classSupernova::$config->db_saveItem('server_updater_key', $check_result['site']['site_key']); |
| 41 | 41 | classSupernova::$config->db_saveItem('server_updater_id', $check_result['site']['site_id']); |
| 42 | 42 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | classSupernova::$config->db_saveItem('server_updater_check_last', SN_TIME_NOW); |
| 50 | 50 | classSupernova::$config->db_saveItem('server_updater_check_result', $version_check); |
| 51 | 51 | |
| 52 | -if($ajax) { |
|
| 52 | +if ($ajax) { |
|
| 53 | 53 | define('IN_AJAX', true); |
| 54 | 54 | print($version_check); |
| 55 | 55 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
| 13 | 13 | |
| 14 | 14 | // if($user['authlevel'] < 1) |
| 15 | -if($user['authlevel'] < 3) { |
|
| 15 | +if ($user['authlevel'] < 3) { |
|
| 16 | 16 | AdminMessage(classLocale::$lang['adm_err_denied']); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | function templateAssignTable($template, $str, $status) { |
| 27 | 27 | $template->assign_block_vars('table', classLocale::$lang['adm_tool_sql_table'][$str]); |
| 28 | - foreach($status as $key => $value) { |
|
| 28 | + foreach ($status as $key => $value) { |
|
| 29 | 29 | $template->assign_block_vars('table.row', array( |
| 30 | 30 | 'VALUE_1' => $key, |
| 31 | 31 | 'VALUE_2' => $value, |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -switch($mode) { |
|
| 36 | +switch ($mode) { |
|
| 37 | 37 | case ADM_TOOL_CONFIG_RELOAD: |
| 38 | 38 | classSupernova::$config->db_loadAll(); |
| 39 | 39 | sys_refresh_tablelist(); |
| 40 | 40 | |
| 41 | 41 | classSupernova::$config->db_loadItem('game_watchlist'); |
| 42 | - if(classSupernova::$config->game_watchlist) { |
|
| 42 | + if (classSupernova::$config->game_watchlist) { |
|
| 43 | 43 | classSupernova::$config->game_watchlist_array = explode(';', classSupernova::$config->game_watchlist); |
| 44 | 44 | } else { |
| 45 | 45 | unset(classSupernova::$config->game_watchlist_array); |
@@ -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($unit_crossfire_result as $key => $value) |
|
| 64 | + foreach ($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 | } |