We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -12,19 +12,19 @@ discard block |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | if (!isset($var['alliance_id'])) { |
15 | - SmrSession::updateVar('alliance_id',$player->getAllianceID()); |
|
15 | + SmrSession::updateVar('alliance_id', $player->getAllianceID()); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $alliance = SmrAlliance::getAlliance($var['alliance_id'], $player->getGameID()); |
19 | -$template->assign('PageTopic','Bank'); |
|
19 | +$template->assign('PageTopic', 'Bank'); |
|
20 | 20 | |
21 | 21 | Menu::bank(); |
22 | 22 | |
23 | 23 | $db->query('SELECT * FROM alliance_treaties WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' |
24 | 24 | AND (alliance_id_1 = ' . $db->escapeNumber($player->getAllianceID()) . ' OR alliance_id_2 = ' . $db->escapeNumber($player->getAllianceID()) . ') |
25 | 25 | AND aa_access = 1 AND official = \'TRUE\''); |
26 | -$alliedAllianceBanks=array(); |
|
27 | -if($db->getNumRows() > 0) { |
|
26 | +$alliedAllianceBanks = array(); |
|
27 | +if ($db->getNumRows() > 0) { |
|
28 | 28 | $alliedAllianceBanks[$player->getAllianceID()] = $player->getAlliance(); |
29 | 29 | while ($db->nextRecord()) { |
30 | 30 | if ($db->getInt('alliance_id_1') == $player->getAllianceID()) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | WHERE alliance_id = ' . $db->escapeNumber($alliance->getAllianceID()) . ' AND game_id = ' . $db->escapeNumber($alliance->getGameID()) . ' AND payee_id = ' . $db->escapeNumber($player->getAccountID()) . ' |
42 | 42 | GROUP BY transaction'); |
43 | 43 | $playerTrans = array('Deposit' => 0, 'Payment' => 0); |
44 | -while($db->nextRecord()) { |
|
44 | +while ($db->nextRecord()) { |
|
45 | 45 | $playerTrans[$db->getField('transaction')] = $db->getInt('total'); |
46 | 46 | } |
47 | 47 | |
@@ -56,10 +56,10 @@ discard block |
||
56 | 56 | $db->nextRecord(); |
57 | 57 | $template->assign('CanExempt', $db->getBoolean('exempt_with')); |
58 | 58 | $withdrawalPerDay = $db->getInt('with_per_day'); |
59 | -if($db->getBoolean('positive_balance')) { |
|
59 | +if ($db->getBoolean('positive_balance')) { |
|
60 | 60 | $template->assign('PositiveWithdrawal', $withdrawalPerDay + $playerTrans['Deposit'] - $playerTrans['Payment']); |
61 | 61 | } |
62 | -else if($withdrawalPerDay == ALLIANCE_BANK_UNLIMITED) { |
|
62 | +else if ($withdrawalPerDay == ALLIANCE_BANK_UNLIMITED) { |
|
63 | 63 | $template->assign('UnlimitedWithdrawal', true); |
64 | 64 | } |
65 | 65 | else { |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | $template->assign('TotalWithdrawn', $totalWithdrawn); |
75 | 75 | } |
76 | 76 | if (isset($_REQUEST['maxValue'])) { |
77 | - SmrSession::updateVar('maxValue',$_REQUEST['maxValue']); |
|
77 | + SmrSession::updateVar('maxValue', $_REQUEST['maxValue']); |
|
78 | 78 | } |
79 | 79 | if (isset($_REQUEST['minValue'])) { |
80 | - SmrSession::updateVar('minValue',$_REQUEST['minValue']); |
|
80 | + SmrSession::updateVar('minValue', $_REQUEST['minValue']); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if (isset($var['maxValue']) |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | $db->query('SELECT MAX(transaction_id) FROM alliance_bank_transactions |
90 | 90 | WHERE game_id=' . $db->escapeNumber($alliance->getGameID()) . ' |
91 | 91 | AND alliance_id=' . $db->escapeNumber($alliance->getAllianceID())); |
92 | - if($db->nextRecord()) { |
|
92 | + if ($db->nextRecord()) { |
|
93 | 93 | $maxValue = $db->getInt('MAX(transaction_id)'); |
94 | 94 | $minValue = $maxValue - 5; |
95 | - if($minValue < 1) { |
|
95 | + if ($minValue < 1) { |
|
96 | 96 | $minValue = 1; |
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | -if(isset($var['minValue']) |
|
101 | +if (isset($var['minValue']) |
|
102 | 102 | && $var['minValue'] <= $maxValue |
103 | 103 | && $var['minValue'] > 0 |
104 | 104 | && is_numeric($var['maxValue'])) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | AND alliance_id=' . $db->escapeNumber($alliance->getAllianceID()); |
112 | 112 | |
113 | 113 | |
114 | -if($maxValue > 0 && $minValue > 0) { |
|
114 | +if ($maxValue > 0 && $minValue > 0) { |
|
115 | 115 | $query .= ' AND transaction_id>=' . $db->escapeNumber($minValue) . ' |
116 | 116 | AND transaction_id<=' . $db->escapeNumber($maxValue) . ' |
117 | 117 | ORDER BY time LIMIT ' . (1 + $maxValue - $minValue); |
@@ -142,20 +142,20 @@ discard block |
||
142 | 142 | $template->assign('MaxValue', $maxValue); |
143 | 143 | $container = create_container('skeleton.php', 'bank_alliance.php'); |
144 | 144 | $container['alliance_id'] = $alliance->getAllianceID(); |
145 | - $template->assign('FilterTransactionsFormHREF',SmrSession::getNewHREF($container)); |
|
145 | + $template->assign('FilterTransactionsFormHREF', SmrSession::getNewHREF($container)); |
|
146 | 146 | |
147 | - $container=create_container('bank_alliance_exempt_processing.php'); |
|
147 | + $container = create_container('bank_alliance_exempt_processing.php'); |
|
148 | 148 | $container['minVal'] = $minValue; |
149 | 149 | $container['maxVal'] = $maxValue; |
150 | - $template->assign('ExemptTransactionsFormHREF',SmrSession::getNewHREF($container)); |
|
150 | + $template->assign('ExemptTransactionsFormHREF', SmrSession::getNewHREF($container)); |
|
151 | 151 | |
152 | 152 | $template->assign('Alliance', $alliance); |
153 | 153 | } |
154 | 154 | |
155 | -$container=create_container('skeleton.php', 'bank_report.php'); |
|
155 | +$container = create_container('skeleton.php', 'bank_report.php'); |
|
156 | 156 | $container['alliance_id'] = $alliance->getAllianceID(); |
157 | 157 | $template->assign('BankReportHREF', SmrSession::getNewHREF($container)); |
158 | 158 | |
159 | -$container=create_container('bank_alliance_processing.php'); |
|
159 | +$container = create_container('bank_alliance_processing.php'); |
|
160 | 160 | $container['alliance_id'] = $alliance->getAllianceID(); |
161 | 161 | $template->assign('BankTransactionFormHREF', SmrSession::getNewHREF($container)); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | -if($var['toggle']=='WeaponHiding') { |
|
2 | +if ($var['toggle'] == 'WeaponHiding') { |
|
3 | 3 | $player->setDisplayWeapons(!$player->isDisplayWeapons()); |
4 | 4 | } |
5 | -else if($var['toggle']=='AJAX') { |
|
5 | +else if ($var['toggle'] == 'AJAX') { |
|
6 | 6 | $account->setUseAJAX(!$account->isUseAJAX()); |
7 | 7 | } |
8 | -if(!USING_AJAX) { |
|
8 | +if (!USING_AJAX) { |
|
9 | 9 | $container = create_container('skeleton.php'); |
10 | - if(isset($var['referrer'])) $container['body'] = $var['referrer']; |
|
10 | + if (isset($var['referrer'])) $container['body'] = $var['referrer']; |
|
11 | 11 | else $container['body'] = 'current_sector.php'; |
12 | 12 | forward($container); |
13 | 13 | } |
@@ -3,7 +3,7 @@ |
||
3 | 3 | $raceName = Globals::getRaceName($var['race_id']); |
4 | 4 | $template->assign('RaceName', $raceName); |
5 | 5 | |
6 | -$template->assign('PageTopic','Send message to Ruling Council of the '.$raceName); |
|
6 | +$template->assign('PageTopic', 'Send message to Ruling Council of the ' . $raceName); |
|
7 | 7 | |
8 | 8 | Menu::messages(); |
9 | 9 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -$template->assign('PageTopic','Alliance Death Rankings'); |
|
2 | +$template->assign('PageTopic', 'Alliance Death Rankings'); |
|
3 | 3 | Menu::rankings(1, 3); |
4 | 4 | |
5 | 5 | $db->query('SELECT count(*) FROM alliance |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | FROM alliance |
14 | 14 | WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' |
15 | 15 | AND ( |
16 | - alliance_deaths > '.$db->escapeNumber($player->getAlliance()->getDeaths()).' |
|
16 | + alliance_deaths > '.$db->escapeNumber($player->getAlliance()->getDeaths()) . ' |
|
17 | 17 | OR ( |
18 | - alliance_deaths = '.$db->escapeNumber($player->getAlliance()->getDeaths()).' |
|
18 | + alliance_deaths = '.$db->escapeNumber($player->getAlliance()->getDeaths()) . ' |
|
19 | 19 | AND alliance_name <= ' . $db->escapeString($player->getAllianceName()) . ' |
20 | 20 | ) |
21 | 21 | )'); |
@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | $accountIDs = $_REQUEST['account_id']; |
3 | 3 | |
4 | -if(empty($accountIDs)) { |
|
4 | +if (empty($accountIDs)) { |
|
5 | 5 | create_error('You have to choose someone to remove them!'); |
6 | 6 | } |
7 | 7 | |
8 | -if(in_array($player->getAlliance()->getLeaderID(), $accountIDs)) { |
|
8 | +if (in_array($player->getAlliance()->getLeaderID(), $accountIDs)) { |
|
9 | 9 | create_error('You can\'t kick the leader!'); |
10 | 10 | } |
11 | 11 | |
12 | -if(in_array($player->getAccountID(), $accountIDs)) { |
|
12 | +if (in_array($player->getAccountID(), $accountIDs)) { |
|
13 | 13 | create_error('You can\'t kick yourself!'); |
14 | 14 | } |
15 | 15 | |
16 | 16 | foreach ($accountIDs as $accountID) { |
17 | 17 | $currPlayer = SmrPlayer::getPlayer($accountID, $player->getGameID()); |
18 | - if(!$player->sameAlliance($currPlayer)) { |
|
18 | + if (!$player->sameAlliance($currPlayer)) { |
|
19 | 19 | throw new Exception('Cannot kick someone from another alliance!'); |
20 | 20 | } |
21 | 21 | $currPlayer->leaveAlliance($player); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | AND receiver_delete = ' . $db->escapeBoolean(false) . ' |
15 | 15 | LIMIT 1'); |
16 | 16 | $showPoliticalBox = $db->getNumRows() > 0 || $player->isOnCouncil(); |
17 | - $messageBoxes = array (); |
|
17 | + $messageBoxes = array(); |
|
18 | 18 | foreach (getMessageTypeNames() as $message_type_id => $message_type_name) { |
19 | 19 | if (!$showPoliticalBox && $message_type_id == MSG_POLITICAL) { |
20 | 20 | continue; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $messageBoxes[] = $messageBox; |
52 | 52 | } |
53 | 53 | |
54 | - $messageBox = array (); |
|
54 | + $messageBox = array(); |
|
55 | 55 | $messageBox['MessageCount'] = 0; |
56 | 56 | $db->query('SELECT count(message_id) as count FROM message |
57 | 57 | WHERE sender_id = ' . $db->escapeNumber($player->getAccountID()) . ' |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $template->assign('MessageBoxes', $messageBoxes); |
76 | 76 | |
77 | - $container = create_container('skeleton.php','message_blacklist.php'); |
|
77 | + $container = create_container('skeleton.php', 'message_blacklist.php'); |
|
78 | 78 | $container['folder_id'] = $message_type_id; |
79 | 79 | $template->assign('ManageBlacklistLink', SmrSession::getNewHREF($container)); |
80 | 80 | } |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | $container = $var; |
115 | - $container['page'] = $page -1; |
|
115 | + $container['page'] = $page - 1; |
|
116 | 116 | if ($page > 0) { |
117 | 117 | $template->assign('PreviousPageHREF', SmrSession::getNewHREF($container)); |
118 | 118 | } |
119 | - $container['page'] = $page +1; |
|
120 | - if (($page +1) * MESSAGES_PER_PAGE < $messageBox['TotalMessages']) { |
|
119 | + $container['page'] = $page + 1; |
|
120 | + if (($page + 1) * MESSAGES_PER_PAGE < $messageBox['TotalMessages']) { |
|
121 | 121 | $template->assign('NextPageHREF', SmrSession::getNewHREF($container)); |
122 | 122 | } |
123 | 123 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | LIMIT ' . ($page * MESSAGES_PER_PAGE) . ', ' . MESSAGES_PER_PAGE); |
150 | 150 | |
151 | 151 | $messageBox['NumberMessages'] = $db->getNumRows(); |
152 | - $messageBox['Messages'] = array (); |
|
152 | + $messageBox['Messages'] = array(); |
|
153 | 153 | |
154 | 154 | // Group scout messages if they wouldn't fit on a single page |
155 | 155 | if ($var['folder_id'] == MSG_SCOUT && !isset($var['show_all']) && $messageBox['TotalMessages'] > $player->getScoutMessageGroupLimit()) { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | AND receiver_delete = ' . $db->escapeBoolean(false) . ' |
207 | 207 | ORDER BY send_time DESC'); |
208 | 208 | while ($db->nextRecord()) { |
209 | - $groupBox =& $messageBox['GroupedMessages'][$db->getInt('sender_id')]; |
|
209 | + $groupBox = & $messageBox['GroupedMessages'][$db->getInt('sender_id')]; |
|
210 | 210 | // Limit the number of messages in each group |
211 | 211 | if (!isset($groupBox['Messages']) || count($groupBox['Messages']) < MESSAGE_SCOUT_GROUP_LIMIT) { |
212 | 212 | displayMessage($groupBox, $db->getField('message_id'), $db->getField('account_id'), $db->getField('sender_id'), stripslashes($db->getField('message_text')), $db->getField('send_time'), $db->getField('msg_read'), MSG_SCOUT); |
@@ -221,13 +221,13 @@ discard block |
||
221 | 221 | |
222 | 222 | function displayGrouped(&$messageBox, $playerName, $player_id, $sender_id, $message_text, $first, $last, $star) { |
223 | 223 | // Define a unique array so we can delete grouped messages |
224 | - $array = array ( |
|
224 | + $array = array( |
|
225 | 225 | $sender_id, |
226 | 226 | $first, |
227 | 227 | $last |
228 | 228 | ); |
229 | 229 | |
230 | - $message = array (); |
|
230 | + $message = array(); |
|
231 | 231 | $message['ID'] = base64_encode(serialize($array)); |
232 | 232 | $message['Unread'] = $star; |
233 | 233 | $container = create_container('skeleton.php', 'trader_search_result.php'); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | function displayMessage(&$messageBox, $message_id, $receiver_id, $sender_id, $message_text, $send_time, $msg_read, $type) { |
243 | 243 | global $player; |
244 | 244 | |
245 | - $message = array (); |
|
245 | + $message = array(); |
|
246 | 246 | $message['ID'] = $message_id; |
247 | 247 | $message['Text'] = $message_text; |
248 | 248 | $message['Unread'] = $msg_read == 'FALSE'; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(!ENABLE_BETA) { |
|
2 | +if (!ENABLE_BETA) { |
|
3 | 3 | create_error('Beta functions are disabled.'); |
4 | 4 | } |
5 | 5 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $player->update(); |
15 | 15 | |
16 | 16 | // log |
17 | -$account->log(LOG_TYPE_GAME_ENTERING, 'Player entered game '.SmrSession::getGameID(), $player->getSectorID()); |
|
17 | +$account->log(LOG_TYPE_GAME_ENTERING, 'Player entered game ' . SmrSession::getGameID(), $player->getSectorID()); |
|
18 | 18 | |
19 | 19 | $container = create_container('skeleton.php', 'current_sector.php'); |
20 | 20 | forward($container); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$message = htmlentities(trim($_POST['message']),ENT_COMPAT,'utf-8'); |
|
3 | +$message = htmlentities(trim($_POST['message']), ENT_COMPAT, 'utf-8'); |
|
4 | 4 | |
5 | 5 | if (empty($message)) |
6 | 6 | create_error('You have to enter a text to send!'); |
7 | 7 | |
8 | 8 | // send to all council members |
9 | 9 | $councilMembers = Council::getRaceCouncil($player->getGameID(), $var['race_id']); |
10 | -foreach($councilMembers as $accountID) { |
|
10 | +foreach ($councilMembers as $accountID) { |
|
11 | 11 | $player->sendMessage($accountID, MSG_POLITICAL, $message, true, $player->getAccountID() != $accountID); |
12 | 12 | } |
13 | 13 |