We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -22,16 +22,18 @@ discard block |
||
22 | 22 | $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id - 1)); |
23 | 23 | |
24 | 24 | // no result? |
25 | - if (!$db2->getNumRows()) |
|
26 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
25 | + if (!$db2->getNumRows()) { |
|
26 | + $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
27 | + } |
|
27 | 28 | |
28 | 29 | echo ('<th width="32">'); |
29 | 30 | if ($db2->nextRecord()) { |
30 | 31 | $previous_topic_id = $db2->getInt('topic_id'); |
31 | 32 | $previous_topic = stripslashes($db2->getField('topic')); |
32 | 33 | echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
33 | - } else |
|
34 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
34 | + } else { |
|
35 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
36 | + } |
|
35 | 37 | echo ('</th>'); |
36 | 38 | |
37 | 39 | // ************************** |
@@ -43,8 +45,9 @@ discard block |
||
43 | 45 | $up_topic_id = $db2->getInt('topic_id'); |
44 | 46 | $up_topic = stripslashes($db2->getField('topic')); |
45 | 47 | echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
46 | - } else |
|
47 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
48 | + } else { |
|
49 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
50 | + } |
|
48 | 51 | echo ('</th>'); |
49 | 52 | |
50 | 53 | // ************************** |
@@ -52,8 +55,9 @@ discard block |
||
52 | 55 | // ************************** |
53 | 56 | $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1'); |
54 | 57 | |
55 | - if (!$db2->getNumRows()) |
|
56 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1)); |
|
58 | + if (!$db2->getNumRows()) { |
|
59 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1)); |
|
60 | + } |
|
57 | 61 | |
58 | 62 | $seenParentIDs = array(0); |
59 | 63 | $curr_parent_topic_id = $parent_topic_id; |
@@ -72,8 +76,7 @@ discard block |
||
72 | 76 | $next_topic_id = $db2->getInt('topic_id'); |
73 | 77 | $next_topic = stripslashes($db2->getField('topic')); |
74 | 78 | echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
75 | - } |
|
76 | - else { |
|
79 | + } else { |
|
77 | 80 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
78 | 81 | } |
79 | 82 | echo ('</th>'); |
@@ -85,18 +88,22 @@ discard block |
||
85 | 88 | |
86 | 89 | echo ('<tr>'); |
87 | 90 | echo ('<td colspan="5">'); |
88 | - if (isset($previous_topic_id) && $previous_topic_id > 0) |
|
89 | - echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a> '); |
|
90 | - if (isset($up_topic_id) && $up_topic_id > 0) |
|
91 | - echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a> '); |
|
92 | - if (isset($next_topic_id) && $next_topic_id > 0) |
|
93 | - echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>'); |
|
91 | + if (isset($previous_topic_id) && $previous_topic_id > 0) { |
|
92 | + echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a> '); |
|
93 | + } |
|
94 | + if (isset($up_topic_id) && $up_topic_id > 0) { |
|
95 | + echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a> '); |
|
96 | + } |
|
97 | + if (isset($next_topic_id) && $next_topic_id > 0) { |
|
98 | + echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>'); |
|
99 | + } |
|
94 | 100 | echo ('</tr>'); |
95 | 101 | |
96 | 102 | echo ('</table>'); |
97 | - } else |
|
98 | - echo ('Invalid Topic!'); |
|
99 | -} |
|
103 | + } else { |
|
104 | + echo ('Invalid Topic!'); |
|
105 | + } |
|
106 | + } |
|
100 | 107 | |
101 | 108 | function echo_content($topic_id) { |
102 | 109 | // database object |
@@ -114,9 +121,10 @@ discard block |
||
114 | 121 | echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>'); |
115 | 122 | echo ('<p>'.$text.'<p>'); |
116 | 123 | echo ('</div>'); |
117 | - } else |
|
118 | - echo ('Invalid Topic!'); |
|
119 | -} |
|
124 | + } else { |
|
125 | + echo ('Invalid Topic!'); |
|
126 | + } |
|
127 | + } |
|
120 | 128 | |
121 | 129 | function echo_subsection($topic_id) { |
122 | 130 | // database object |
@@ -35,9 +35,13 @@ discard block |
||
35 | 35 | |
36 | 36 | foreach ($links as $key => $linkArray) { |
37 | 37 | if ($linkArray['ID'] > 0 && $linkArray['ID'] != $player->getSectorID()) { |
38 | - if ($player->getLastSectorID() == $linkArray['ID']) $class = 'lastVisited'; |
|
39 | - else if (isset($unvisited[$linkArray['ID']])) $class = 'unvisited'; |
|
40 | - else $class = 'visited'; |
|
38 | + if ($player->getLastSectorID() == $linkArray['ID']) { |
|
39 | + $class = 'lastVisited'; |
|
40 | + } else if (isset($unvisited[$linkArray['ID']])) { |
|
41 | + $class = 'unvisited'; |
|
42 | + } else { |
|
43 | + $class = 'visited'; |
|
44 | + } |
|
41 | 45 | $links[$key]['Class'] = $class; |
42 | 46 | } |
43 | 47 | } |
@@ -80,18 +84,18 @@ discard block |
||
80 | 84 | if ($player->getNewbieTurns()) { |
81 | 85 | if ($player->getNewbieTurns() < 25) { |
82 | 86 | $protectionMessage = '<span class="blue">PROTECTION</span>: You are almost out of <span class="green">NEWBIE</span> protection.'; |
87 | + } else { |
|
88 | + $protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="green">NEWBIE</span> protection.'; |
|
83 | 89 | } |
84 | - else |
|
85 | - $protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="green">NEWBIE</span> protection.'; |
|
86 | -} |
|
87 | -elseif ($player->hasFederalProtection()) { |
|
90 | + } elseif ($player->hasFederalProtection()) { |
|
88 | 91 | $protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="blue">FEDERAL</span> protection.'; |
89 | -} |
|
90 | -elseif ($sector->offersFederalProtection()) |
|
92 | +} elseif ($sector->offersFederalProtection()) { |
|
91 | 93 | $protectionMessage = '<span class="blue">PROTECTION</span>: You are <span class="red">NOT</span> under protection.'; |
94 | +} |
|
92 | 95 | |
93 | -if (!empty($protectionMessage)) |
|
96 | +if (!empty($protectionMessage)) { |
|
94 | 97 | $template->assign('ProtectionMessage', $protectionMessage); |
98 | +} |
|
95 | 99 | |
96 | 100 | //enableProtectionDependantRefresh($template,$player); |
97 | 101 | |
@@ -115,7 +119,9 @@ discard block |
||
115 | 119 | } |
116 | 120 | |
117 | 121 | //error msgs take precedence |
118 | -if (isset($var['errorMsg'])) $template->assign('ErrorMessage', $var['errorMsg']); |
|
122 | +if (isset($var['errorMsg'])) { |
|
123 | + $template->assign('ErrorMessage', $var['errorMsg']); |
|
124 | +} |
|
119 | 125 | |
120 | 126 | // ******************************************* |
121 | 127 | // * |
@@ -150,8 +156,9 @@ discard block |
||
150 | 156 | $remainingTime = $db->getInt('refresh_at') - TIME; |
151 | 157 | $forceRefreshMessage = '<span class="green">REFRESH</span>: All forces will be refreshed in ' . $remainingTime . ' seconds.'; |
152 | 158 | $db->query('REPLACE INTO sector_message (game_id, account_id, message) VALUES (' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($player->getAccountID()) . ', \'[Force Check]\')'); |
159 | + } else { |
|
160 | + $forceRefreshMessage = '<span class="green">REFRESH</span>: All forces have finished refreshing.'; |
|
153 | 161 | } |
154 | - else $forceRefreshMessage = '<span class="green">REFRESH</span>: All forces have finished refreshing.'; |
|
155 | 162 | $template->assign('ForceRefreshMessage', $forceRefreshMessage); |
156 | 163 | } |
157 | 164 | } |
@@ -10,10 +10,11 @@ discard block |
||
10 | 10 | |
11 | 11 | $db->lockTable('album_has_comments'); |
12 | 12 | $db->query('SELECT MAX(comment_id) FROM album_has_comments WHERE album_id = ' . $db->escapeNumber($account_id)); |
13 | - if ($db->nextRecord()) |
|
14 | - $comment_id = $db->getInt('MAX(comment_id)') + 1; |
|
15 | - else |
|
16 | - $comment_id = 1; |
|
13 | + if ($db->nextRecord()) { |
|
14 | + $comment_id = $db->getInt('MAX(comment_id)') + 1; |
|
15 | + } else { |
|
16 | + $comment_id = 1; |
|
17 | + } |
|
17 | 18 | |
18 | 19 | $db->query('INSERT INTO album_has_comments |
19 | 20 | (album_id, comment_id, time, post_id, msg) |
@@ -31,17 +32,17 @@ discard block |
||
31 | 32 | $mail->send(); |
32 | 33 | } |
33 | 34 | |
34 | -} else if ($var['task'] == 'reset_location') |
|
35 | +} else if ($var['task'] == 'reset_location') { |
|
35 | 36 | $db->query('UPDATE album SET location = \'\' WHERE account_id = ' . $db->escapeNumber($account_id)); |
36 | -else if ($var['task'] == 'reset_email') |
|
37 | +} else if ($var['task'] == 'reset_email') { |
|
37 | 38 | $db->query('UPDATE album SET email = \'\' WHERE account_id =' . $db->escapeNumber($account_id)); |
38 | -else if ($var['task'] == 'reset_website') |
|
39 | +} else if ($var['task'] == 'reset_website') { |
|
39 | 40 | $db->query('UPDATE album SET website = \'\' WHERE account_id = ' . $db->escapeNumber($account_id)); |
40 | -else if ($var['task'] == 'reset_birthdate') |
|
41 | +} else if ($var['task'] == 'reset_birthdate') { |
|
41 | 42 | $db->query('UPDATE album SET day = 0, month = 0, year = 0 WHERE account_id = ' . $db->escapeNumber($account_id)); |
42 | -else if ($var['task'] == 'reset_other') |
|
43 | +} else if ($var['task'] == 'reset_other') { |
|
43 | 44 | $db->query('UPDATE album SET other = \'\' WHERE account_id = ' . $db->escapeNumber($account_id)); |
44 | -else if ($var['task'] == 'delete_comment') { |
|
45 | +} else if ($var['task'] == 'delete_comment') { |
|
45 | 46 | $comment_ids = $_REQUEST['comment_ids']; |
46 | 47 | // we just ignore if nothing was set |
47 | 48 | if (count($comment_ids) > 0) { |
@@ -50,8 +51,7 @@ discard block |
||
50 | 51 | WHERE album_id = '.$db->escapeNumber($account_id) . ' AND |
51 | 52 | comment_id IN ('.$db->escapeArray($comment_ids) . ')'); |
52 | 53 | } |
53 | -} |
|
54 | -else { |
|
54 | +} else { |
|
55 | 55 | create_error('No action chosen!'); |
56 | 56 | } |
57 | 57 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | $action = $_REQUEST['action']; |
12 | 12 | if ($_REQUEST['save'] == 'Yes') { |
13 | 13 | $save = true; |
14 | -} |
|
15 | -else { |
|
14 | +} else { |
|
16 | 15 | $save = false; |
17 | 16 | } |
18 | 17 | |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | $mines = $db2->getInt('sum_m'); |
43 | 42 | $cds = $db2->getInt('cds'); |
44 | 43 | $sds = $db2->getInt('sds'); |
45 | - } |
|
46 | - else { |
|
44 | + } else { |
|
47 | 45 | $mines = 0; |
48 | 46 | $cds = 0; |
49 | 47 | $sds = 0; |
@@ -143,16 +141,25 @@ discard block |
||
143 | 141 | $owner = $db->getInt('owner_id'); |
144 | 142 | |
145 | 143 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 1'); |
146 | - if ($db2->nextRecord()) $gens = $db2->getInt('amount'); |
|
147 | - else $gens = 0; |
|
144 | + if ($db2->nextRecord()) { |
|
145 | + $gens = $db2->getInt('amount'); |
|
146 | + } else { |
|
147 | + $gens = 0; |
|
148 | + } |
|
148 | 149 | |
149 | 150 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 2'); |
150 | - if ($db2->nextRecord()) $hangs = $db2->getInt('amount'); |
|
151 | - else $hangs = 0; |
|
151 | + if ($db2->nextRecord()) { |
|
152 | + $hangs = $db2->getInt('amount'); |
|
153 | + } else { |
|
154 | + $hangs = 0; |
|
155 | + } |
|
152 | 156 | |
153 | 157 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 3'); |
154 | - if ($db2->nextRecord()) $turs = $db2->getInt('amount'); |
|
155 | - else $turs = 0; |
|
158 | + if ($db2->nextRecord()) { |
|
159 | + $turs = $db2->getInt('amount'); |
|
160 | + } else { |
|
161 | + $turs = 0; |
|
162 | + } |
|
156 | 163 | |
157 | 164 | // insert into history db |
158 | 165 | $history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' . |
@@ -189,14 +196,21 @@ discard block |
||
189 | 196 | $smrCredits = 0; |
190 | 197 | $db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = '.$game_id.' AND account_id = '.$acc_id.' AND claimer_id = 0'); |
191 | 198 | if ($db2->nextRecord()) { |
192 | - if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am'); |
|
193 | - if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred'); |
|
199 | + if (is_int($db2->getField('bounty_am'))) { |
|
200 | + $amount = $db2->getInt('bounty_am'); |
|
201 | + } |
|
202 | + if (is_int($db2->getField('bounty_cred'))) { |
|
203 | + $smrCredits = $db2->getInt('bounty_cred'); |
|
204 | + } |
|
194 | 205 | |
195 | 206 | } |
196 | 207 | |
197 | 208 | $db2->query('SELECT * FROM ship_has_name WHERE game_id = '.$game_id.' AND account_id = '.$acc_id); |
198 | - if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name'); |
|
199 | - else $ship_name = 'None'; |
|
209 | + if ($db2->nextRecord()) { |
|
210 | + $ship_name = $db2->getField('ship_name'); |
|
211 | + } else { |
|
212 | + $ship_name = 'None'; |
|
213 | + } |
|
200 | 214 | |
201 | 215 | // insert into history db |
202 | 216 | $history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' . |
@@ -244,9 +258,15 @@ discard block |
||
244 | 258 | $mines = $db2->getInt('sum_mines'); |
245 | 259 | $cds = $db2->getInt('cds'); |
246 | 260 | $sds = $db2->getInt('sds'); |
247 | - if (!is_numeric($mines)) $mines = 0; |
|
248 | - if (!is_numeric($cds)) $cds = 0; |
|
249 | - if (!is_numeric($sds)) $sds = 0; |
|
261 | + if (!is_numeric($mines)) { |
|
262 | + $mines = 0; |
|
263 | + } |
|
264 | + if (!is_numeric($cds)) { |
|
265 | + $cds = 0; |
|
266 | + } |
|
267 | + if (!is_numeric($sds)) { |
|
268 | + $sds = 0; |
|
269 | + } |
|
250 | 270 | |
251 | 271 | } else { |
252 | 272 |
@@ -56,36 +56,37 @@ |
||
56 | 56 | approved = \'YES\' |
57 | 57 | ORDER BY hof_name'); |
58 | 58 | |
59 | - if ($db2->nextRecord()) |
|
60 | - album_entry($db2->getInt('album_id')); |
|
61 | - else { |
|
59 | + if ($db2->nextRecord()) { |
|
60 | + album_entry($db2->getInt('album_id')); |
|
61 | + } else { |
|
62 | 62 | // get all id's and build array |
63 | 63 | $album_ids = array(); |
64 | 64 | |
65 | - while ($db->nextRecord()) |
|
66 | - $album_ids[] = $db->getInt('album_id'); |
|
65 | + while ($db->nextRecord()) { |
|
66 | + $album_ids[] = $db->getInt('album_id'); |
|
67 | + } |
|
67 | 68 | |
68 | 69 | // double check if we have id's |
69 | - if (count($album_ids) > 0) |
|
70 | - search_result($album_ids); |
|
71 | - else |
|
72 | - main_page(); |
|
70 | + if (count($album_ids) > 0) { |
|
71 | + search_result($album_ids); |
|
72 | + } else { |
|
73 | + main_page(); |
|
74 | + } |
|
73 | 75 | } |
74 | 76 | |
77 | + } elseif ($db->getNumRows() == 1) { |
|
78 | + if ($db->nextRecord()) { |
|
79 | + album_entry($db->getInt('album_id')); |
|
80 | + } else { |
|
81 | + main_page(); |
|
82 | + } |
|
83 | + } else { |
|
84 | + main_page(); |
|
75 | 85 | } |
76 | - elseif ($db->getNumRows() == 1) { |
|
77 | - if ($db->nextRecord()) |
|
78 | - album_entry($db->getInt('album_id')); |
|
79 | - else |
|
80 | - main_page(); |
|
81 | - } |
|
82 | - else |
|
86 | + } else { |
|
83 | 87 | main_page(); |
84 | 88 | } |
85 | - else |
|
86 | - main_page(); |
|
87 | -} |
|
88 | -catch (Throwable $e) { |
|
89 | + } catch (Throwable $e) { |
|
89 | 90 | handleException($e); |
90 | 91 | } |
91 | 92 | ?> |
@@ -14,22 +14,26 @@ discard block |
||
14 | 14 | create_error_offline('You need to logged in to post comments!'); |
15 | 15 | } |
16 | 16 | |
17 | - if (!isset($_GET['album_id']) || empty($_GET['album_id'])) |
|
18 | - create_error_offline('Which picture do you want comment?'); |
|
19 | - else |
|
20 | - $album_id = $_GET['album_id']; |
|
17 | + if (!isset($_GET['album_id']) || empty($_GET['album_id'])) { |
|
18 | + create_error_offline('Which picture do you want comment?'); |
|
19 | + } else { |
|
20 | + $album_id = $_GET['album_id']; |
|
21 | + } |
|
21 | 22 | |
22 | - if (!is_numeric($album_id)) |
|
23 | - create_error_offline('Picture ID has to be numeric!'); |
|
23 | + if (!is_numeric($album_id)) { |
|
24 | + create_error_offline('Picture ID has to be numeric!'); |
|
25 | + } |
|
24 | 26 | |
25 | - if ($album_id < 1) |
|
26 | - create_error_offline('Picture ID has to be positive!'); |
|
27 | + if ($album_id < 1) { |
|
28 | + create_error_offline('Picture ID has to be positive!'); |
|
29 | + } |
|
27 | 30 | |
28 | 31 | $account = SmrSession::getAccount(); |
29 | 32 | |
30 | 33 | if (isset($_GET['action']) && $_GET['action'] == 'Moderate') { |
31 | - if (!$account->hasPermission(PERMISSION_MODERATE_PHOTO_ALBUM)) |
|
32 | - create_error_offline('You do not have permission to do that!'); |
|
34 | + if (!$account->hasPermission(PERMISSION_MODERATE_PHOTO_ALBUM)) { |
|
35 | + create_error_offline('You do not have permission to do that!'); |
|
36 | + } |
|
33 | 37 | $container = create_container('skeleton.php', 'album_moderate.php'); |
34 | 38 | $container['account_id'] = $album_id; |
35 | 39 | |
@@ -38,10 +42,11 @@ discard block |
||
38 | 42 | |
39 | 43 | $db = new SmrMySqlDatabase(); |
40 | 44 | |
41 | - if (!isset($_GET['comment']) || empty($_GET['comment'])) |
|
42 | - create_error_offline('Please enter a comment.'); |
|
43 | - else |
|
44 | - $comment = $_GET['comment']; |
|
45 | + if (!isset($_GET['comment']) || empty($_GET['comment'])) { |
|
46 | + create_error_offline('Please enter a comment.'); |
|
47 | + } else { |
|
48 | + $comment = $_GET['comment']; |
|
49 | + } |
|
45 | 50 | |
46 | 51 | // get current time |
47 | 52 | $curr_time = TIME; |
@@ -53,10 +58,11 @@ discard block |
||
53 | 58 | $db->lockTable('album_has_comments'); |
54 | 59 | |
55 | 60 | $db->query('SELECT MAX(comment_id) FROM album_has_comments WHERE album_id = ' . $db->escapeNumber($album_id)); |
56 | - if ($db->nextRecord()) |
|
57 | - $comment_id = $db->getInt('MAX(comment_id)') + 1; |
|
58 | - else |
|
59 | - $comment_id = 1; |
|
61 | + if ($db->nextRecord()) { |
|
62 | + $comment_id = $db->getInt('MAX(comment_id)') + 1; |
|
63 | + } else { |
|
64 | + $comment_id = 1; |
|
65 | + } |
|
60 | 66 | |
61 | 67 | $db->query('INSERT INTO album_has_comments |
62 | 68 | (album_id, comment_id, time, post_id, msg) |
@@ -65,7 +71,6 @@ discard block |
||
65 | 71 | |
66 | 72 | header('Location: /album/?' . get_album_nick($album_id)); |
67 | 73 | exit; |
68 | -} |
|
69 | -catch (Throwable $e) { |
|
74 | +} catch (Throwable $e) { |
|
70 | 75 | handleException($e); |
71 | 76 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | |
54 | 54 | echo('<span style="font-size:85%;"><b>[' . date(defined('DATE_FULL_SHORT') ?DATE_FULL_SHORT:DEFAULT_DATE_FULL_SHORT, $created) . ']</b> Picture of <a href="?nick=' . urlencode($nick) . '">' . $nick . '</a> added</span><br />'); |
55 | 55 | } |
56 | + } else { |
|
57 | + echo('<span style="font-size:85%;">no entries</span>'); |
|
56 | 58 | } |
57 | - else |
|
58 | - echo('<span style="font-size:85%;">no entries</span>'); |
|
59 | 59 | echo('</p>'); |
60 | 60 | } |
61 | 61 | |
@@ -87,8 +87,7 @@ discard block |
||
87 | 87 | $other = nl2br(stripslashes($db->getField('other'))); |
88 | 88 | $page_views = $db->getInt('page_views'); |
89 | 89 | $disabled = $db->getBoolean('disabled'); |
90 | - } |
|
91 | - else { |
|
90 | + } else { |
|
92 | 91 | echo('<h1>Error</h1>'); |
93 | 92 | echo('This user doesn\'t have an entry in our album!'); |
94 | 93 | return; |
@@ -139,46 +138,54 @@ discard block |
||
139 | 138 | echo('<tr>'); |
140 | 139 | echo('<td colspan="2" class="center" valign="middle">'); |
141 | 140 | |
142 | - if ($disabled == false) |
|
143 | - echo('<img src="../upload/' . $album_id . '">'); |
|
144 | - else |
|
145 | - echo('<img src="../images/album/disabled.jpg">'); |
|
141 | + if ($disabled == false) { |
|
142 | + echo('<img src="../upload/' . $album_id . '">'); |
|
143 | + } else { |
|
144 | + echo('<img src="../images/album/disabled.jpg">'); |
|
145 | + } |
|
146 | 146 | |
147 | 147 | echo('</td>'); |
148 | 148 | echo('</tr>'); |
149 | 149 | |
150 | - if (empty($location)) |
|
151 | - $location = 'N/A'; |
|
150 | + if (empty($location)) { |
|
151 | + $location = 'N/A'; |
|
152 | + } |
|
152 | 153 | echo('<tr>'); |
153 | 154 | echo('<td class="right bold" width="10%">Location:</td><td>' . $location . '</td>'); |
154 | 155 | echo('</tr>'); |
155 | 156 | |
156 | - if (empty($email)) |
|
157 | - $email = 'N/A'; |
|
157 | + if (empty($email)) { |
|
158 | + $email = 'N/A'; |
|
159 | + } |
|
158 | 160 | echo('<tr>'); |
159 | 161 | echo('<td class="right bold" width="10%">E-mail:</td><td>' . $email . '</td>'); |
160 | 162 | echo('</tr>'); |
161 | 163 | |
162 | - if (empty($website)) |
|
163 | - $website = 'N/A'; |
|
164 | - else |
|
165 | - $website = '<a href="' . $website . '" target="_new">' . $website . '</a>'; |
|
164 | + if (empty($website)) { |
|
165 | + $website = 'N/A'; |
|
166 | + } else { |
|
167 | + $website = '<a href="' . $website . '" target="_new">' . $website . '</a>'; |
|
168 | + } |
|
166 | 169 | echo('<tr>'); |
167 | 170 | echo('<td class="right bold" width="10%">Website:</td><td>' . $website . '</td>'); |
168 | 171 | echo('</tr>'); |
169 | 172 | |
170 | 173 | echo('<tr>'); |
171 | - if (!empty($day) && !empty($month) && !empty($year)) |
|
172 | - $birthdate = $month . ' / ' . $day . ' / ' . $year; |
|
173 | - if (empty($birthdate) && !empty($year)) |
|
174 | - $birthdate = 'Year ' . $year; |
|
175 | - if (empty($birthdate)) |
|
176 | - $birthdate = 'N/A'; |
|
174 | + if (!empty($day) && !empty($month) && !empty($year)) { |
|
175 | + $birthdate = $month . ' / ' . $day . ' / ' . $year; |
|
176 | + } |
|
177 | + if (empty($birthdate) && !empty($year)) { |
|
178 | + $birthdate = 'Year ' . $year; |
|
179 | + } |
|
180 | + if (empty($birthdate)) { |
|
181 | + $birthdate = 'N/A'; |
|
182 | + } |
|
177 | 183 | echo('<td class="right bold" width="10%">Birthdate:</td><td>' . $birthdate . '</td>'); |
178 | 184 | echo('</tr>'); |
179 | 185 | |
180 | - if (empty($other)) |
|
181 | - $other = 'N/A'; |
|
186 | + if (empty($other)) { |
|
187 | + $other = 'N/A'; |
|
188 | + } |
|
182 | 189 | echo('<tr>'); |
183 | 190 | echo('<td class="right bold" valign="top" width="10%">Other Info:</td><td>' . $other . '</td>'); |
184 | 191 | echo('</tr>'); |
@@ -210,15 +217,16 @@ discard block |
||
210 | 217 | FROM account_has_permission |
211 | 218 | WHERE account_id = '.$db->escapeNumber(SmrSession::getAccountID()) . ' AND |
212 | 219 | permission_id = '.$db->escapeNumber(PERMISSION_MODERATE_PHOTO_ALBUM)); |
213 | - if ($db->nextRecord()) |
|
214 | - echo('<td style="color:green; font-size:70%;"><br /><input type="submit" name="action" value="Moderate" class="InputFields"></td>'); |
|
220 | + if ($db->nextRecord()) { |
|
221 | + echo('<td style="color:green; font-size:70%;"><br /><input type="submit" name="action" value="Moderate" class="InputFields"></td>'); |
|
222 | + } |
|
215 | 223 | |
216 | 224 | echo('</tr>'); |
217 | 225 | echo('</table>'); |
218 | 226 | echo('</form>'); |
227 | + } else { |
|
228 | + echo('<p>Please <a href="/login.php?return_page=/album/?nick=' . urlencode($nick) . '"><u>login</u></a> if you want comment on this picture!</p>'); |
|
219 | 229 | } |
220 | - else |
|
221 | - echo('<p>Please <a href="/login.php?return_page=/album/?nick=' . urlencode($nick) . '"><u>login</u></a> if you want comment on this picture!</p>'); |
|
222 | 230 | |
223 | 231 | echo('</td>'); |
224 | 232 | echo('</tr>'); |
@@ -288,8 +296,9 @@ discard block |
||
288 | 296 | |
289 | 297 | |
290 | 298 | function get_album_nick($album_id) { |
291 | - if ($album_id == 0) |
|
292 | - return 'System'; |
|
299 | + if ($album_id == 0) { |
|
300 | + return 'System'; |
|
301 | + } |
|
293 | 302 | |
294 | 303 | return SmrAccount::getAccount($album_id)->getHofName(); |
295 | 304 | } |
@@ -17,17 +17,19 @@ discard block |
||
17 | 17 | $race_id_2 = $db->getInt('race_id_2'); |
18 | 18 | $action = $db->getField('action'); |
19 | 19 | |
20 | - if ($action == 'INC') |
|
21 | - $relation_modifier = RELATIONS_VOTE_CHANGE; |
|
22 | - else |
|
23 | - $relation_modifier = -RELATIONS_VOTE_CHANGE; |
|
20 | + if ($action == 'INC') { |
|
21 | + $relation_modifier = RELATIONS_VOTE_CHANGE; |
|
22 | + } else { |
|
23 | + $relation_modifier = -RELATIONS_VOTE_CHANGE; |
|
24 | + } |
|
24 | 25 | |
25 | 26 | $db2->query('SELECT * FROM race_has_relation ' . |
26 | 27 | 'WHERE race_id_1 = ' . $db2->escapeNumber($race_id_1) . ' |
27 | 28 | AND race_id_2 = ' . $db2->escapeNumber($race_id_2) . ' |
28 | 29 | AND game_id = ' . $db2->escapeNumber($player->getGameID())); |
29 | - if ($db2->nextRecord()) |
|
30 | - $relation = $db2->getInt('relation') + $relation_modifier; |
|
30 | + if ($db2->nextRecord()) { |
|
31 | + $relation = $db2->getInt('relation') + $relation_modifier; |
|
32 | + } |
|
31 | 33 | |
32 | 34 | if ($relation < MIN_GLOBAL_RELATIONS) { |
33 | 35 | $relation = MIN_GLOBAL_RELATIONS; |
@@ -108,10 +110,11 @@ discard block |
||
108 | 110 | $expireTime = TIME + TIME_FOR_WAR_VOTE_FED_SAFETY; |
109 | 111 | $query = 'REPLACE INTO player_can_fed (account_id, game_id, race_id, expiry, allowed) VALUES '; |
110 | 112 | foreach ($currentlyParkedAccountIDs as $raceID => $accountIDs) { |
111 | - if ($raceID == $race_id_1) |
|
112 | - $message = 'We have declared war upon your race'; |
|
113 | - else |
|
114 | - $message = 'Your race has declared war upon us'; |
|
113 | + if ($raceID == $race_id_1) { |
|
114 | + $message = 'We have declared war upon your race'; |
|
115 | + } else { |
|
116 | + $message = 'Your race has declared war upon us'; |
|
117 | + } |
|
115 | 118 | $message .= ', you have ' . format_time(TIME_FOR_WAR_VOTE_FED_SAFETY) . ' to vacate our federal space, after that time you will no longer be protected (unless you have strong personal relations).'; |
116 | 119 | foreach ($accountIDs as $accountID) { |
117 | 120 | $query .= '(' . $db2->escapeNumber($accountID) . ',' . $db2->escapeNumber($player->getGameID()) . ',' . $db2->escapeNumber($raceID) . ',' . $db2->escapeNumber($expireTime) . ',' . $db2->escapeBoolean(true) . '),'; |
@@ -136,8 +139,7 @@ discard block |
||
136 | 139 | $news = 'The [race=' . $race_id_1 . '] have declared <span class="red">WAR</span> on the [race=' . $race_id_2 . ']'; |
137 | 140 | $db2->query('INSERT INTO news (game_id, time, news_message) VALUES ' . |
138 | 141 | '(' . $db2->escapeNumber($player->getGameID()) . ', ' . $db2->escapeNumber(TIME) . ', ' . $db2->escapeString($news) . ')'); |
139 | - } |
|
140 | - elseif ($type == 'PEACE') { |
|
142 | + } elseif ($type == 'PEACE') { |
|
141 | 143 | // get 'yes' votes |
142 | 144 | $db2->query('SELECT * FROM player_votes_pact |
143 | 145 | WHERE game_id = '.$db2->escapeNumber($player->getGameID()) . ' |
@@ -5,8 +5,7 @@ discard block |
||
5 | 5 | echo $CombatPlanet->getDisplayName(); |
6 | 6 | if($TotalDamage > 0) { |
7 | 7 | ?> hit for a total of <span class="red"><?php echo $TotalDamage; ?></span> damage in this round of combat of which <span class="red"><?php echo $PlanetCombatResults['TotalDamagePerTargetPlayer'][$ThisPlayer->getAccountID()]; ?></span> was done to you<?php |
8 | - } |
|
9 | - else { |
|
8 | + } else { |
|
10 | 9 | ?> does no damage this round<?php |
11 | 10 | } ?>. <?php echo $AttackLogLink; |
12 | 11 | return; |
@@ -23,24 +22,19 @@ discard block |
||
23 | 22 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
24 | 23 | if(!$ShotHit) { |
25 | 24 | ?> and misses<?php |
26 | - } |
|
27 | - else if($ActualDamage['TotalDamage'] == 0) { |
|
25 | + } else if($ActualDamage['TotalDamage'] == 0) { |
|
28 | 26 | if($WeaponDamage['Shield'] > 0) { |
29 | 27 | if($ActualDamage['HasCDs']) { |
30 | 28 | ?> which proves ineffective against their combat drones<?php |
31 | - } |
|
32 | - else { |
|
29 | + } else { |
|
33 | 30 | ?> which washes harmlessly over their hull<?php |
34 | 31 | } |
35 | - } |
|
36 | - else if($WeaponDamage['Armour'] > 0) { |
|
32 | + } else if($WeaponDamage['Armour'] > 0) { |
|
37 | 33 | ?> which is deflected by their shields<?php |
38 | - } |
|
39 | - else { |
|
34 | + } else { |
|
40 | 35 | ?> but it cannot do any damage<?php |
41 | 36 | } |
42 | - } |
|
43 | - else { |
|
37 | + } else { |
|
44 | 38 | ?> destroying <?php |
45 | 39 | $DamageTypes = 0; |
46 | 40 | if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
@@ -79,27 +73,22 @@ discard block |
||
79 | 73 | echo $CombatPlanet->getDisplayName(); |
80 | 74 | if($WeaponDamage['Launched'] == 0) { |
81 | 75 | ?> fails to launch it's combat drones<?php |
82 | - } |
|
83 | - else { |
|
76 | + } else { |
|
84 | 77 | ?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php if($ActualDamage['TargetAlreadyDead']){ ?>the debris that was once <?php } echo $TargetPlayer->getDisplayName(); |
85 | 78 | if(!$ActualDamage['TargetAlreadyDead']) { |
86 | 79 | if($ActualDamage['TotalDamage'] == 0) { |
87 | 80 | if($WeaponDamage['Shield'] > 0) { |
88 | 81 | if($ActualDamage['HasCDs']) { |
89 | 82 | ?> which prove ineffective against their combat drones<?php |
90 | - } |
|
91 | - else { |
|
83 | + } else { |
|
92 | 84 | ?> which washes harmlessly over their hull<?php |
93 | 85 | } |
94 | - } |
|
95 | - else if($WeaponDamage['Armour'] > 0) { |
|
86 | + } else if($WeaponDamage['Armour'] > 0) { |
|
96 | 87 | ?> which is deflected by their shields<?php |
97 | - } |
|
98 | - else { |
|
88 | + } else { |
|
99 | 89 | ?> but they cannot do any damage<?php |
100 | 90 | } |
101 | - } |
|
102 | - else { |
|
91 | + } else { |
|
103 | 92 | ?> destroying <?php |
104 | 93 | if($ActualDamage['Shield'] > 0) { |
105 | 94 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']); ?></span> shields<?php |
@@ -124,7 +113,6 @@ discard block |
||
124 | 113 | echo $CombatPlanet->getDisplayName(); |
125 | 114 | if($TotalDamage > 0) { |
126 | 115 | ?> hit for a total of <span class="red"><?php echo $TotalDamage; ?></span> damage in this round of combat<?php |
127 | -} |
|
128 | -else { |
|
116 | +} else { |
|
129 | 117 | ?> does no damage this round. You call that a planet? It needs a better builder<?php |
130 | 118 | } ?>. |