@@ -78,121 +78,121 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | switch ($fleet_page) { |
81 | - case 3: |
|
81 | + case 3: |
|
82 | 82 | |
83 | - case 2: |
|
84 | - $fleet_group_mr = sys_get_param_id('fleet_group'); |
|
85 | - $fleetarray = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true); |
|
86 | - $fleetarray = is_array($fleetarray) ? $fleetarray : array(); |
|
83 | + case 2: |
|
84 | + $fleet_group_mr = sys_get_param_id('fleet_group'); |
|
85 | + $fleetarray = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true); |
|
86 | + $fleetarray = is_array($fleetarray) ? $fleetarray : array(); |
|
87 | 87 | |
88 | - foreach($fleetarray as $ship_id => &$ship_amount) { |
|
89 | - if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) { |
|
90 | - $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true)); |
|
91 | - die(); |
|
92 | - } |
|
93 | - $ship_amount = floatval($ship_amount); |
|
94 | - } |
|
95 | - |
|
96 | - $UsedPlanet = false; |
|
97 | - $YourPlanet = false; |
|
98 | - $missiontype = array(); |
|
99 | - if ($planet > SN::$config->game_maxPlanet) { |
|
100 | - $target_mission = MT_EXPLORE; |
|
101 | - $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE]; |
|
102 | - } elseif ($galaxy && $system && $planet) { |
|
103 | - $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET; |
|
104 | - |
|
105 | - $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type); |
|
106 | - |
|
107 | - if ($TargetPlanet['id_owner']) { |
|
108 | - $UsedPlanet = true; |
|
109 | - if ($TargetPlanet['id_owner'] == $user['id']) { |
|
110 | - $YourPlanet = true; |
|
88 | + foreach($fleetarray as $ship_id => &$ship_amount) { |
|
89 | + if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) { |
|
90 | + $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true)); |
|
91 | + die(); |
|
111 | 92 | } |
93 | + $ship_amount = floatval($ship_amount); |
|
112 | 94 | } |
113 | 95 | |
114 | - if (!$UsedPlanet) { |
|
115 | - if ($fleetarray[SHIP_COLONIZER]) { |
|
116 | - $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE]; |
|
117 | - $target_mission = MT_COLONIZE; |
|
118 | - $planet_type = PT_PLANET; |
|
119 | - } else { |
|
120 | - SnTemplate::messageBox("<font color=\"red\"><b>" . $lang['fl_no_planet_type'] . "</b></font>", $lang['fl_error']); |
|
121 | - } |
|
122 | - } else { |
|
123 | - $recyclers = 0; |
|
124 | - foreach(sn_get_groups('flt_recyclers') as $recycler_id) { |
|
125 | - $recyclers += $fleetarray[$recycler_id]; |
|
96 | + $UsedPlanet = false; |
|
97 | + $YourPlanet = false; |
|
98 | + $missiontype = array(); |
|
99 | + if ($planet > SN::$config->game_maxPlanet) { |
|
100 | + $target_mission = MT_EXPLORE; |
|
101 | + $missiontype[MT_EXPLORE] = $lang['type_mission'][MT_EXPLORE]; |
|
102 | + } elseif ($galaxy && $system && $planet) { |
|
103 | + $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET; |
|
104 | + |
|
105 | + $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type); |
|
106 | + |
|
107 | + if ($TargetPlanet['id_owner']) { |
|
108 | + $UsedPlanet = true; |
|
109 | + if ($TargetPlanet['id_owner'] == $user['id']) { |
|
110 | + $YourPlanet = true; |
|
111 | + } |
|
126 | 112 | } |
127 | - if ($recyclers > 0 && $planet_type == PT_DEBRIS) { |
|
128 | - $target_mission = MT_RECYCLE; |
|
129 | - $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE]; |
|
130 | - } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) { |
|
131 | - if ($YourPlanet) { |
|
132 | - $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE]; |
|
133 | - $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT]; |
|
113 | + |
|
114 | + if (!$UsedPlanet) { |
|
115 | + if ($fleetarray[SHIP_COLONIZER]) { |
|
116 | + $missiontype[MT_COLONIZE] = $lang['type_mission'][MT_COLONIZE]; |
|
117 | + $target_mission = MT_COLONIZE; |
|
118 | + $planet_type = PT_PLANET; |
|
134 | 119 | } else { |
135 | - // Not Your Planet |
|
136 | - if ($fleetarray[SHIP_SPY]) { |
|
137 | - // Only spy missions if any spy |
|
138 | - $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY]; |
|
120 | + SnTemplate::messageBox("<font color=\"red\"><b>" . $lang['fl_no_planet_type'] . "</b></font>", $lang['fl_error']); |
|
121 | + } |
|
122 | + } else { |
|
123 | + $recyclers = 0; |
|
124 | + foreach(sn_get_groups('flt_recyclers') as $recycler_id) { |
|
125 | + $recyclers += $fleetarray[$recycler_id]; |
|
126 | + } |
|
127 | + if ($recyclers > 0 && $planet_type == PT_DEBRIS) { |
|
128 | + $target_mission = MT_RECYCLE; |
|
129 | + $missiontype[MT_RECYCLE] = $lang['type_mission'][MT_RECYCLE]; |
|
130 | + } elseif ($planet_type == PT_PLANET || $planet_type == PT_MOON) { |
|
131 | + if ($YourPlanet) { |
|
132 | + $missiontype[MT_RELOCATE] = $lang['type_mission'][MT_RELOCATE]; |
|
133 | + $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT]; |
|
139 | 134 | } else { |
140 | - // If no spies... |
|
141 | - if ($fleet_group_mr) { |
|
142 | - $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS]; |
|
135 | + // Not Your Planet |
|
136 | + if ($fleetarray[SHIP_SPY]) { |
|
137 | + // Only spy missions if any spy |
|
138 | + $missiontype[MT_SPY] = $lang['type_mission'][MT_SPY]; |
|
143 | 139 | } else { |
144 | - $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK]; |
|
145 | - $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT]; |
|
146 | - |
|
147 | - $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD]; |
|
148 | - |
|
149 | - if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) { |
|
150 | - $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY]; |
|
140 | + // If no spies... |
|
141 | + if ($fleet_group_mr) { |
|
142 | + $missiontype[MT_AKS] = $lang['type_mission'][MT_AKS]; |
|
143 | + } else { |
|
144 | + $missiontype[MT_ATTACK] = $lang['type_mission'][MT_ATTACK]; |
|
145 | + $missiontype[MT_TRANSPORT] = $lang['type_mission'][MT_TRANSPORT]; |
|
146 | + |
|
147 | + $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD]; |
|
148 | + |
|
149 | + if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) { |
|
150 | + $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY]; |
|
151 | + } |
|
151 | 152 | } |
152 | 153 | } |
153 | 154 | } |
154 | 155 | } |
155 | 156 | } |
156 | 157 | } |
157 | - } |
|
158 | - |
|
159 | - if (!$target_mission && is_array($missiontype)) { |
|
160 | - $target_mission = MT_ATTACK; |
|
161 | - } |
|
162 | - |
|
163 | -// $sn_group_missions = sn_get_groups('missions'); |
|
164 | -// foreach($sn_group_missions as $mission_id => $cork) { |
|
165 | -// $missiontype[$mission_id] = $lang['type_mission'][$mission_id]; |
|
166 | -// } |
|
167 | -// |
|
168 | -// |
|
169 | - ksort($missiontype); |
|
170 | - |
|
171 | - $speed_percent = sys_get_param_int('speed', 10); |
|
172 | - $travel_data = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent); |
|
173 | - |
|
174 | -// $fleet_speed = flt_fleet_speed($user, $fleetarray); |
|
175 | - $fleet_speed = $travel_data['fleet_speed']; |
|
176 | - $distance = $travel_data['distance']; |
|
177 | - $duration = $travel_data['duration']; |
|
178 | - $consumption = $travel_data['consumption']; |
|
179 | - // No Break |
|
180 | - |
|
181 | - case 1: |
|
182 | - if ($galaxy && $system && $planet) { |
|
183 | - $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET; |
|
184 | - |
|
185 | - $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type); |
|
186 | - } |
|
187 | - |
|
188 | - case 0: |
|
189 | - $template_result += array( |
|
190 | - 'thisgalaxy' => $planetrow['galaxy'], |
|
191 | - 'thissystem' => $planetrow['system'], |
|
192 | - 'thisplanet' => $planetrow['planet'], |
|
193 | - 'thisplanet_type' => $planetrow['planet_type'], |
|
194 | - ); |
|
195 | - // no break |
|
158 | + |
|
159 | + if (!$target_mission && is_array($missiontype)) { |
|
160 | + $target_mission = MT_ATTACK; |
|
161 | + } |
|
162 | + |
|
163 | + // $sn_group_missions = sn_get_groups('missions'); |
|
164 | + // foreach($sn_group_missions as $mission_id => $cork) { |
|
165 | + // $missiontype[$mission_id] = $lang['type_mission'][$mission_id]; |
|
166 | + // } |
|
167 | + // |
|
168 | + // |
|
169 | + ksort($missiontype); |
|
170 | + |
|
171 | + $speed_percent = sys_get_param_int('speed', 10); |
|
172 | + $travel_data = flt_travel_data($user, $planetrow, array('galaxy' => $galaxy, 'system' => $system, 'planet' => $planet), $fleetarray, $speed_percent); |
|
173 | + |
|
174 | + // $fleet_speed = flt_fleet_speed($user, $fleetarray); |
|
175 | + $fleet_speed = $travel_data['fleet_speed']; |
|
176 | + $distance = $travel_data['distance']; |
|
177 | + $duration = $travel_data['duration']; |
|
178 | + $consumption = $travel_data['consumption']; |
|
179 | + // No Break |
|
180 | + |
|
181 | + case 1: |
|
182 | + if ($galaxy && $system && $planet) { |
|
183 | + $check_type = $planet_type == PT_MOON ? PT_MOON : PT_PLANET; |
|
184 | + |
|
185 | + $TargetPlanet = DBStaticPlanet::db_planet_by_gspt($galaxy, $system, $planet, $check_type); |
|
186 | + } |
|
187 | + |
|
188 | + case 0: |
|
189 | + $template_result += array( |
|
190 | + 'thisgalaxy' => $planetrow['galaxy'], |
|
191 | + 'thissystem' => $planetrow['system'], |
|
192 | + 'thisplanet' => $planetrow['planet'], |
|
193 | + 'thisplanet_type' => $planetrow['planet_type'], |
|
194 | + ); |
|
195 | + // no break |
|
196 | 196 | |
197 | 197 | } |
198 | 198 | |
@@ -214,35 +214,35 @@ discard block |
||
214 | 214 | } |
215 | 215 | |
216 | 216 | switch($fleet_page) { |
217 | - case 1: |
|
218 | - require('includes/includes/flt_page1.inc'); |
|
219 | - break; |
|
220 | - |
|
221 | - case 2: |
|
222 | - require_once('includes/includes/flt_page2.inc'); |
|
223 | - sn_fleet_page2(); |
|
224 | - break; |
|
225 | - |
|
226 | - case 3: |
|
227 | - require_once('includes/includes/flt_page3.inc'); |
|
228 | - sn_fleet_page3(); |
|
229 | - break; |
|
230 | - |
|
231 | - case 4: |
|
232 | - require('includes/includes/flt_page4.inc'); |
|
233 | - break; |
|
234 | - |
|
235 | - case 5: |
|
236 | - $template = SnTemplate::gettemplate('fleet5', true); |
|
237 | - $pageFleet5Gathering = new \Pages\Deprecated\PageFleet5Gathering(); |
|
238 | - $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template); |
|
239 | - // Building list of own planets & moons |
|
240 | - $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template); |
|
241 | - break; |
|
242 | - |
|
243 | - default: |
|
244 | - define('SN_RENDER_NAVBAR_PLANET', true); |
|
245 | - |
|
246 | - require('includes/includes/flt_page0.inc'); |
|
247 | - break; |
|
217 | + case 1: |
|
218 | + require('includes/includes/flt_page1.inc'); |
|
219 | + break; |
|
220 | + |
|
221 | + case 2: |
|
222 | + require_once('includes/includes/flt_page2.inc'); |
|
223 | + sn_fleet_page2(); |
|
224 | + break; |
|
225 | + |
|
226 | + case 3: |
|
227 | + require_once('includes/includes/flt_page3.inc'); |
|
228 | + sn_fleet_page3(); |
|
229 | + break; |
|
230 | + |
|
231 | + case 4: |
|
232 | + require('includes/includes/flt_page4.inc'); |
|
233 | + break; |
|
234 | + |
|
235 | + case 5: |
|
236 | + $template = SnTemplate::gettemplate('fleet5', true); |
|
237 | + $pageFleet5Gathering = new \Pages\Deprecated\PageFleet5Gathering(); |
|
238 | + $pageFleet5Gathering->modelFleet5Gathering($user, $planetrow, $template); |
|
239 | + // Building list of own planets & moons |
|
240 | + $pageFleet5Gathering->viewPage5Gathering($user, $planetrow, $template); |
|
241 | + break; |
|
242 | + |
|
243 | + default: |
|
244 | + define('SN_RENDER_NAVBAR_PLANET', true); |
|
245 | + |
|
246 | + require('includes/includes/flt_page0.inc'); |
|
247 | + break; |
|
248 | 248 | } |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | $planet = sys_get_param_int('planet', $planetrow['planet']); |
45 | 45 | |
46 | 46 | $target_mission = sys_get_param_int('target_mission'); |
47 | -if($target_mission == MT_COLONIZE || $target_mission == MT_EXPLORE) { |
|
47 | +if ($target_mission == MT_COLONIZE || $target_mission == MT_EXPLORE) { |
|
48 | 48 | $planet_type = PT_PLANET; |
49 | -} elseif($target_mission == MT_RECYCLE) { |
|
49 | +} elseif ($target_mission == MT_RECYCLE) { |
|
50 | 50 | $planet_type = PT_DEBRIS; |
51 | -} elseif($target_mission == MT_DESTROY) { |
|
51 | +} elseif ($target_mission == MT_DESTROY) { |
|
52 | 52 | $planet_type = PT_MOON; |
53 | 53 | } else { |
54 | 54 | $planet_type = sys_get_param_int('planet_type'); |
@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | //$FlyingFleets = doquery("SELECT COUNT(fleet_id) as Number FROM {{fleets}} WHERE `fleet_owner`='{$user['id']}'", true); |
65 | 65 | //$FlyingFleets = $FlyingFleets['Number']; |
66 | 66 | $FlyingFleets = DbFleetStatic::fleet_count_flying($user['id']); |
67 | -if($MaxFleets <= $FlyingFleets && $fleet_page && $fleet_page != 4) { |
|
67 | +if ($MaxFleets <= $FlyingFleets && $fleet_page && $fleet_page != 4) { |
|
68 | 68 | SnTemplate::messageBox($lang['fl_noslotfree'], $lang['fl_error'], "fleet." . PHP_EX, 5); |
69 | 69 | } |
70 | 70 | |
71 | 71 | $MaxExpeditions = get_player_max_expeditons($user); |
72 | -if($MaxExpeditions) { |
|
72 | +if ($MaxExpeditions) { |
|
73 | 73 | // $FlyingExpeditions = doquery("SELECT COUNT(fleet_owner) AS `expedi` FROM {{fleets}} WHERE `fleet_owner` = {$user['id']} AND `fleet_mission` = '" . MT_EXPLORE . "';", '', true); |
74 | 74 | // $FlyingExpeditions = $FlyingExpeditions['expedi']; |
75 | - $FlyingExpeditions = DbFleetStatic::fleet_count_flying($user['id'], MT_EXPLORE); |
|
75 | + $FlyingExpeditions = DbFleetStatic::fleet_count_flying($user['id'], MT_EXPLORE); |
|
76 | 76 | } else { |
77 | 77 | $FlyingExpeditions = 0; |
78 | 78 | } |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | $fleetarray = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true); |
86 | 86 | $fleetarray = is_array($fleetarray) ? $fleetarray : array(); |
87 | 87 | |
88 | - foreach($fleetarray as $ship_id => &$ship_amount) { |
|
89 | - if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) { |
|
88 | + foreach ($fleetarray as $ship_id => &$ship_amount) { |
|
89 | + if (!in_array($ship_id, sn_get_groups('fleet')) || (string) floatval($ship_amount) != $ship_amount || $ship_amount < 1) { |
|
90 | 90 | $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true)); |
91 | 91 | die(); |
92 | 92 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | } else { |
123 | 123 | $recyclers = 0; |
124 | - foreach(sn_get_groups('flt_recyclers') as $recycler_id) { |
|
124 | + foreach (sn_get_groups('flt_recyclers') as $recycler_id) { |
|
125 | 125 | $recyclers += $fleetarray[$recycler_id]; |
126 | 126 | } |
127 | 127 | if ($recyclers > 0 && $planet_type == PT_DEBRIS) { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD]; |
148 | 148 | |
149 | - if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) { |
|
149 | + if ($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) { |
|
150 | 150 | $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY]; |
151 | 151 | } |
152 | 152 | } |
@@ -206,14 +206,14 @@ discard block |
||
206 | 206 | ); |
207 | 207 | |
208 | 208 | $is_transport_missions = false; |
209 | -if($missiontype) { |
|
209 | +if ($missiontype) { |
|
210 | 210 | $sn_group_missions = sn_get_groups('missions'); |
211 | - foreach($missiontype as $mission_data_id => $mission_data) { |
|
211 | + foreach ($missiontype as $mission_data_id => $mission_data) { |
|
212 | 212 | $is_transport_missions = $is_transport_missions || (isset($sn_group_missions[$mission_data_id]['transport']) && $sn_group_missions[$mission_data_id]['transport']); |
213 | 213 | } |
214 | 214 | } |
215 | 215 | |
216 | -switch($fleet_page) { |
|
216 | +switch ($fleet_page) { |
|
217 | 217 | case 1: |
218 | 218 | require('includes/includes/flt_page1.inc'); |
219 | 219 | break; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | $template = SnTemplate::gettemplate("admin/add_moon", true); |
24 | 24 | |
25 | -if(sys_get_param_str('mode') == 'addit') |
|
25 | +if (sys_get_param_str('mode') == 'addit') |
|
26 | 26 | { |
27 | 27 | $PlanetID = sys_get_param_id('user'); |
28 | 28 | $MoonName = sys_get_param_str('name'); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) { |
71 | 71 | $query_string[] = $unit_query_string; |
72 | 72 | } |
73 | - } elseif (in_array($mode, [UNIT_SHIPS_STR, UNIT_STRUCTURES_STR, UNIT_DEFENCE_STR,]) ) { |
|
73 | + } elseif (in_array($mode, [UNIT_SHIPS_STR, UNIT_STRUCTURES_STR, UNIT_DEFENCE_STR, ])) { |
|
74 | 74 | if (!floatval($unit_amount)) { |
75 | 75 | continue; |
76 | 76 | } |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | * @copyright 2008 by Chlorel for XNova |
10 | 10 | */ |
11 | 11 | |
12 | -define('INSIDE' , true); |
|
13 | -define('INSTALL' , false); |
|
12 | +define('INSIDE', true); |
|
13 | +define('INSTALL', false); |
|
14 | 14 | define('IN_ADMIN', true); |
15 | 15 | require_once('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR); |
20 | 20 | |
21 | -if(SN_TIME_NOW >= SN::$config->pass()->var_stat_update_admin_forced && SN_TIME_NOW >= SN::$config->pass()->var_stat_update_end) |
|
21 | +if (SN_TIME_NOW >= SN::$config->pass()->var_stat_update_admin_forced && SN_TIME_NOW >= SN::$config->pass()->var_stat_update_end) |
|
22 | 22 | { |
23 | 23 | SN::$config->pass()->var_stat_update_admin_forced = SN_TIME_NOW + 120; |
24 | 24 |
@@ -37,8 +37,7 @@ |
||
37 | 37 | </script>'; |
38 | 38 | |
39 | 39 | SnTemplate::messageBoxAdmin("{$script}<img src=\"design/images/progressbar.gif\"><br>{$lang['sys_wait']}", $lang['adm_stat_title'], '', 0); |
40 | -} |
|
41 | -else |
|
40 | +} else |
|
42 | 41 | { |
43 | 42 | SnTemplate::messageBoxAdmin($lang['adm_stat_already_started'], $lang['adm_stat_title'], 'admin/overview.php'); |
44 | 43 | } |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | |
11 | 11 | use Unit\DBStaticUnit; |
12 | 12 | |
13 | -define('INSIDE' , true); |
|
14 | -define('INSTALL' , false); |
|
13 | +define('INSIDE', true); |
|
14 | +define('INSTALL', false); |
|
15 | 15 | define('IN_ADMIN', true); |
16 | 16 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
17 | 17 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $template = SnTemplate::gettemplate('admin/settings', true); |
23 | 23 | |
24 | -if(sys_get_param('save')) { |
|
24 | +if (sys_get_param('save')) { |
|
25 | 25 | SN::$config->game_name = sys_get_param_str_unsafe('game_name'); |
26 | 26 | SN::$config->game_mode = sys_get_param_int('game_mode'); |
27 | 27 | SN::$config->game_speed = sys_get_param_float('game_speed', 1); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | SN::$config->url_faq = sys_get_param_str_unsafe('url_faq'); |
32 | 32 | SN::$config->url_forum = sys_get_param_str_unsafe('url_forum'); |
33 | 33 | SN::$config->url_rules = sys_get_param_str_unsafe('url_rules'); |
34 | - SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter'); |
|
34 | + SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter'); |
|
35 | 35 | SN::$config->game_disable = sys_get_param_int('game_disable'); |
36 | 36 | SN::$config->game_disable_reason = sys_get_param_str_unsafe('game_disable_reason'); |
37 | 37 | SN::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto'); |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | SN::$config->stats_schedule = sys_get_param_str('stats_schedule'); |
102 | 102 | |
103 | 103 | SN::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period'); |
104 | - if(SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) { |
|
105 | - if(SN::$config->empire_mercenary_temporary) { |
|
104 | + if (SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) { |
|
105 | + if (SN::$config->empire_mercenary_temporary) { |
|
106 | 106 | DBStaticUnit::db_unit_list_admin_delete_mercenaries_finished(); |
107 | 107 | } else { |
108 | 108 | DBStaticUnit::db_unit_list_admin_set_mercenaries_expire_time(SN::$config->empire_mercenary_base_period); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | SnTemplate::tpl_assign_select($template, 'ver_response', SN::$lang['adm_opt_ver_response'], 'ID', 'NAME'); |
153 | 153 | |
154 | 154 | $lang_list = lng_get_list(); |
155 | -foreach($lang_list as $lang_id => $lang_data) { |
|
155 | +foreach ($lang_list as $lang_id => $lang_data) { |
|
156 | 156 | $template->assign_block_vars('game_languages', array( |
157 | 157 | 'ID' => $lang_id, |
158 | 158 | 'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})", |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | return $a['DATE'] == $b['DATE'] ? 0 : ($a['DATE'] > $b['DATE'] ? 1 : -1); |
19 | 19 | } |
20 | 20 | |
21 | -if($user['authlevel'] < 3) |
|
21 | +if ($user['authlevel'] < 3) |
|
22 | 22 | { |
23 | 23 | AdminMessage($lang['adm_err_denied']); |
24 | 24 | } |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | $template = SnTemplate::gettemplate('admin/adm_user_stat', true); |
27 | 27 | |
28 | 28 | $dt_from = sys_get_param_date_sql('dt_from', '2000-01-01'); |
29 | -if(strlen($dt_from) == 4) |
|
29 | +if (strlen($dt_from) == 4) |
|
30 | 30 | { |
31 | 31 | $dt_from .= '-01'; |
32 | 32 | } |
33 | 33 | $dt_to = sys_get_param_date_sql('dt_to', date('Y-m-d', SN_TIME_NOW + PERIOD_DAY)); |
34 | -if(strlen($dt_to) == 4) |
|
34 | +if (strlen($dt_to) == 4) |
|
35 | 35 | { |
36 | 36 | $dt_to .= '-01'; |
37 | 37 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $interval = $min_max_dates['max_register'] - $min_max_dates['min_register']; |
45 | 45 | |
46 | -switch(true) |
|
46 | +switch (true) |
|
47 | 47 | { |
48 | 48 | case $interval >= PERIOD_YEAR * 4: |
49 | 49 | $sql_group_format = "%Y"; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | DATE_FORMAT(account_register_time, '%a') AS DoW, |
83 | 83 | DATE_FORMAT(DATE_ADD(account_register_time, INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next |
84 | 84 | FROM {{account}} WHERE 1 " . $sql_date2 . " GROUP BY {$sql_group_by2}"); |
85 | -while($row = db_fetch($query)) |
|
85 | +while ($row = db_fetch($query)) |
|
86 | 86 | { |
87 | 87 | $stat_date[$row['the_date']] = array( |
88 | 88 | 'DATE' => $row['the_date'], |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $sql_group_by = "DATE_FORMAT(FROM_UNIXTIME(register_time), '{$sql_group_format}')"; |
99 | 99 | $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date, DATE_FORMAT(DATE_ADD(FROM_UNIXTIME(register_time), INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next |
100 | 100 | FROM {{users}} WHERE user_as_ally IS NULL " . $sql_date . " GROUP BY {$sql_group_by}"); |
101 | -while($row = db_fetch($query)) |
|
101 | +while ($row = db_fetch($query)) |
|
102 | 102 | { |
103 | 103 | $stat_date[$row['the_date']]['REGISTERED'] = $row['the_count']; |
104 | 104 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | " AND onlinetime <= register_time + " . PERIOD_DAY . |
110 | 110 | ' AND UNIX_TIMESTAMP(NOW()) >= register_time + ' . PERIOD_DAY . |
111 | 111 | $sql_date . " GROUP BY {$sql_group_by}"); |
112 | -while($row = db_fetch($query)) |
|
112 | +while ($row = db_fetch($query)) |
|
113 | 113 | { |
114 | 114 | $stat_date[$row['the_date']]['REJECTED'] = $row['the_count']; |
115 | 115 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ' AND onlinetime <= register_time + ' . PERIOD_WEEK . |
120 | 120 | ' AND UNIX_TIMESTAMP(NOW()) >= register_time + ' . PERIOD_WEEK . |
121 | 121 | $sql_date . " GROUP BY {$sql_group_by}"); |
122 | -while($row = db_fetch($query)) |
|
122 | +while ($row = db_fetch($query)) |
|
123 | 123 | { |
124 | 124 | $stat_date[$row['the_date']]['LEAVED'] = $row['the_count']; |
125 | 125 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_DAY . |
129 | 129 | ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_DAY . |
130 | 130 | $sql_date . " GROUP BY {$sql_group_by}"); |
131 | -while($row = db_fetch($query)) |
|
131 | +while ($row = db_fetch($query)) |
|
132 | 132 | { |
133 | 133 | $stat_date[$row['the_date']]['ACTIVE'] = $row['the_count']; |
134 | 134 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_WEEK . |
139 | 139 | ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_WEEK . |
140 | 140 | $sql_date . " GROUP BY {$sql_group_by}"); |
141 | -while($row = db_fetch($query)) |
|
141 | +while ($row = db_fetch($query)) |
|
142 | 142 | { |
143 | 143 | $stat_date[$row['the_date']]['DORMANT'] = $row['the_count']; |
144 | 144 | } |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | uasort($stat_date, 'admin_date_sort'); |
147 | 147 | |
148 | 148 | $total = array(); |
149 | -foreach($stat_date as $key => &$value) |
|
149 | +foreach ($stat_date as $key => &$value) |
|
150 | 150 | { |
151 | 151 | $value['TOTAL'] = $value['REJECTED'] + $value['LEAVED']; |
152 | 152 | $value['LEAVED_PERCENT'] = $value['REGISTERED'] ? round($value['TOTAL'] / $value['REGISTERED'] * 100) : 0; |
153 | 153 | $value['ACTIVE_PERCENT'] = $value['REGISTERED'] ? round($value['ACTIVE'] / $value['REGISTERED'] * 100) : 0; |
154 | 154 | $value['DORMANT_PERCENT'] = $value['REGISTERED'] ? round($value['DORMANT'] / $value['REGISTERED'] * 100) : 0; |
155 | - foreach($value as $key2 => $value2) |
|
155 | + foreach ($value as $key2 => $value2) |
|
156 | 156 | { |
157 | 157 | $total[$key2] += $value2; |
158 | 158 | } |
@@ -13,8 +13,7 @@ |
||
13 | 13 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
14 | 14 | |
15 | 15 | |
16 | -function admin_date_sort($a, $b) |
|
17 | -{ |
|
16 | +function admin_date_sort($a, $b) { |
|
18 | 17 | return $a['DATE'] == $b['DATE'] ? 0 : ($a['DATE'] > $b['DATE'] ? 1 : -1); |
19 | 18 | } |
20 | 19 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $scan_galaxy = sys_get_param_int('galaxy'); |
32 | 32 | $scan_system = sys_get_param_int('system'); |
33 | 33 | $scan_planet = sys_get_param_int('planet'); |
34 | -$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
34 | +$scan_planet_type = 1; // sys_get_param_int('planettype'); |
|
35 | 35 | $id = sys_get_param_id('id'); |
36 | 36 | |
37 | 37 | $source_galaxy = $planetrow['galaxy']; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $sensorRange = GetPhalanxRange($sensorLevel); |
42 | 42 | |
43 | 43 | $system_distance = abs($source_system - $scan_system); |
44 | -if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
44 | +if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) |
|
45 | 45 | { |
46 | 46 | SnTemplate::messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
47 | 47 | } |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type); |
57 | -if(!$planet_scanned['id']) |
|
57 | +if (!$planet_scanned['id']) |
|
58 | 58 | { |
59 | 59 | SnTemplate::messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
60 | 60 | } |
61 | 61 | |
62 | -if($planet_scanned['destruyed']) |
|
62 | +if ($planet_scanned['destruyed']) |
|
63 | 63 | { |
64 | 64 | SnTemplate::messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3); |
65 | 65 | } |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * DO NOT CHANGE |
27 | 27 | */ |
28 | 28 | |
29 | -if (!defined('INSIDE')) die(); |
|
29 | +if (!defined('INSIDE')) { |
|
30 | + die(); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | |
32 | 34 | $a_lang_array = [ |
@@ -25,7 +25,9 @@ |
||
25 | 25 | * DO NOT CHANGE |
26 | 26 | */ |
27 | 27 | |
28 | -if (!defined('INSIDE')) die(); |
|
28 | +if (!defined('INSIDE')) { |
|
29 | + die(); |
|
30 | +} |
|
29 | 31 | |
30 | 32 | $a_lang_array = [ |
31 | 33 | 'opt_account' => 'Account', |