@@ -54,15 +54,13 @@ |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | $DoneMessage .= $lang['adm_bn_plnt']; |
57 | - } |
|
58 | - else |
|
57 | + } else |
|
59 | 58 | { |
60 | 59 | $DoneMessage = sprintf($lang['adm_bn_errr'], $name_output); |
61 | 60 | } |
62 | 61 | |
63 | 62 | AdminMessage($DoneMessage, $lang['adm_ban_title']); |
64 | -} |
|
65 | -elseif($mode == 'unbanit' && $action) |
|
63 | +} elseif($mode == 'unbanit' && $action) |
|
66 | 64 | { |
67 | 65 | sys_admin_player_ban_unset($user, $player_banned_row, ($reason = sys_get_param_str('why')) ? $reason : $lang['sys_unbanned']); |
68 | 66 |
@@ -41,11 +41,12 @@ |
||
41 | 41 | $Subject = '<font color="'. $kolor .'">'. $config->temat ."</font>"; |
42 | 42 | $Message = '<font color="'. $kolor .'"><b>'. $config->tresc ."</b></font>"; |
43 | 43 | $sq = db_user_list('', false, 'id'); |
44 | - foreach($sq as $u) |
|
45 | - // while ($u = db_fetch($sq)) |
|
44 | + foreach($sq as $u) { |
|
45 | + // while ($u = db_fetch($sq)) |
|
46 | 46 | { |
47 | 47 | msg_send_simple_message ($u['id'], $user['id'], $Time, MSG_TYPE_ADMIN, $From, $Subject, $Message); |
48 | 48 | } |
49 | + } |
|
49 | 50 | message("<font color=\"lime\">Херня на польском</font>", "Complete", "../overview." . PHP_EX, 3); |
50 | 51 | } |
51 | 52 | } else { |
@@ -48,13 +48,11 @@ |
||
48 | 48 | header("Location: artifacts.php#{$unit_id}"); |
49 | 49 | ob_end_flush(); |
50 | 50 | die(); |
51 | - } |
|
52 | - else |
|
51 | + } else |
|
53 | 52 | { |
54 | 53 | $Message = $lang['off_maxed_out']; |
55 | 54 | } |
56 | - } |
|
57 | - else |
|
55 | + } else |
|
58 | 56 | { |
59 | 57 | $Message = $lang['sys_no_points']; |
60 | 58 | } |
@@ -2,7 +2,9 @@ discard block |
||
2 | 2 | |
3 | 3 | function dump($value,$varname = "",$level=0,$dumper = "") |
4 | 4 | { |
5 | - if ($varname) $varname .= " = "; |
|
5 | + if ($varname) { |
|
6 | + $varname .= " = "; |
|
7 | + } |
|
6 | 8 | |
7 | 9 | if ($level==-1) |
8 | 10 | { |
@@ -13,7 +15,9 @@ discard block |
||
13 | 15 | $trans["\0"]='⊕'; |
14 | 16 | return strtr(htmlspecialchars($value),$trans); |
15 | 17 | } |
16 | - if ($level==0) $dumper = '<pre>' . $varname; |
|
18 | + if ($level==0) { |
|
19 | + $dumper = '<pre>' . $varname; |
|
20 | + } |
|
17 | 21 | |
18 | 22 | $type = gettype($value); |
19 | 23 | $dumper .= $type; |
@@ -22,9 +26,9 @@ discard block |
||
22 | 26 | { |
23 | 27 | $dumper .= '('.strlen($value).')'; |
24 | 28 | $value = dump($value,"",-1); |
25 | - } |
|
26 | - elseif ($type=='boolean') $value= ($value?'true':'false'); |
|
27 | - elseif ($type=='object') |
|
29 | + } elseif ($type=='boolean') { |
|
30 | + $value= ($value?'true':'false'); |
|
31 | + } elseif ($type=='object') |
|
28 | 32 | { |
29 | 33 | $props= get_class_vars(get_class($value)); |
30 | 34 | $dumper .= '('.count($props).') <u>'.get_class($value).'</u>'; |
@@ -34,8 +38,7 @@ discard block |
||
34 | 38 | $dumper .= dump($value->$key,"",$level+1); |
35 | 39 | } |
36 | 40 | $value= ''; |
37 | - } |
|
38 | - elseif ($type=='array') |
|
41 | + } elseif ($type=='array') |
|
39 | 42 | { |
40 | 43 | $dumper .= '('.count($value).')'; |
41 | 44 | foreach($value as $key=>$val) |
@@ -46,7 +49,9 @@ discard block |
||
46 | 49 | $value= ''; |
47 | 50 | } |
48 | 51 | $dumper .= " <b>$value</b>"; |
49 | - if ($level==0) $dumper .= '</pre>'; |
|
52 | + if ($level==0) { |
|
53 | + $dumper .= '</pre>'; |
|
54 | + } |
|
50 | 55 | return $dumper; |
51 | 56 | } |
52 | 57 | |
@@ -70,8 +75,7 @@ discard block |
||
70 | 75 | if(substr(getcwd(), -4) != 'docs') |
71 | 76 | { |
72 | 77 | $path_prefix = 'docs/'; |
73 | -} |
|
74 | -else |
|
78 | +} else |
|
75 | 79 | { |
76 | 80 | $path_prefix = ''; |
77 | 81 | } |
@@ -119,8 +123,7 @@ discard block |
||
119 | 123 | $buffer['name'] = $chapter[0]; |
120 | 124 | } |
121 | 125 | $prev_chapter_is_header = true; |
122 | - } |
|
123 | - else |
|
126 | + } else |
|
124 | 127 | { |
125 | 128 | $prev_chapter_is_header = false; |
126 | 129 | foreach($chapter as &$note) |
@@ -150,8 +153,7 @@ discard block |
||
150 | 153 | if(!isset($note_out['name'])) |
151 | 154 | { |
152 | 155 | $note_out['name'] = $buf_str; |
153 | - } |
|
154 | - else |
|
156 | + } else |
|
155 | 157 | { |
156 | 158 | $note_out['lines'][] = $buf_str; |
157 | 159 | } |
@@ -228,36 +230,31 @@ discard block |
||
228 | 230 | if($matches[2]) |
229 | 231 | { |
230 | 232 | buf_print("<ol>\r\n"); |
231 | - } |
|
232 | - else |
|
233 | + } else |
|
233 | 234 | { |
234 | 235 | buf_print("<ul>\r\n"); |
235 | 236 | } |
236 | 237 | buf_print('<li>'); |
237 | 238 | $last_spaces = $matches[1]; |
238 | 239 | $depth[] = $matches[2]; |
239 | - } |
|
240 | - elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
240 | + } elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
241 | 241 | { |
242 | 242 | if(array_pop($depth)) |
243 | 243 | { |
244 | 244 | buf_print("</ol>\r\n"); |
245 | - } |
|
246 | - else |
|
245 | + } else |
|
247 | 246 | { |
248 | 247 | buf_print("</ul>\r\n"); |
249 | 248 | } |
250 | 249 | $last_spaces = $matches[1]; |
251 | 250 | buf_print('<li>'); |
252 | - } |
|
253 | - elseif(strlen($last_spaces) == strlen($matches[1])) |
|
251 | + } elseif(strlen($last_spaces) == strlen($matches[1])) |
|
254 | 252 | { |
255 | 253 | if($matches[2] == '' && $depth[count($depth) - 1] != '') |
256 | 254 | { |
257 | 255 | buf_print("</ol>\r\n"); |
258 | 256 | buf_print("<ul>\r\n"); |
259 | - } |
|
260 | - elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
257 | + } elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
261 | 258 | { |
262 | 259 | buf_print("</ul>\r\n"); |
263 | 260 | buf_print("<ol>\r\n"); |
@@ -274,8 +271,7 @@ discard block |
||
274 | 271 | if(array_pop($depth)) |
275 | 272 | { |
276 | 273 | buf_print("</ol>\r\n"); |
277 | - } |
|
278 | - else |
|
274 | + } else |
|
279 | 275 | { |
280 | 276 | buf_print("</ul>\r\n"); |
281 | 277 | } |
@@ -24,7 +24,9 @@ |
||
24 | 24 | * DO NOT CHANGE |
25 | 25 | */ |
26 | 26 | |
27 | -if (!defined('INSIDE')) die(); |
|
27 | +if (!defined('INSIDE')) { |
|
28 | + die(); |
|
29 | +} |
|
28 | 30 | |
29 | 31 | |
30 | 32 | $a_lang_array = (array( |
@@ -86,8 +86,7 @@ discard block |
||
86 | 86 | if($n % 2 == 0) |
87 | 87 | { |
88 | 88 | $median = ($args[$h] + $args[$h-1]) / 2; |
89 | - } |
|
90 | - else |
|
89 | + } else |
|
91 | 90 | { |
92 | 91 | $median = $args[$h]; |
93 | 92 | } |
@@ -111,7 +110,9 @@ discard block |
||
111 | 110 | $eq[$j] /= $eq[$from]; |
112 | 111 | } |
113 | 112 | } |
114 | - if($debug) pdump($linear, 'Нормализовано по х' . $from); |
|
113 | + if($debug) { |
|
114 | + pdump($linear, 'Нормализовано по х' . $from); |
|
115 | + } |
|
115 | 116 | |
116 | 117 | for($i = $from + 1; $i < count($linear); $i++) |
117 | 118 | { |
@@ -121,7 +122,9 @@ discard block |
||
121 | 122 | $eq[$j] -= $linear[$from][$j]; |
122 | 123 | } |
123 | 124 | } |
124 | - if($debug) pdump($linear, 'Подставили х' . $from); |
|
125 | + if($debug) { |
|
126 | + pdump($linear, 'Подставили х' . $from); |
|
127 | + } |
|
125 | 128 | |
126 | 129 | if($from < count($linear) - 1) |
127 | 130 | { |
@@ -138,11 +141,14 @@ discard block |
||
138 | 141 | $eq[$j] = $eq[$j] - $eq[$from] * $linear[$from][$j]; |
139 | 142 | } |
140 | 143 | } |
141 | - if($debug) pdump($linear, 'Подставили обратно х' . $from); |
|
142 | - } |
|
143 | - else |
|
144 | + if($debug) { |
|
145 | + pdump($linear, 'Подставили обратно х' . $from); |
|
146 | + } |
|
147 | + } else |
|
144 | 148 | { |
145 | - if($debug) pdump($linear, 'Результат' . $from); |
|
149 | + if($debug) { |
|
150 | + pdump($linear, 'Результат' . $from); |
|
151 | + } |
|
146 | 152 | foreach($linear as $index => &$eq) |
147 | 153 | { |
148 | 154 | pdump($eq[count($linear)], 'x' . $index); |
@@ -32,14 +32,18 @@ discard block |
||
32 | 32 | function db_planet_by_parent($parent_id, $for_update = false, $fields = '*') |
33 | 33 | { |
34 | 34 | //if(!($parent_id = intval($parent_id))) return false; |
35 | - if(!($parent_id = idval($parent_id))) return false; |
|
35 | + if(!($parent_id = idval($parent_id))) { |
|
36 | + return false; |
|
37 | + } |
|
36 | 38 | return classSupernova::db_get_record_list(LOC_PLANET, |
37 | 39 | "`parent_planet` = {$parent_id} AND `planet_type` = " . PT_MOON, true); |
38 | 40 | } |
39 | 41 | function db_planet_by_id_and_owner($planet_id, $owner_id, $for_update = false, $fields = '*') |
40 | 42 | { |
41 | 43 | //if(!($planet_id = intval($planet_id)) || !($owner_id = intval($owner_id))) return false; |
42 | - if(!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) return false; |
|
44 | + if(!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) { |
|
45 | + return false; |
|
46 | + } |
|
43 | 47 | return classSupernova::db_get_record_list(LOC_PLANET, |
44 | 48 | "`id` = {$planet_id} AND `id_owner` = {$owner_id}", true); |
45 | 49 | } |
@@ -48,7 +52,9 @@ discard block |
||
48 | 52 | function db_planet_list_moon_other($user_id, $this_moon_id) |
49 | 53 | { |
50 | 54 | // if(!($user_id = intval($user_id)) || !($this_moon_id = intval($this_moon_id))) return false; |
51 | - if(!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) return false; |
|
55 | + if(!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) { |
|
56 | + return false; |
|
57 | + } |
|
52 | 58 | return classSupernova::db_get_record_list(LOC_PLANET, |
53 | 59 | "`planet_type` = " . PT_MOON . " AND `id_owner` = {$user_id} AND `id` != {$this_moon_id}"); |
54 | 60 | } |
@@ -61,7 +67,9 @@ discard block |
||
61 | 67 | } |
62 | 68 | |
63 | 69 | function db_planet_list_sorted($user_row, $skip_planet_id = false, $field_list = '', $conditions = '') { |
64 | - if(!is_array($user_row)) return false; |
|
70 | + if(!is_array($user_row)) { |
|
71 | + return false; |
|
72 | + } |
|
65 | 73 | // $field_list = $field_list != '*' ? "{{planets}}.`id`, `name`, `image`, {{planets}}.`galaxy`, {{planets}}.`system`, {{planets}}.`planet`, `planet_type`{$field_list}" : $field_list; |
66 | 74 | $conditions .= $skip_planet_id ? " AND `id` <> {$skip_planet_id} " : ''; |
67 | 75 | |
@@ -80,7 +88,9 @@ discard block |
||
80 | 88 | "`id_owner` = '{$user_row['id']}' {$conditions} ORDER BY {$order_by}"); |
81 | 89 | } |
82 | 90 | function db_planet_list_by_user_or_planet($user_id, $planet_id) { |
83 | - if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) return false; |
|
91 | + if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
|
92 | + return false; |
|
93 | + } |
|
84 | 94 | |
85 | 95 | return classSupernova::db_get_record_list(LOC_PLANET, |
86 | 96 | $planet_id = idval($planet_id) ? "{{planets}}.`id` = {$planet_id}" : "`id_owner` = {$user_id}", $planet_id); |
@@ -89,12 +99,16 @@ discard block |
||
89 | 99 | function db_planet_set_by_id($planet_id, $set) |
90 | 100 | { |
91 | 101 | // if(!($planet_id = intval($planet_id))) return false; |
92 | - if(!($planet_id = idval($planet_id))) return false; |
|
102 | + if(!($planet_id = idval($planet_id))) { |
|
103 | + return false; |
|
104 | + } |
|
93 | 105 | return classSupernova::db_upd_record_by_id(LOC_PLANET, $planet_id, $set); |
94 | 106 | } |
95 | 107 | function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) |
96 | 108 | { |
97 | - if(!($set = trim($set))) return false; |
|
109 | + if(!($set = trim($set))) { |
|
110 | + return false; |
|
111 | + } |
|
98 | 112 | |
99 | 113 | $si_galaxy = intval($ui_galaxy); |
100 | 114 | $si_system = intval($ui_system); |
@@ -106,13 +120,17 @@ discard block |
||
106 | 120 | function db_planet_set_by_parent($ui_parent_id, $ss_set) |
107 | 121 | { |
108 | 122 | //if(!($si_parent_id = intval($ui_parent_id)) || !($ss_set = trim($ss_set))) return false; |
109 | - if(!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) return false; |
|
123 | + if(!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) { |
|
124 | + return false; |
|
125 | + } |
|
110 | 126 | return classSupernova::db_upd_record_list(LOC_PLANET, "`parent_planet` = {$si_parent_id}", $ss_set); |
111 | 127 | } |
112 | 128 | function db_planet_set_by_owner($ui_owner_id, $ss_set) |
113 | 129 | { |
114 | 130 | //if(!($si_owner_id = intval($ui_owner_id)) || !($ss_set = trim($ss_set))) return false; |
115 | - if(!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) return false; |
|
131 | + if(!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) { |
|
132 | + return false; |
|
133 | + } |
|
116 | 134 | return classSupernova::db_upd_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}", $ss_set); |
117 | 135 | } |
118 | 136 | |
@@ -120,7 +138,9 @@ discard block |
||
120 | 138 | function db_planet_delete_by_id($planet_id) |
121 | 139 | { |
122 | 140 | // if(!($planet_id = intval($planet_id))) return false; |
123 | - if(!($planet_id = idval($planet_id))) return false; |
|
141 | + if(!($planet_id = idval($planet_id))) { |
|
142 | + return false; |
|
143 | + } |
|
124 | 144 | classSupernova::db_del_record_by_id(LOC_PLANET, $planet_id); |
125 | 145 | classSupernova::db_del_record_list(LOC_UNIT, "`unit_location_type` = " . LOC_PLANET . " AND `unit_location_id` = " . $planet_id); |
126 | 146 | // Очереди очистятся автоматически по FOREIGN KEY |
@@ -129,7 +149,9 @@ discard block |
||
129 | 149 | function db_planet_list_delete_by_owner($ui_owner_id) |
130 | 150 | { |
131 | 151 | // if(!($si_owner_id = intval($ui_owner_id))) return false; |
132 | - if(!($si_owner_id = idval($ui_owner_id))) return false; |
|
152 | + if(!($si_owner_id = idval($ui_owner_id))) { |
|
153 | + return false; |
|
154 | + } |
|
133 | 155 | classSupernova::db_del_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}"); |
134 | 156 | classSupernova::db_del_record_list(LOC_UNIT, "`unit_location_type` = " . LOC_PLANET . " AND `unit_player_id` = " . $si_owner_id); |
135 | 157 | // Очереди очистятся автоматически по FOREIGN KEY |
@@ -34,15 +34,16 @@ discard block |
||
34 | 34 | { |
35 | 35 | $sort2s = "DESC"; |
36 | 36 | $sort2 = 0; |
37 | -} |
|
38 | -else |
|
37 | +} else |
|
39 | 38 | { |
40 | 39 | $sort2s = "ASC"; |
41 | 40 | $sort2 = 1; |
42 | 41 | } |
43 | 42 | |
44 | 43 | $sort1 = sys_get_param_int('sort1'); |
45 | -if($sort1>5 || $sort1<0) $sort1 = 0; |
|
44 | +if($sort1>5 || $sort1<0) { |
|
45 | + $sort1 = 0; |
|
46 | +} |
|
46 | 47 | $sort1s = array( |
47 | 48 | 0 => '`ally_rank_id` %1$s;', |
48 | 49 | 1 => '`username` %1$s;', |
@@ -69,8 +70,7 @@ discard block |
||
69 | 70 | if ($ally['ally_owner'] == $userRow['id']) |
70 | 71 | { |
71 | 72 | $ally_range = ($ally['ally_owner_range'])?$ally['ally_owner_range']:$lang['Founder']; |
72 | - } |
|
73 | - else |
|
73 | + } else |
|
74 | 74 | { |
75 | 75 | if($user_admin) |
76 | 76 | { |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | |
79 | 79 | foreach($ranks as $rankID => $rankArray){ |
80 | 80 | $ally_range .= '<option value="' . $rankID . '"'; |
81 | - if($rankID == $userRow['ally_rank_id']) |
|
82 | - $ally_range .= " selected"; |
|
81 | + if($rankID == $userRow['ally_rank_id']) { |
|
82 | + $ally_range .= " selected"; |
|
83 | + } |
|
83 | 84 | $ally_range .= '>' . $rankArray['name']; |
84 | 85 | $ally_range .= '</option>'; |
85 | 86 | } |
86 | 87 | $ally_range .= '</select>'; |
87 | - } |
|
88 | - else |
|
88 | + } else |
|
89 | 89 | { |
90 | 90 | $ally_range = $ranks[$userRow['ally_rank_id']]['name']; |
91 | 91 | } |
@@ -97,53 +97,44 @@ discard block |
||
97 | 97 | if ( $last_active < 60 ) |
98 | 98 | { |
99 | 99 | $tmp = "lime>{$lang['On']}"; |
100 | - } |
|
101 | - elseif ($last_active < 60 * 60) |
|
100 | + } elseif ($last_active < 60 * 60) |
|
102 | 101 | { |
103 | 102 | $last_active = round($last_active / 60); |
104 | 103 | $tmp = "lime>{$last_active} {$lang['sys_min_short']}"; |
105 | - } |
|
106 | - elseif ($last_active < 60 * 60 * 24) |
|
104 | + } elseif ($last_active < 60 * 60 * 24) |
|
107 | 105 | { |
108 | 106 | $last_active = round( $last_active / (60 * 60)); |
109 | 107 | $tmp = "green>{$last_active} {$lang['sys_hrs_short']}"; |
110 | - } |
|
111 | - else |
|
108 | + } else |
|
112 | 109 | { |
113 | 110 | $last_active = round( $last_active / (60 * 60 * 24)); |
114 | 111 | if ($last_active < 7) |
115 | 112 | { |
116 | 113 | $tmp = "yellow"; |
117 | - } |
|
118 | - elseif ($last_active < 30) |
|
114 | + } elseif ($last_active < 30) |
|
119 | 115 | { |
120 | 116 | $tmp = "orange"; |
121 | - } |
|
122 | - else |
|
117 | + } else |
|
123 | 118 | { |
124 | 119 | $tmp = "red"; |
125 | 120 | } |
126 | 121 | $tmp .= ">{$last_active} {$lang['sys_day_short']}"; |
127 | 122 | } |
128 | - } |
|
129 | - else |
|
123 | + } else |
|
130 | 124 | { |
131 | 125 | if($user_onlinestatus) |
132 | 126 | { |
133 | 127 | if ( $last_active < 60 * 5 ) |
134 | 128 | { |
135 | 129 | $tmp = "lime>{$lang['On']}"; |
136 | - } |
|
137 | - elseif ($last_active < 60 * 15) |
|
130 | + } elseif ($last_active < 60 * 15) |
|
138 | 131 | { |
139 | 132 | $tmp = "yellow>{$lang['ali_lessThen15min']}"; |
140 | - } |
|
141 | - else |
|
133 | + } else |
|
142 | 134 | { |
143 | 135 | $tmp = "red>{$lang['Off']}"; |
144 | 136 | } |
145 | - } |
|
146 | - else |
|
137 | + } else |
|
147 | 138 | { |
148 | 139 | $sort1 = max($sort1, 4); |
149 | 140 | $tmp = "orange>-"; |
@@ -46,8 +46,7 @@ |
||
46 | 46 | sn_db_transaction_commit(); |
47 | 47 | sys_redirect("galaxy.php?mode=name&galaxy={$uni_galaxy}&system={$uni_system}"); |
48 | 48 | } |
49 | - } |
|
50 | - catch (exception $e) |
|
49 | + } catch (exception $e) |
|
51 | 50 | { |
52 | 51 | sn_db_transaction_rollback(); |
53 | 52 | $template->assign_block_vars('result', array( |