@@ -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 | $a_lang_array = (array( |
30 | 32 | 'msg_page_header' => 'Личные сообщения', |
@@ -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 | $a_lang_array = (array( |
30 | 32 | 'eco_mrk_title' => 'Чёрный Рынок', |
@@ -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 | $a_lang_array = (array( |
30 | 32 | 'flt_page2_title' => 'Выбор задания', |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | function geometry_progression_sum($n, $b1, $q) { |
4 | - return $q != 1 ? ($b1 * (pow($q, $n) - 1)/($q - 1)) : ($n * $b1); |
|
4 | + return $q != 1 ? ($b1 * (pow($q, $n) - 1) / ($q - 1)) : ($n * $b1); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | function sn_floor($value) |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @return float|int |
45 | 45 | */ |
46 | -function sn_rand_gauss_range($range_start, $range_end, $round = true, $strict = 4, $cut_extreme = false) { |
|
47 | - if($cut_extreme) { |
|
46 | +function sn_rand_gauss_range($range_start, $range_end, $round = true, $strict = 4, $cut_extreme = false) { |
|
47 | + if ($cut_extreme) { |
|
48 | 48 | $range_start--; |
49 | 49 | $range_end++; |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | $args = func_get_args(); |
62 | 62 | |
63 | - switch(func_num_args()) |
|
63 | + switch (func_num_args()) |
|
64 | 64 | { |
65 | 65 | case 0: |
66 | 66 | // trigger_error('median() requires at least one parameter',E_USER_WARNING); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | // fallthrough |
73 | 73 | |
74 | 74 | default: |
75 | - if(!is_array($args)) |
|
75 | + if (!is_array($args)) |
|
76 | 76 | { |
77 | 77 | // trigger_error('median() requires a list of numbers to operate on or an array of numbers', E_USER_NOTICE); |
78 | 78 | return false; |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | $n = count($args); |
84 | 84 | $h = intval($n / 2); |
85 | 85 | |
86 | - if($n % 2 == 0) |
|
86 | + if ($n % 2 == 0) |
|
87 | 87 | { |
88 | - $median = ($args[$h] + $args[$h-1]) / 2; |
|
88 | + $median = ($args[$h] + $args[$h - 1]) / 2; |
|
89 | 89 | } |
90 | 90 | else |
91 | 91 | { |
@@ -103,47 +103,47 @@ discard block |
||
103 | 103 | } |
104 | 104 | function linear_calc(&$linear, $from = 0, $debug = false) |
105 | 105 | { |
106 | - for($i = $from; $i < count($linear); $i++) |
|
106 | + for ($i = $from; $i < count($linear); $i++) |
|
107 | 107 | { |
108 | 108 | $eq = &$linear[$i]; |
109 | - for($j = count($eq) - 1; $j >= $from; $j--) |
|
109 | + for ($j = count($eq) - 1; $j >= $from; $j--) |
|
110 | 110 | { |
111 | 111 | $eq[$j] /= $eq[$from]; |
112 | 112 | } |
113 | 113 | } |
114 | - if($debug) pdump($linear, 'Нормализовано по х' . $from); |
|
114 | + if ($debug) pdump($linear, 'Нормализовано по х' . $from); |
|
115 | 115 | |
116 | - for($i = $from + 1; $i < count($linear); $i++) |
|
116 | + for ($i = $from + 1; $i < count($linear); $i++) |
|
117 | 117 | { |
118 | 118 | $eq = &$linear[$i]; |
119 | - for($j = count($eq) - 1; $j >= $from; $j--) |
|
119 | + for ($j = count($eq) - 1; $j >= $from; $j--) |
|
120 | 120 | { |
121 | 121 | $eq[$j] -= $linear[$from][$j]; |
122 | 122 | } |
123 | 123 | } |
124 | - if($debug) pdump($linear, 'Подставили х' . $from); |
|
124 | + if ($debug) pdump($linear, 'Подставили х' . $from); |
|
125 | 125 | |
126 | - if($from < count($linear) - 1) |
|
126 | + if ($from < count($linear) - 1) |
|
127 | 127 | { |
128 | 128 | linear_calc($linear, $from + 1, $debug); |
129 | 129 | } |
130 | 130 | |
131 | - if($from) |
|
131 | + if ($from) |
|
132 | 132 | { |
133 | - for($i = 0; $i < $from; $i++) |
|
133 | + for ($i = 0; $i < $from; $i++) |
|
134 | 134 | { |
135 | 135 | $eq = &$linear[$i]; |
136 | - for($j = count($eq) - 1; $j >= $from; $j--) |
|
136 | + for ($j = count($eq) - 1; $j >= $from; $j--) |
|
137 | 137 | { |
138 | 138 | $eq[$j] = $eq[$j] - $eq[$from] * $linear[$from][$j]; |
139 | 139 | } |
140 | 140 | } |
141 | - if($debug) pdump($linear, 'Подставили обратно х' . $from); |
|
141 | + if ($debug) pdump($linear, 'Подставили обратно х' . $from); |
|
142 | 142 | } |
143 | 143 | else |
144 | 144 | { |
145 | - if($debug) pdump($linear, 'Результат' . $from); |
|
146 | - foreach($linear as $index => &$eq) |
|
145 | + if ($debug) pdump($linear, 'Результат' . $from); |
|
146 | + foreach ($linear as $index => &$eq) |
|
147 | 147 | { |
148 | 148 | pdump($eq[count($linear)], 'x' . $index); |
149 | 149 | } |
@@ -4,16 +4,14 @@ discard block |
||
4 | 4 | return $q != 1 ? ($b1 * (pow($q, $n) - 1)/($q - 1)) : ($n * $b1); |
5 | 5 | } |
6 | 6 | |
7 | -function sn_floor($value) |
|
8 | -{ |
|
7 | +function sn_floor($value) { |
|
9 | 8 | return $value >= 0 ? floor($value) : ceil($value); |
10 | 9 | } |
11 | 10 | |
12 | 11 | // Эта функция выдает нормально распределенное случайное число с матожиднием $mu и стандартным отклонением $sigma |
13 | 12 | // $strict - количество $sigma, по которым идет округление функции. Т.е. $strict = 3 означает, что диапазон значений обрезается по +-3 * $sigma |
14 | 13 | // Используется http://ru.wikipedia.org/wiki/Преобразование_Бокса_—_Мюллера |
15 | -function sn_rand_gauss($mu = 0, $sigma = 1, $strict = false) |
|
16 | -{ |
|
14 | +function sn_rand_gauss($mu = 0, $sigma = 1, $strict = false) { |
|
17 | 15 | // http://ru.wikipedia.org/wiki/Среднеквадратическое_отклонение |
18 | 16 | // При $mu = 0 (график симметричный, цифры только для половины графика) |
19 | 17 | // От 0 до $sigma ~ 34.1% |
@@ -43,7 +41,7 @@ discard block |
||
43 | 41 | * |
44 | 42 | * @return float|int |
45 | 43 | */ |
46 | -function sn_rand_gauss_range($range_start, $range_end, $round = true, $strict = 4, $cut_extreme = false) { |
|
44 | +function sn_rand_gauss_range($range_start, $range_end, $round = true, $strict = 4, $cut_extreme = false) { |
|
47 | 45 | if($cut_extreme) { |
48 | 46 | $range_start--; |
49 | 47 | $range_end++; |
@@ -56,8 +54,7 @@ discard block |
||
56 | 54 | return $result; |
57 | 55 | } |
58 | 56 | |
59 | -function median() |
|
60 | -{ |
|
57 | +function median() { |
|
61 | 58 | $args = func_get_args(); |
62 | 59 | |
63 | 60 | switch(func_num_args()) |
@@ -86,8 +83,7 @@ discard block |
||
86 | 83 | if($n % 2 == 0) |
87 | 84 | { |
88 | 85 | $median = ($args[$h] + $args[$h-1]) / 2; |
89 | - } |
|
90 | - else |
|
86 | + } else |
|
91 | 87 | { |
92 | 88 | $median = $args[$h]; |
93 | 89 | } |
@@ -97,12 +93,10 @@ discard block |
||
97 | 93 | |
98 | 94 | return $median; |
99 | 95 | } |
100 | -function average($arr) |
|
101 | -{ |
|
96 | +function average($arr) { |
|
102 | 97 | return is_array($arr) && count($arr) ? array_sum($arr) / count($arr) : 0; |
103 | 98 | } |
104 | -function linear_calc(&$linear, $from = 0, $debug = false) |
|
105 | -{ |
|
99 | +function linear_calc(&$linear, $from = 0, $debug = false) { |
|
106 | 100 | for($i = $from; $i < count($linear); $i++) |
107 | 101 | { |
108 | 102 | $eq = &$linear[$i]; |
@@ -111,7 +105,9 @@ discard block |
||
111 | 105 | $eq[$j] /= $eq[$from]; |
112 | 106 | } |
113 | 107 | } |
114 | - if($debug) pdump($linear, 'Нормализовано по х' . $from); |
|
108 | + if($debug) { |
|
109 | + pdump($linear, 'Нормализовано по х' . $from); |
|
110 | + } |
|
115 | 111 | |
116 | 112 | for($i = $from + 1; $i < count($linear); $i++) |
117 | 113 | { |
@@ -121,7 +117,9 @@ discard block |
||
121 | 117 | $eq[$j] -= $linear[$from][$j]; |
122 | 118 | } |
123 | 119 | } |
124 | - if($debug) pdump($linear, 'Подставили х' . $from); |
|
120 | + if($debug) { |
|
121 | + pdump($linear, 'Подставили х' . $from); |
|
122 | + } |
|
125 | 123 | |
126 | 124 | if($from < count($linear) - 1) |
127 | 125 | { |
@@ -138,11 +136,14 @@ discard block |
||
138 | 136 | $eq[$j] = $eq[$j] - $eq[$from] * $linear[$from][$j]; |
139 | 137 | } |
140 | 138 | } |
141 | - if($debug) pdump($linear, 'Подставили обратно х' . $from); |
|
142 | - } |
|
143 | - else |
|
139 | + if($debug) { |
|
140 | + pdump($linear, 'Подставили обратно х' . $from); |
|
141 | + } |
|
142 | + } else |
|
144 | 143 | { |
145 | - if($debug) pdump($linear, 'Результат' . $from); |
|
144 | + if($debug) { |
|
145 | + pdump($linear, 'Результат' . $from); |
|
146 | + } |
|
146 | 147 | foreach($linear as $index => &$eq) |
147 | 148 | { |
148 | 149 | pdump($eq[count($linear)], 'x' . $index); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | */ |
11 | 11 | // Changing rank for single user |
12 | 12 | $id_user = sys_get_param_id('id_user'); |
13 | -if(isset($_GET['id_rank'])) |
|
13 | +if (isset($_GET['id_rank'])) |
|
14 | 14 | { |
15 | 15 | $id_rank = sys_get_param_int('id_rank'); |
16 | 16 | } |
17 | -if($id_user && isset($id_rank) && $user_admin){ |
|
17 | +if ($id_user && isset($id_rank) && $user_admin) { |
|
18 | 18 | db_user_set_by_id($id_user, "`ally_rank_id` = {$id_rank}"); |
19 | 19 | } |
20 | 20 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | $sort1 = sys_get_param_int('sort1'); |
45 | -if($sort1>5 || $sort1<0) $sort1 = 0; |
|
45 | +if ($sort1 > 5 || $sort1 < 0) $sort1 = 0; |
|
46 | 46 | $sort1s = array( |
47 | 47 | 0 => '`ally_rank_id` %1$s;', |
48 | 48 | 1 => '`username` %1$s;', |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'id, username, galaxy, system, planet, onlinetime, ally_rank_id, ally_register_time, total_points'); |
59 | 59 | |
60 | 60 | // while ($userRow = db_fetch($userList)) |
61 | -foreach($userList as $userRow) |
|
61 | +foreach ($userList as $userRow) |
|
62 | 62 | { |
63 | 63 | $i++; |
64 | 64 | if (!isset($ranks[$userRow['ally_rank_id']])) |
@@ -68,17 +68,17 @@ discard block |
||
68 | 68 | |
69 | 69 | if ($ally['ally_owner'] == $userRow['id']) |
70 | 70 | { |
71 | - $ally_range = ($ally['ally_owner_range'])?$ally['ally_owner_range']:$lang['Founder']; |
|
71 | + $ally_range = ($ally['ally_owner_range']) ? $ally['ally_owner_range'] : $lang['Founder']; |
|
72 | 72 | } |
73 | 73 | else |
74 | 74 | { |
75 | - if($user_admin) |
|
75 | + if ($user_admin) |
|
76 | 76 | { |
77 | 77 | $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user=' . $userRow['id'] . '&id_rank=\' + this.value">'; |
78 | 78 | |
79 | - foreach($ranks as $rankID => $rankArray){ |
|
79 | + foreach ($ranks as $rankID => $rankArray) { |
|
80 | 80 | $ally_range .= '<option value="' . $rankID . '"'; |
81 | - if($rankID == $userRow['ally_rank_id']) |
|
81 | + if ($rankID == $userRow['ally_rank_id']) |
|
82 | 82 | $ally_range .= " selected"; |
83 | 83 | $ally_range .= '>' . $rankArray['name']; |
84 | 84 | $ally_range .= '</option>'; |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | $last_active = time() - $userRow["onlinetime"]; |
95 | - if($user_admin) |
|
95 | + if ($user_admin) |
|
96 | 96 | { |
97 | - if ( $last_active < 60 ) |
|
97 | + if ($last_active < 60) |
|
98 | 98 | { |
99 | 99 | $tmp = "lime>{$lang['On']}"; |
100 | 100 | } |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | } |
106 | 106 | elseif ($last_active < 60 * 60 * 24) |
107 | 107 | { |
108 | - $last_active = round( $last_active / (60 * 60)); |
|
108 | + $last_active = round($last_active / (60 * 60)); |
|
109 | 109 | $tmp = "green>{$last_active} {$lang['sys_hrs_short']}"; |
110 | 110 | } |
111 | 111 | else |
112 | 112 | { |
113 | - $last_active = round( $last_active / (60 * 60 * 24)); |
|
113 | + $last_active = round($last_active / (60 * 60 * 24)); |
|
114 | 114 | if ($last_active < 7) |
115 | 115 | { |
116 | 116 | $tmp = "yellow"; |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | } |
129 | 129 | else |
130 | 130 | { |
131 | - if($user_onlinestatus) |
|
131 | + if ($user_onlinestatus) |
|
132 | 132 | { |
133 | - if ( $last_active < 60 * 5 ) |
|
133 | + if ($last_active < 60 * 5) |
|
134 | 134 | { |
135 | 135 | $tmp = "lime>{$lang['On']}"; |
136 | 136 | } |
@@ -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>-"; |
@@ -23,8 +23,7 @@ |
||
23 | 23 | if($user_request['request_denied']) |
24 | 24 | { |
25 | 25 | $lang['request_text'] = sprintf($lang['ali_req_deny_msg'], $ally['ally_tag'], $user_request['request_text']); |
26 | - } |
|
27 | - else |
|
26 | + } else |
|
28 | 27 | { |
29 | 28 | $lang['request_text'] = sprintf($lang['ali_req_waiting'], $ally['ally_tag']); |
30 | 29 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | sys_redirect('alliance.php'); |
21 | 21 | } |
22 | 22 | |
23 | - if($user_request['request_denied']) |
|
23 | + if ($user_request['request_denied']) |
|
24 | 24 | { |
25 | 25 | $lang['request_text'] = sprintf($lang['ali_req_deny_msg'], $ally['ally_tag'], $user_request['request_text']); |
26 | 26 | } |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | |
44 | 44 | $ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$id_ally}'", true); |
45 | 45 | |
46 | -if(!$ally) |
|
46 | +if (!$ally) |
|
47 | 47 | { |
48 | 48 | messageBox($lang['ali_sys_notFound'], $lang['ali_req_title']); |
49 | 49 | } |
50 | 50 | |
51 | -if($ally['ally_request_notallow']) |
|
51 | +if ($ally['ally_request_notallow']) |
|
52 | 52 | { |
53 | 53 | messageBox($lang['ali_req_not_allowed'], $lang['ali_req_title']); |
54 | 54 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
3 | +if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) { |
|
4 | 4 | $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403); |
5 | 5 | } |
6 | 6 | |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | } |
10 | 10 | |
11 | 11 | $d = sys_get_param_id('d'); |
12 | -if($d) { |
|
12 | +if ($d) { |
|
13 | 13 | doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '{$lang['ali_req_deny_reason']}' WHERE `id_user`= {$d} LIMIT 1;"); |
14 | 14 | } |
15 | 15 | |
16 | 16 | $id_user = sys_get_param_id('id_user'); |
17 | -if($id_user) { |
|
17 | +if ($id_user) { |
|
18 | 18 | $ally_name_safe = db_escape($ally['ally_name']); |
19 | 19 | $ally_tag_safe = db_escape($ally['ally_tag']); |
20 | 20 | db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = " . SN_TIME_NOW . ", `ally_rank_id` = 0"); |
@@ -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( |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']); |
7 | 7 | $uni_system = sys_get_param_int('system'); |
8 | 8 | |
9 | - if($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
9 | + if ($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
10 | 10 | { |
11 | 11 | throw new exception($lang['uni_msg_error_wrong_galaxy'], ERR_ERROR); |
12 | 12 | } |
13 | 13 | |
14 | - if($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
14 | + if ($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
15 | 15 | { |
16 | 16 | throw new exception($lang['uni_msg_error_wrong_system'], ERR_ERROR); |
17 | 17 | } |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | $uni_row['universe_price'] += $uni_system ? $config->uni_price_system : $config->uni_price_galaxy; |
21 | 21 | $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$lang['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$lang['sys_galaxy']} {$uni_galaxy}")); |
22 | 22 | |
23 | - if(sys_get_param_str('uni_name_submit')) |
|
23 | + if (sys_get_param_str('uni_name_submit')) |
|
24 | 24 | { |
25 | 25 | $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name')); |
26 | 26 | |
27 | 27 | $uni_price = sys_get_param_float('uni_price'); |
28 | - if($uni_price < $uni_row['universe_price']) |
|
28 | + if ($uni_price < $uni_row['universe_price']) |
|
29 | 29 | { |
30 | 30 | throw new exception($lang['uni_msg_error_low_price'], ERR_ERROR); |
31 | 31 | } |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | sn_db_transaction_start(); |
35 | 35 | $user = db_user_by_id($user['id'], true); |
36 | 36 | // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price) |
37 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
37 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
38 | 38 | { |
39 | 39 | throw new exception($lang['uni_msg_error_no_dm'], ERR_ERROR); |
40 | 40 | } |
41 | 41 | |
42 | - if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
42 | + if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
43 | 43 | { |
44 | 44 | throw new exception($lang['sys_msg_err_update_dm'], ERR_ERROR); |
45 | 45 | } |