@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | $galaxy = isset($vector[$prefix . 'galaxy']) ? intval($vector[$prefix . 'galaxy']) : 0; |
37 | 37 | $system = isset($vector[$prefix . 'system']) ? intval($vector[$prefix . 'system']) : 0; |
38 | 38 | $planet = isset($vector[$prefix . 'planet']) ? intval($vector[$prefix . 'planet']) : 0; |
39 | - $planet_type = isset($vector[$prefix . 'planet_type']) ? intval($vector[$prefix . 'planet_type']) : |
|
40 | - (isset($vector[$prefix . 'type']) ? intval($vector[$prefix . 'type']) : 0); |
|
39 | + $planet_type = isset($vector[$prefix . 'planet_type']) ? intval($vector[$prefix . 'planet_type']) : (isset($vector[$prefix . 'type']) ? intval($vector[$prefix . 'type']) : 0); |
|
41 | 40 | $planet_type = $planet_type == PT_DEBRIS ? PT_PLANET : $planet_type; |
42 | 41 | |
43 | 42 | return db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update, $fields); |
@@ -45,7 +44,7 @@ discard block |
||
45 | 44 | |
46 | 45 | function db_planet_by_parent($parent_id, $for_update = false, $fields = '*') { |
47 | 46 | //if(!($parent_id = intval($parent_id))) return false; |
48 | - if(!($parent_id = idval($parent_id))) { |
|
47 | + if (!($parent_id = idval($parent_id))) { |
|
49 | 48 | return false; |
50 | 49 | } |
51 | 50 | |
@@ -55,7 +54,7 @@ discard block |
||
55 | 54 | |
56 | 55 | function db_planet_by_id_and_owner($planet_id, $owner_id, $for_update = false, $fields = '*') { |
57 | 56 | //if(!($planet_id = intval($planet_id)) || !($owner_id = intval($owner_id))) return false; |
58 | - if(!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) { |
|
57 | + if (!($planet_id = idval($planet_id)) || !($owner_id = idval($owner_id))) { |
|
59 | 58 | return false; |
60 | 59 | } |
61 | 60 | |
@@ -66,7 +65,7 @@ discard block |
||
66 | 65 | |
67 | 66 | function db_planet_list_moon_other($user_id, $this_moon_id) { |
68 | 67 | // if(!($user_id = intval($user_id)) || !($this_moon_id = intval($this_moon_id))) return false; |
69 | - if(!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) { |
|
68 | + if (!($user_id = idval($user_id)) || !($this_moon_id = idval($this_moon_id))) { |
|
70 | 69 | return false; |
71 | 70 | } |
72 | 71 | |
@@ -83,7 +82,7 @@ discard block |
||
83 | 82 | } |
84 | 83 | |
85 | 84 | function db_planet_list_sorted($user_row, $skip_planet_id = false, $field_list = '', $conditions = '') { |
86 | - if(!is_array($user_row)) { |
|
85 | + if (!is_array($user_row)) { |
|
87 | 86 | return false; |
88 | 87 | } |
89 | 88 | // $field_list = $field_list != '*' ? "{{planets}}.`id`, `name`, `image`, {{planets}}.`galaxy`, {{planets}}.`system`, {{planets}}.`planet`, `planet_type`{$field_list}" : $field_list; |
@@ -105,7 +104,7 @@ discard block |
||
105 | 104 | } |
106 | 105 | |
107 | 106 | function db_planet_list_by_user_or_planet($user_id, $planet_id) { |
108 | - if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
|
107 | + if (!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
|
109 | 108 | return false; |
110 | 109 | } |
111 | 110 | |
@@ -115,7 +114,7 @@ discard block |
||
115 | 114 | |
116 | 115 | function db_planet_set_by_id($planet_id, $set) { |
117 | 116 | // if(!($planet_id = intval($planet_id))) return false; |
118 | - if(!($planet_id = idval($planet_id))) { |
|
117 | + if (!($planet_id = idval($planet_id))) { |
|
119 | 118 | return false; |
120 | 119 | } |
121 | 120 | |
@@ -123,7 +122,7 @@ discard block |
||
123 | 122 | } |
124 | 123 | |
125 | 124 | function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) { |
126 | - if(!($set = trim($set))) { |
|
125 | + if (!($set = trim($set))) { |
|
127 | 126 | return false; |
128 | 127 | } |
129 | 128 | |
@@ -137,7 +136,7 @@ discard block |
||
137 | 136 | |
138 | 137 | function db_planet_set_by_parent($ui_parent_id, $ss_set) { |
139 | 138 | //if(!($si_parent_id = intval($ui_parent_id)) || !($ss_set = trim($ss_set))) return false; |
140 | - if(!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) { |
|
139 | + if (!($si_parent_id = idval($ui_parent_id)) || !($ss_set = trim($ss_set))) { |
|
141 | 140 | return false; |
142 | 141 | } |
143 | 142 | |
@@ -146,7 +145,7 @@ discard block |
||
146 | 145 | |
147 | 146 | function db_planet_set_by_owner($ui_owner_id, $ss_set) { |
148 | 147 | //if(!($si_owner_id = intval($ui_owner_id)) || !($ss_set = trim($ss_set))) return false; |
149 | - if(!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) { |
|
148 | + if (!($si_owner_id = idval($ui_owner_id)) || !($ss_set = trim($ss_set))) { |
|
150 | 149 | return false; |
151 | 150 | } |
152 | 151 | |
@@ -156,7 +155,7 @@ discard block |
||
156 | 155 | |
157 | 156 | function db_planet_delete_by_id($planet_id) { |
158 | 157 | // if(!($planet_id = intval($planet_id))) return false; |
159 | - if(!($planet_id = idval($planet_id))) { |
|
158 | + if (!($planet_id = idval($planet_id))) { |
|
160 | 159 | return false; |
161 | 160 | } |
162 | 161 | classSupernova::db_del_record_by_id(LOC_PLANET, $planet_id); |
@@ -168,7 +167,7 @@ discard block |
||
168 | 167 | |
169 | 168 | function db_planet_list_delete_by_owner($ui_owner_id) { |
170 | 169 | // if(!($si_owner_id = intval($ui_owner_id))) return false; |
171 | - if(!($si_owner_id = idval($ui_owner_id))) { |
|
170 | + if (!($si_owner_id = idval($ui_owner_id))) { |
|
172 | 171 | return false; |
173 | 172 | } |
174 | 173 | classSupernova::db_del_record_list(LOC_PLANET, "`id_owner` = {$si_owner_id}"); |