We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -28,8 +28,7 @@ |
||
| 28 | 28 | $player->decreaseCredits($amount); |
| 29 | 29 | $planet->increaseCredits($amount); |
| 30 | 30 | $account->log(LOG_TYPE_BANK, 'Player puts ' . $amount . ' credits on planet', $player->getSectorID()); |
| 31 | - } |
|
| 32 | - elseif ($action == 'Withdraw') { |
|
| 31 | + } elseif ($action == 'Withdraw') { |
|
| 33 | 32 | if ($planet->getCredits() < $amount) { |
| 34 | 33 | create_error('There are not enough credits in the planetary account!'); |
| 35 | 34 | } |
@@ -1,9 +1,15 @@ |
||
| 1 | 1 | <?php declare(strict_types=1); |
| 2 | 2 | |
| 3 | -if (isset($var['from'])) $start = $var['from']; |
|
| 4 | -else $start = trim($_POST['from']); |
|
| 5 | -if (isset($var['to'])) $target = $var['to']; |
|
| 6 | -else $target = trim($_POST['to']); |
|
| 3 | +if (isset($var['from'])) { |
|
| 4 | + $start = $var['from']; |
|
| 5 | +} else { |
|
| 6 | + $start = trim($_POST['from']); |
|
| 7 | +} |
|
| 8 | +if (isset($var['to'])) { |
|
| 9 | + $target = $var['to']; |
|
| 10 | +} else { |
|
| 11 | + $target = trim($_POST['to']); |
|
| 12 | +} |
|
| 7 | 13 | |
| 8 | 14 | // perform some basic checks on both numbers |
| 9 | 15 | if (empty($start) || empty($target)) { |
@@ -1,18 +1,21 @@ discard block |
||
| 1 | 1 | <?php declare(strict_types=1); |
| 2 | 2 | require_once(get_file_loc('hof.functions.inc')); |
| 3 | 3 | $game_id = null; |
| 4 | -if (isset($var['game_id'])) $game_id = $var['game_id']; |
|
| 4 | +if (isset($var['game_id'])) { |
|
| 5 | + $game_id = $var['game_id']; |
|
| 6 | +} |
|
| 5 | 7 | |
| 6 | 8 | if (empty($game_id)) { |
| 7 | 9 | $topic = 'All Time Hall of Fame'; |
| 8 | -} |
|
| 9 | -else { |
|
| 10 | +} else { |
|
| 10 | 11 | $topic = 'Hall of Fame: ' . SmrGame::getGame($game_id)->getDisplayName(); |
| 11 | 12 | } |
| 12 | 13 | $template->assign('PageTopic', $topic); |
| 13 | 14 | |
| 14 | 15 | $container = create_container('skeleton.php', 'hall_of_fame_player_detail.php'); |
| 15 | -if (isset($game_id)) $container['game_id'] = $game_id; |
|
| 16 | +if (isset($game_id)) { |
|
| 17 | + $container['game_id'] = $game_id; |
|
| 18 | +} |
|
| 16 | 19 | $template->assign('PersonalHofHREF', SmrSession::getNewHREF($container)); |
| 17 | 20 | |
| 18 | 21 | $db->query('SELECT type FROM hof_visibility WHERE visibility != ' . $db->escapeString(HOF_PRIVATE) . ' ORDER BY type'); |
@@ -35,8 +38,7 @@ discard block |
||
| 35 | 38 | if (!isset($var['view'])) { |
| 36 | 39 | $categories = getHofCategories($hofTypes, $game_id, $account->getAccountID()); |
| 37 | 40 | $template->assign('Categories', $categories); |
| 38 | -} |
|
| 39 | -else { |
|
| 41 | +} else { |
|
| 40 | 42 | $gameIDSql = ' AND game_id ' . (isset($game_id) ? '= ' . $db->escapeNumber($game_id) : 'IN (SELECT game_id FROM game WHERE end_time < ' . TIME . ' AND ignore_stats = ' . $db->escapeBoolean(false) . ')'); |
| 41 | 43 | |
| 42 | 44 | $vis = HOF_PUBLIC; |
@@ -51,8 +53,7 @@ discard block |
||
| 51 | 53 | $statements = SmrAccount::getUserScoreCaseStatement($db); |
| 52 | 54 | $query = 'SELECT account_id, ' . $statements['CASE'] . ' amount FROM (SELECT account_id, type, SUM(amount) amount FROM player_hof WHERE type IN (' . $statements['IN'] . ')' . $gameIDSql . ' GROUP BY account_id,type) x GROUP BY account_id ORDER BY amount DESC, account_id ASC LIMIT 25'; |
| 53 | 55 | $db->query($query); |
| 54 | - } |
|
| 55 | - else { |
|
| 56 | + } else { |
|
| 56 | 57 | $db->query('SELECT visibility FROM hof_visibility WHERE type = ' . $db->escapeArray($viewType, false, true, ':', false) . ' LIMIT 1'); |
| 57 | 58 | if ($db->nextRecord()) { |
| 58 | 59 | $vis = $db->getField('visibility'); |
@@ -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 | } |
@@ -83,11 +87,9 @@ discard block |
||
| 83 | 87 | } else { |
| 84 | 88 | $protectionMessage = '<span class="blue">PROTECTION</span>: You are under <span class="green">NEWBIE</span> protection.'; |
| 85 | 89 | } |
| 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.'; |
| 92 | 94 | } |
| 93 | 95 | |
@@ -117,7 +119,9 @@ discard block |
||
| 117 | 119 | } |
| 118 | 120 | |
| 119 | 121 | //error msgs take precedence |
| 120 | -if (isset($var['errorMsg'])) $template->assign('ErrorMessage', $var['errorMsg']); |
|
| 122 | +if (isset($var['errorMsg'])) { |
|
| 123 | + $template->assign('ErrorMessage', $var['errorMsg']); |
|
| 124 | +} |
|
| 121 | 125 | |
| 122 | 126 | // ******************************************* |
| 123 | 127 | // * |
@@ -152,8 +156,9 @@ discard block |
||
| 152 | 156 | $remainingTime = $db->getInt('refresh_at') - TIME; |
| 153 | 157 | $forceRefreshMessage = '<span class="green">REFRESH</span>: All forces will be refreshed in ' . $remainingTime . ' seconds.'; |
| 154 | 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.'; |
|
| 155 | 161 | } |
| 156 | - else $forceRefreshMessage = '<span class="green">REFRESH</span>: All forces have finished refreshing.'; |
|
| 157 | 162 | $template->assign('ForceRefreshMessage', $forceRefreshMessage); |
| 158 | 163 | } |
| 159 | 164 | } |
@@ -15,8 +15,7 @@ |
||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | forward(create_container('skeleton.php', 'feature_request.php')); |
| 18 | -} |
|
| 19 | -else if ($_REQUEST['action'] == 'Set Status') { |
|
| 18 | +} else if ($_REQUEST['action'] == 'Set Status') { |
|
| 20 | 19 | if (empty($_REQUEST['status'])) { |
| 21 | 20 | create_error('You have to select a status to set'); |
| 22 | 21 | } |
@@ -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,8 +31,7 @@ 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 | 37 | if ($db->getInt('amount') < $amount) { |
@@ -42,8 +40,7 @@ discard block |
||
| 42 | 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'); |
| 43 | 41 | if ($db->nextRecord()) { |
| 44 | 42 | $trans_id = $db->getInt('transaction_id') + 1; |
| 45 | - } |
|
| 46 | - else { |
|
| 43 | + } else { |
|
| 47 | 44 | $trans_id = 1; |
| 48 | 45 | } |
| 49 | 46 | $db->query('INSERT INTO anon_bank_transactions (account_id, game_id, anon_id, transaction_id, transaction, amount, time) |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | $planet->removePassword(); |
| 23 | 23 | $planet->update(); |
| 24 | 24 | $account->log(LOG_TYPE_PLANETS, 'Player takes ownership of planet.', $player->getSectorID()); |
| 25 | -} |
|
| 26 | -else if ($action == 'Rename') { |
|
| 25 | +} else if ($action == 'Rename') { |
|
| 27 | 26 | $name = trim($_REQUEST['name']); |
| 28 | 27 | if (empty($name)) { |
| 29 | 28 | create_error('You cannot leave your planet nameless!'); |
@@ -33,8 +32,7 @@ discard block |
||
| 33 | 32 | $planet->update(); |
| 34 | 33 | $account->log(LOG_TYPE_PLANETS, 'Player renames planet to ' . $name . '.', $player->getSectorID()); |
| 35 | 34 | |
| 36 | -} |
|
| 37 | -else if ($action == 'Set Password') { |
|
| 35 | +} else if ($action == 'Set Password') { |
|
| 38 | 36 | // set password |
| 39 | 37 | $planet->setPassword($password); |
| 40 | 38 | $planet->update(); |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | while ($db->nextRecord()) { |
| 20 | 20 | $message_id_list[] = $db->getInt('message_id'); |
| 21 | 21 | } |
| 22 | - } |
|
| 23 | - else { |
|
| 22 | + } else { |
|
| 24 | 23 | $message_id_list[] = $id; |
| 25 | 24 | } |
| 26 | 25 | } |
@@ -29,20 +28,17 @@ discard block |
||
| 29 | 28 | } else { |
| 30 | 29 | $db->query('UPDATE message SET receiver_delete = ' . $db->escapeBoolean(true) . ' WHERE message_id IN (' . $db->escapeArray($message_id_list) . ')'); |
| 31 | 30 | } |
| 32 | -} |
|
| 33 | -else { |
|
| 31 | +} else { |
|
| 34 | 32 | if ($var['folder_id'] == MSG_SCOUT) { |
| 35 | 33 | $db->query('UPDATE message SET receiver_delete = ' . $db->escapeBoolean(true) . ' |
| 36 | 34 | WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . ' |
| 37 | 35 | AND message_type_id = '.$db->escapeNumber($var['folder_id']) . ' |
| 38 | 36 | AND game_id = ' . $db->escapeNumber($player->getGameID())); |
| 39 | - } |
|
| 40 | - else if ($var['folder_id'] == MSG_SENT) { |
|
| 37 | + } else if ($var['folder_id'] == MSG_SENT) { |
|
| 41 | 38 | $db->query('UPDATE message SET sender_delete = ' . $db->escapeBoolean(true) . ' |
| 42 | 39 | WHERE sender_id = ' . $db->escapeNumber($player->getAccountID()) . ' |
| 43 | 40 | AND game_id = ' . $db->escapeNumber($player->getGameID())); |
| 44 | - } |
|
| 45 | - else { |
|
| 41 | + } else { |
|
| 46 | 42 | $db->query('UPDATE message SET receiver_delete = ' . $db->escapeBoolean(true) . ' |
| 47 | 43 | WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . ' |
| 48 | 44 | AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' |
@@ -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; |
@@ -164,9 +163,9 @@ discard block |
||
| 164 | 163 | |
| 165 | 164 | if (empty($website)) { |
| 166 | 165 | $website = 'N/A'; |
| 166 | + } else { |
|
| 167 | + $website = '<a href="' . $website . '" target="_new">' . $website . '</a>'; |
|
| 167 | 168 | } |
| 168 | - else |
|
| 169 | - $website = '<a href="' . $website . '" target="_new">' . $website . '</a>'; |
|
| 170 | 169 | echo('<tr>'); |
| 171 | 170 | echo('<td class="right bold" width="10%">Website:</td><td>' . $website . '</td>'); |
| 172 | 171 | echo('</tr>'); |
@@ -225,9 +224,9 @@ discard block |
||
| 225 | 224 | echo('</tr>'); |
| 226 | 225 | echo('</table>'); |
| 227 | 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>'); |
|
| 228 | 229 | } |
| 229 | - else |
|
| 230 | - 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>'); |
|
| 231 | 230 | |
| 232 | 231 | echo('</td>'); |
| 233 | 232 | echo('</tr>'); |