We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,12 +1,14 @@ |
||
1 | 1 | <?php |
2 | -if (!$player->isLandedOnPlanet()) |
|
2 | +if (!$player->isLandedOnPlanet()) { |
|
3 | 3 | create_error('You are not on a planet!'); |
4 | +} |
|
4 | 5 | $planet = $player->getSectorPlanet(); |
5 | 6 | |
6 | 7 | $planetPlayer = SmrPlayer::getPlayer($var['account_id'], $player->getGameID()); |
7 | 8 | $owner = $planet->getOwner(); |
8 | -if ($owner->getAllianceID() != $player->getAllianceID()) |
|
9 | +if ($owner->getAllianceID() != $player->getAllianceID()) { |
|
9 | 10 | create_error('You can not kick someone off a planet your alliance does not own!'); |
11 | +} |
|
10 | 12 | $message = 'You have been kicked from ' . $planet->getName() . ' in ' . Globals::getSectorBBLink($player->getSectorID()); |
11 | 13 | $player->sendMessage($planetPlayer->getAccountID(), MSG_PLAYER, $message, false); |
12 | 14 |
@@ -2,8 +2,7 @@ |
||
2 | 2 | $db2 = new SmrMySqlDatabase(); |
3 | 3 | if (isset($var['article'])) { |
4 | 4 | $db->query('DELETE FROM galactic_post_article WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND article_id = '.$db->escapeNumber($var['id'])); |
5 | -} |
|
6 | -else { |
|
5 | +} else { |
|
7 | 6 | //we are deleting an entire paper |
8 | 7 | //find out which articles need to be deleted as well |
9 | 8 | $db->query('SELECT * FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = '.$db->escapeNumber($var['id'])); |
@@ -21,8 +21,7 @@ |
||
21 | 21 | $PHP_OUTPUT.=create_echo_form($container); |
22 | 22 | $PHP_OUTPUT.=create_submit('No'); |
23 | 23 | $PHP_OUTPUT.=('</form>'); |
24 | -} |
|
25 | -else { |
|
24 | +} else { |
|
26 | 25 | $db->query('SELECT * FROM galactic_post_paper WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = '.$db->escapeNumber($var['id'])); |
27 | 26 | $db->nextRecord(); |
28 | 27 | $title = $db->getField('title'); |
@@ -14,9 +14,9 @@ |
||
14 | 14 | if ($db->getNumRows()) { |
15 | 15 | $PHP_OUTPUT.=('It is your responsibility to make sure ALL HTML tags are closed!<br />'); |
16 | 16 | $PHP_OUTPUT.=('You have the following articles to view.<br /><br />'); |
17 | -} |
|
18 | -else |
|
17 | +} else { |
|
19 | 18 | $PHP_OUTPUT.=('There are no articles to view'); |
19 | +} |
|
20 | 20 | |
21 | 21 | while ($db->nextRecord()) { |
22 | 22 | $db2->query('SELECT * FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND article_id = ' . $db->escapeNumber($db->getInt('article_id'))); |
@@ -7,9 +7,10 @@ discard block |
||
7 | 7 | // do we need credits for this game? |
8 | 8 | if ($game->getCreditsNeeded() > 0) { |
9 | 9 | // do we have enough |
10 | - if ($account->getTotalSmrCredits() < $game->getCreditsNeeded()) |
|
11 | - create_error('Sorry you do not have enough SMR Credits to play this game.<br />To get SMR credits you need to donate to SMR.'); |
|
12 | -} |
|
10 | + if ($account->getTotalSmrCredits() < $game->getCreditsNeeded()) { |
|
11 | + create_error('Sorry you do not have enough SMR Credits to play this game.<br />To get SMR credits you need to donate to SMR.'); |
|
12 | + } |
|
13 | + } |
|
13 | 14 | |
14 | 15 | // is the game already full? |
15 | 16 | if ($game->getTotalPlayers() >= $game->getMaxPlayers()) { |
@@ -19,8 +20,9 @@ discard block |
||
19 | 20 | //if (TIME < $game['StartDate']) |
20 | 21 | // create_error('You want to join a game that hasn\'t started yet?'); |
21 | 22 | |
22 | -if (TIME > $game->getEndDate()) |
|
23 | +if (TIME > $game->getEndDate()) { |
|
23 | 24 | create_error('You want to join a game that is already over?'); |
25 | +} |
|
24 | 26 | |
25 | 27 | $template->assign('PageTopic', 'Join Game: ' . $game->getDisplayName()); |
26 | 28 | |
@@ -31,10 +33,10 @@ discard block |
||
31 | 33 | $raceDescriptions.=('\'' . str_replace('\'','\\\'"',$race['Description']) . '\''); |
32 | 34 | $first = false; |
33 | 35 | |
36 | + } else { |
|
37 | + $raceDescriptions.=(', \'' . str_replace('\'','\\\'',$race['Description']) . '\''); |
|
38 | + } |
|
34 | 39 | } |
35 | - else |
|
36 | - $raceDescriptions.=(', \'' . str_replace('\'','\\\'',$race['Description']) . '\''); |
|
37 | -} |
|
38 | 40 | $template->assign('RaceDescriptions',$raceDescriptions); |
39 | 41 | |
40 | 42 | |
@@ -42,8 +44,9 @@ discard block |
||
42 | 44 | $container = array(); |
43 | 45 | $container['game_id'] = $var['game_id']; |
44 | 46 | $container['url'] = 'game_join_processing.php'; |
45 | -if (TIME >= $game->getStartDate()) |
|
47 | +if (TIME >= $game->getStartDate()) { |
|
46 | 48 | $template->assign('JoinGameFormHref',SmrSession::getNewHREF($container)); |
49 | +} |
|
47 | 50 | |
48 | 51 | $db2 = new SmrMySqlDatabase(); |
49 | 52 | //this prevents multiple races appearing when there is more than 1 game |
@@ -62,7 +65,9 @@ discard block |
||
62 | 65 | $race_name = substr(stripslashes($db->getField('location_name')), 0, -13); |
63 | 66 | |
64 | 67 | $curr_race_id = $db->getField('location_type_id') - 101; |
65 | - if (in_array($curr_race_id, $only)) continue; |
|
68 | + if (in_array($curr_race_id, $only)) { |
|
69 | + continue; |
|
70 | + } |
|
66 | 71 | $only[] = $curr_race_id; |
67 | 72 | // get number of traders in game |
68 | 73 | $db2->query('SELECT count(*) as number_of_race FROM player WHERE race_id = '.$db2->escapeNumber($curr_race_id).' AND game_id = ' . $db2->escapeNumber($var['game_id'])); |
@@ -7,8 +7,7 @@ |
||
7 | 7 | $db->query('SELECT message_id FROM bar_wall WHERE sector_id = ' . $db->escapeNumber($sector->getSectorID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY message_id DESC'); |
8 | 8 | if ($db->nextRecord()) { |
9 | 9 | $amount = $db->getInt('message_id') + 1; |
10 | -} |
|
11 | -else { |
|
10 | +} else { |
|
12 | 11 | $amount = 1; |
13 | 12 | } |
14 | 13 | $wall = $_REQUEST['wall']; |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!Globals::isFeatureRequestOpen()) |
|
2 | +if (!Globals::isFeatureRequestOpen()) { |
|
3 | 3 | create_error('Feature requests are currently not being accepted.'); |
4 | +} |
|
4 | 5 | |
5 | 6 | $template->assign('PageTopic','Feature Request Comments'); |
6 | 7 | |
@@ -32,8 +33,9 @@ discard block |
||
32 | 33 | 'Time' => date(DATE_FULL_SHORT,$db->getField('posting_time')), |
33 | 34 | 'Anonymous' => $db->getBoolean('anonymous') |
34 | 35 | ); |
35 | - if($featureModerator || !$db->getBoolean('anonymous')) |
|
36 | - $featureRequestComments[$commentID]['PosterAccount'] = SmrAccount::getAccount($db->getField('poster_id')); |
|
36 | + if($featureModerator || !$db->getBoolean('anonymous')) { |
|
37 | + $featureRequestComments[$commentID]['PosterAccount'] = SmrAccount::getAccount($db->getField('poster_id')); |
|
38 | + } |
|
37 | 39 | } |
38 | 40 | $template->assign('Comments', $featureRequestComments); |
39 | 41 | } |
@@ -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->getField('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 |
@@ -1,14 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!$player->isLandedOnPlanet()) |
|
2 | +if (!$player->isLandedOnPlanet()) { |
|
3 | 3 | create_error('You are not on a planet!'); |
4 | +} |
|
4 | 5 | // get a planet from the sector where the player is in |
5 | 6 | $planet = $player->getSectorPlanet(); |
6 | 7 | $action = $_REQUEST['action']; |
7 | 8 | $password = isset($_REQUEST['password'])?$_REQUEST['password']:''; |
8 | 9 | |
9 | 10 | if ($action == 'Take Ownership') { |
10 | - if ($planet->hasOwner() && $planet->getPassword() != $password) |
|
11 | - create_error('You are not allowed to take ownership!'); |
|
11 | + if ($planet->hasOwner() && $planet->getPassword() != $password) { |
|
12 | + create_error('You are not allowed to take ownership!'); |
|
13 | + } |
|
12 | 14 | |
13 | 15 | // delete all previous ownerships |
14 | 16 | $db->query('UPDATE planet SET owner_id = 0, password = NULL |
@@ -20,16 +22,14 @@ discard block |
||
20 | 22 | $planet->removePassword(); |
21 | 23 | $planet->update(); |
22 | 24 | $account->log(LOG_TYPE_PLANETS, 'Player takes ownership of planet.', $player->getSectorID()); |
23 | -} |
|
24 | -else if ($action == 'Rename') { |
|
25 | +} else if ($action == 'Rename') { |
|
25 | 26 | $name = $_REQUEST['name']; |
26 | 27 | // rename planet |
27 | 28 | $planet->setName($name); |
28 | 29 | $planet->update(); |
29 | 30 | $account->log(LOG_TYPE_PLANETS, 'Player renames planet to '.$name.'.', $player->getSectorID()); |
30 | 31 | |
31 | -} |
|
32 | -else if ($action == 'Set Password') { |
|
32 | +} else if ($action == 'Set Password') { |
|
33 | 33 | // set password |
34 | 34 | $planet->setPassword($password); |
35 | 35 | $planet->update(); |