We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,8 +1,9 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | 3 | function get_album_nick($album_id) { |
4 | - if ($album_id == 0) |
|
5 | - return 'System'; |
|
4 | + if ($album_id == 0) { |
|
5 | + return 'System'; |
|
6 | + } |
|
6 | 7 | |
7 | 8 | return SmrAccount::getAccount($album_id)->getHofDisplayName(); |
8 | 9 | } |
@@ -59,12 +60,15 @@ discard block |
||
59 | 60 | $nick = get_album_nick($album_id); |
60 | 61 | $template->assign('Nick', $nick); |
61 | 62 | |
62 | - if (!empty($day) && !empty($month) && !empty($year)) |
|
63 | - $birthdate = $month . ' / ' . $day . ' / ' . $year; |
|
64 | - if (empty($birthdate) && !empty($year)) |
|
65 | - $birthdate = 'Year ' . $year; |
|
66 | - if (empty($birthdate)) |
|
67 | - $birthdate = 'N/A'; |
|
63 | + if (!empty($day) && !empty($month) && !empty($year)) { |
|
64 | + $birthdate = $month . ' / ' . $day . ' / ' . $year; |
|
65 | + } |
|
66 | + if (empty($birthdate) && !empty($year)) { |
|
67 | + $birthdate = 'Year ' . $year; |
|
68 | + } |
|
69 | + if (empty($birthdate)) { |
|
70 | + $birthdate = 'N/A'; |
|
71 | + } |
|
68 | 72 | $template->assign('Birthdate', $birthdate); |
69 | 73 | |
70 | 74 | // get the time that passed since the entry was last changed |
@@ -1,15 +1,17 @@ |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | $action = $_REQUEST['action']; |
3 | 3 | if ($action == 'Marked Messages') { |
4 | - if (!isset($_REQUEST['message_id'])) |
|
5 | - create_error('You must choose the messages you want to delete.'); |
|
4 | + if (!isset($_REQUEST['message_id'])) { |
|
5 | + create_error('You must choose the messages you want to delete.'); |
|
6 | + } |
|
6 | 7 | |
7 | - foreach ($_REQUEST['message_id'] as $id) |
|
8 | - $db->query('DELETE FROM message_boxes WHERE message_id = ' . $db->escapeNumber($id)); |
|
9 | -} |
|
10 | -else if ($action == 'All Messages') { |
|
11 | - if (!isset($var['box_type_id'])) |
|
12 | - create_error('No box selected.'); |
|
8 | + foreach ($_REQUEST['message_id'] as $id) { |
|
9 | + $db->query('DELETE FROM message_boxes WHERE message_id = ' . $db->escapeNumber($id)); |
|
10 | + } |
|
11 | + } else if ($action == 'All Messages') { |
|
12 | + if (!isset($var['box_type_id'])) { |
|
13 | + create_error('No box selected.'); |
|
14 | + } |
|
13 | 15 | $db->query('DELETE FROM message_boxes WHERE box_type_id = ' . $db->escapeNumber($var['box_type_id'])); |
14 | 16 | } |
15 | 17 | forward(create_container('skeleton.php', 'box_view.php')); |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | $db->query('SELECT transaction_id FROM anon_bank_transactions WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND anon_id = ' . $db->escapeNumber($account_num) . ' ORDER BY transaction_id DESC LIMIT 1'); |
22 | 22 | if ($db->nextRecord()) { |
23 | 23 | $trans_id = $db->getInt('transaction_id') + 1; |
24 | - } |
|
25 | - else { |
|
24 | + } else { |
|
26 | 25 | $trans_id = 1; |
27 | 26 | } |
28 | 27 | $db->query('INSERT INTO anon_bank_transactions (account_id, game_id, anon_id, transaction_id, transaction, amount, time) ' . |
@@ -32,17 +31,16 @@ discard block |
||
32 | 31 | |
33 | 32 | // log action |
34 | 33 | $account->log(LOG_TYPE_BANK, 'Deposits ' . $amount . ' credits in anonymous account #' . $account_num, $player->getSectorID()); |
35 | -} |
|
36 | -else { |
|
34 | +} else { |
|
37 | 35 | $db->query('SELECT * FROM anon_bank WHERE anon_id = ' . $db->escapeNumber($account_num) . ' AND game_id = ' . $db->escapeNumber($player->getGameID())); |
38 | 36 | $db->nextRecord(); |
39 | - if ($db->getInt('amount') < $amount) |
|
40 | - create_error('You don\'t have that much money on your account!'); |
|
37 | + if ($db->getInt('amount') < $amount) { |
|
38 | + create_error('You don\'t have that much money on your account!'); |
|
39 | + } |
|
41 | 40 | $db->query('SELECT transaction_id FROM anon_bank_transactions WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND anon_id = ' . $db->escapeNumber($account_num) . ' ORDER BY transaction_id DESC LIMIT 1'); |
42 | 41 | if ($db->nextRecord()) { |
43 | 42 | $trans_id = $db->getInt('transaction_id') + 1; |
44 | - } |
|
45 | - else { |
|
43 | + } else { |
|
46 | 44 | $trans_id = 1; |
47 | 45 | } |
48 | 46 | $db->query('INSERT INTO anon_bank_transactions (account_id, game_id, anon_id, transaction_id, transaction, amount, time) |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $publishedGames = array(); |
18 | 18 | while ($db->nextRecord()) { |
19 | 19 | $publishedGames[] = array('game_name' => $db->getField('game_name'), |
20 | - 'game_id' => $db->getInt('game_id')); |
|
20 | + 'game_id' => $db->getInt('game_id')); |
|
21 | 21 | } |
22 | 22 | $template->assign('PublishedGames', $publishedGames); |
23 | 23 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $container['back'] = true; |
32 | 32 | |
33 | 33 | $pastEditions[] = array('title' => $db->getField('title'), |
34 | - 'online_since' => $db->getInt('online_since'), |
|
35 | - 'href' => SmrSession::getNewHREF($container)); |
|
34 | + 'online_since' => $db->getInt('online_since'), |
|
35 | + 'href' => SmrSession::getNewHREF($container)); |
|
36 | 36 | } |
37 | 37 | $template->assign('PastEditions', $pastEditions); |
@@ -202,7 +202,7 @@ |
||
202 | 202 | AND receiver_delete = ' . $db->escapeBoolean(false) . ' |
203 | 203 | ORDER BY send_time DESC'); |
204 | 204 | while ($db->nextRecord()) { |
205 | - $groupBox =& $messageBox['GroupedMessages'][$db->getInt('sender_id')]; |
|
205 | + $groupBox = & $messageBox['GroupedMessages'][$db->getInt('sender_id')]; |
|
206 | 206 | // Limit the number of messages in each group |
207 | 207 | if (!isset($groupBox['Messages']) || count($groupBox['Messages']) < MESSAGE_SCOUT_GROUP_LIMIT) { |
208 | 208 | displayMessage($groupBox, $db->getInt('message_id'), $db->getInt('account_id'), $db->getInt('sender_id'), stripslashes($db->getField('message_text')), $db->getInt('send_time'), $db->getBoolean('msg_read'), MSG_SCOUT); |
@@ -4,18 +4,20 @@ discard block |
||
4 | 4 | |
5 | 5 | if ($_REQUEST['action'] == 'Preview message') { |
6 | 6 | $container = create_container('skeleton.php'); |
7 | - if (isset($var['alliance_id'])) |
|
8 | - $container['body'] = 'alliance_broadcast.php'; |
|
9 | - else |
|
10 | - $container['body'] = 'message_send.php'; |
|
7 | + if (isset($var['alliance_id'])) { |
|
8 | + $container['body'] = 'alliance_broadcast.php'; |
|
9 | + } else { |
|
10 | + $container['body'] = 'message_send.php'; |
|
11 | + } |
|
11 | 12 | transfer('receiver'); |
12 | 13 | transfer('alliance_id'); |
13 | 14 | $container['preview'] = $message; |
14 | 15 | forward($container); |
15 | 16 | } |
16 | 17 | |
17 | -if (empty($message)) |
|
18 | +if (empty($message)) { |
|
18 | 19 | create_error('You have to enter a message to send!'); |
20 | +} |
|
19 | 21 | |
20 | 22 | if (isset($var['alliance_id'])) { |
21 | 23 | $db->query('SELECT account_id FROM player |
@@ -26,11 +28,9 @@ discard block |
||
26 | 28 | $player->sendMessage($db->getInt('account_id'), MSG_ALLIANCE, $message, false); |
27 | 29 | } |
28 | 30 | $player->sendMessage($player->getAccountID(), MSG_ALLIANCE, $message, true, false); |
29 | -} |
|
30 | -else if (!empty($var['receiver'])) { |
|
31 | +} else if (!empty($var['receiver'])) { |
|
31 | 32 | $player->sendMessage($var['receiver'], MSG_PLAYER, $message); |
32 | -} |
|
33 | -else { |
|
33 | +} else { |
|
34 | 34 | $player->sendGlobalMessage($message); |
35 | 35 | } |
36 | 36 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $db3 = new SmrMySqlDatabase(); |
8 | 8 | |
9 | 9 | // get current entry |
10 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id)); |
|
10 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id)); |
|
11 | 11 | if ($db->nextRecord()) { |
12 | 12 | $parent_topic_id = $db->getInt('parent_topic_id'); |
13 | 13 | $order_id = $db->getInt('order_id'); |
@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | // ************************** |
20 | 20 | // ** PREVIOUS |
21 | 21 | // ************************** |
22 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id - 1)); |
|
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 | 25 | if (!$db2->getNumRows()) |
26 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
26 | + $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
27 | 27 | |
28 | 28 | echo ('<th width="32">'); |
29 | 29 | if ($db2->nextRecord()) { |
30 | 30 | $previous_topic_id = $db2->getInt('topic_id'); |
31 | 31 | $previous_topic = stripslashes($db2->getField('topic')); |
32 | - echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
|
32 | + echo ('<a href="/manual.php?' . $previous_topic_id . '"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
|
33 | 33 | } else |
34 | 34 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
35 | 35 | echo ('</th>'); |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | // ************************** |
38 | 38 | // ** UP |
39 | 39 | // ************************** |
40 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
40 | + $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
41 | 41 | echo ('<th width="32">'); |
42 | 42 | if ($db2->nextRecord()) { |
43 | 43 | $up_topic_id = $db2->getInt('topic_id'); |
44 | 44 | $up_topic = stripslashes($db2->getField('topic')); |
45 | - echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
|
45 | + echo ('<a href="/manual.php?' . $up_topic_id . '"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
|
46 | 46 | } else |
47 | 47 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
48 | 48 | echo ('</th>'); |
@@ -50,35 +50,35 @@ discard block |
||
50 | 50 | // ************************** |
51 | 51 | // ** NEXT |
52 | 52 | // ************************** |
53 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1'); |
|
53 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($topic_id) . ' AND order_id = 1'); |
|
54 | 54 | |
55 | 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)); |
|
56 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id + 1)); |
|
57 | 57 | |
58 | 58 | $seenParentIDs = array(0); |
59 | 59 | $curr_parent_topic_id = $parent_topic_id; |
60 | 60 | while (!$db2->getNumRows() && !in_array($curr_parent_topic_id, $seenParentIDs)) { |
61 | 61 | $seenParentIDs[] = $curr_parent_topic_id; |
62 | - $db3->query('SELECT * FROM manual WHERE topic_id = '.$db3->escapeNumber($parent_topic_id)); |
|
62 | + $db3->query('SELECT * FROM manual WHERE topic_id = ' . $db3->escapeNumber($parent_topic_id)); |
|
63 | 63 | $db3->nextRecord(); |
64 | 64 | $curr_order_id = $db3->getInt('order_id'); |
65 | 65 | $curr_parent_topic_id = $db3->getInt('parent_topic_id'); |
66 | 66 | |
67 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($curr_order_id + 1)); |
|
67 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($curr_order_id + 1)); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | echo ('<th width="32">'); |
71 | 71 | if ($db2->nextRecord()) { |
72 | 72 | $next_topic_id = $db2->getInt('topic_id'); |
73 | 73 | $next_topic = stripslashes($db2->getField('topic')); |
74 | - echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
|
74 | + echo ('<a href="/manual.php?' . $next_topic_id . '"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
|
75 | 75 | } |
76 | 76 | else { |
77 | 77 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
78 | 78 | } |
79 | 79 | echo ('</th>'); |
80 | 80 | |
81 | - echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic.'</th>'); |
|
81 | + echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic . '</th>'); |
|
82 | 82 | echo ('<th width="32"><a href="/manual_toc.php"><img src="/images/help/contents.jpg" width="32" height="32" border="0"></a></th>'); |
83 | 83 | |
84 | 84 | echo ('</tr>'); |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | echo ('<tr>'); |
87 | 87 | echo ('<td colspan="5">'); |
88 | 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> '); |
|
89 | + echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a> '); |
|
90 | 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> '); |
|
91 | + echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a> '); |
|
92 | 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>'); |
|
93 | + echo ('<b>Next:</b> <a href="/manual.php?' . $next_topic_id . '">' . get_numbering($next_topic_id) . $next_topic . '</a>'); |
|
94 | 94 | echo ('</tr>'); |
95 | 95 | |
96 | 96 | echo ('</table>'); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $db = new SmrMySqlDatabase(); |
104 | 104 | |
105 | 105 | // get current entry |
106 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$topic_id); |
|
106 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $topic_id); |
|
107 | 107 | if ($db->nextRecord()) { |
108 | 108 | $parent_topic_id = $db->getInt('parent_topic_id'); |
109 | 109 | $order_id = $db->getInt('order_id'); |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | $text = stripslashes($db->getField('text')); |
112 | 112 | |
113 | 113 | echo ('<div id="help_content">'); |
114 | - echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>'); |
|
115 | - echo ('<p>'.$text.'<p>'); |
|
114 | + echo ('<h1>' . get_numbering($topic_id) . $topic . '</h1>'); |
|
115 | + echo ('<p>' . $text . '<p>'); |
|
116 | 116 | echo ('</div>'); |
117 | 117 | } else |
118 | 118 | echo ('Invalid Topic!'); |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | function echo_subsection($topic_id) { |
122 | 122 | // database object |
123 | 123 | $db = new SmrMySqlDatabase(); |
124 | - $return=''; |
|
124 | + $return = ''; |
|
125 | 125 | // check if there are subsections |
126 | - $db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id'); |
|
126 | + $db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id'); |
|
127 | 127 | if ($db->getNumRows()) { |
128 | 128 | echo ('<hr noshade width="75%" size="1" class="center"/>'); |
129 | 129 | echo ('<div id="help_menu">'); |
@@ -137,19 +137,19 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | function echo_menu($topic_id) { |
140 | - $return=''; |
|
140 | + $return = ''; |
|
141 | 141 | // database object |
142 | 142 | $db = new SmrMySqlDatabase(); |
143 | 143 | |
144 | - $db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id'); |
|
144 | + $db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id'); |
|
145 | 145 | if ($db->getNumRows()) { |
146 | 146 | echo ('<ul type="disc">'); |
147 | - while($db->nextRecord()) { |
|
147 | + while ($db->nextRecord()) { |
|
148 | 148 | $sub_topic_id = $db->getInt('topic_id'); |
149 | 149 | $order_id = $db->getInt('order_id'); |
150 | 150 | $sub_topic = stripslashes($db->getField('topic')); |
151 | 151 | |
152 | - echo ('<li><a href="/manual.php?'.$sub_topic_id.'">' . get_numbering($sub_topic_id) . $sub_topic.'</a></li>'); |
|
152 | + echo ('<li><a href="/manual.php?' . $sub_topic_id . '">' . get_numbering($sub_topic_id) . $sub_topic . '</a></li>'); |
|
153 | 153 | echo_menu($sub_topic_id); |
154 | 154 | } |
155 | 155 | echo ('</ul>'); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | function get_numbering($topic_id) { |
161 | 161 | $db = new SmrMySqlDatabase(); |
162 | 162 | |
163 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id)); |
|
163 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id)); |
|
164 | 164 | if ($db->nextRecord()) { |
165 | 165 | $up_topic_id = $db->getInt('parent_topic_id'); |
166 | 166 | $order_id = $db->getInt('order_id'); |
@@ -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 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | $db = new $var['HistoryDatabase'](); |
13 | 13 | $db->query('SELECT start_date, type, end_date, game_name, speed, game_id ' . |
14 | - 'FROM game WHERE game_id = ' . $db->escapeNumber($game_id)); |
|
14 | + 'FROM game WHERE game_id = ' . $db->escapeNumber($game_id)); |
|
15 | 15 | $db->nextRecord(); |
16 | 16 | $template->assign('GameName', $game_name); |
17 | 17 | $template->assign('Start', date(DATE_DATE_SHORT, $db->getInt('start_date'))); |