We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -6,8 +6,9 @@ discard block |
||
6 | 6 | // |
7 | 7 | //////////////////////////////////////////////////////////// |
8 | 8 | |
9 | -if($player->isLandedOnPlanet()) |
|
9 | +if($player->isLandedOnPlanet()) { |
|
10 | 10 | create_error('You are on a planet!'); |
11 | +} |
|
11 | 12 | |
12 | 13 | // Create a session to store temporary display options |
13 | 14 | // Do not garbage collect here for best performance (see map_galaxy.php). |
@@ -36,8 +37,7 @@ discard block |
||
36 | 37 | $zoomOn = true; |
37 | 38 | if ($var['Dir'] == 'Up') { |
38 | 39 | $player->decreaseZoom(1); |
39 | - } |
|
40 | - elseif ($var['Dir'] == 'Down') { |
|
40 | + } elseif ($var['Dir'] == 'Down') { |
|
41 | 41 | $player->increaseZoom(1); |
42 | 42 | } |
43 | 43 | } |
@@ -8,8 +8,11 @@ |
||
8 | 8 | $db->query('SELECT race_id, race_name, sum(kills) as kill_sum FROM player JOIN race USING(race_id) WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' GROUP BY race_id ORDER BY kill_sum DESC, race_name ASC'); |
9 | 9 | while ($db->nextRecord()) { |
10 | 10 | $race_id = $db->getInt('race_id'); |
11 | - if ($player->getRaceID() == $race_id) $style = ' class="bold"'; |
|
12 | - else $style = ''; |
|
11 | + if ($player->getRaceID() == $race_id) { |
|
12 | + $style = ' class="bold"'; |
|
13 | + } else { |
|
14 | + $style = ''; |
|
15 | + } |
|
13 | 16 | |
14 | 17 | $ranks[] = [ |
15 | 18 | 'style' => $style, |
@@ -8,8 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | if ($action == 'INCREASE') { |
10 | 10 | $action = 'INC'; |
11 | -} |
|
12 | -elseif ($action == 'DECREASE') { |
|
11 | +} elseif ($action == 'DECREASE') { |
|
13 | 12 | $action = 'DEC'; |
14 | 13 | } |
15 | 14 | |
@@ -19,13 +18,11 @@ discard block |
||
19 | 18 | $db->query('REPLACE INTO player_votes_relation |
20 | 19 | (account_id, game_id, race_id_1, race_id_2, action, time) |
21 | 20 | VALUES(' . $db->escapeNumber($player->getAccountID()) . ', ' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($player->getRaceID()) . ', '.$db->escapeNumber($race_id).', '.$db->escapeString($action).', '.$db->escapeNumber(TIME).')'); |
22 | -} |
|
23 | -elseif ($action == 'YES' || $action == 'NO') { |
|
21 | +} elseif ($action == 'YES' || $action == 'NO') { |
|
24 | 22 | $db->query('REPLACE INTO player_votes_pact |
25 | 23 | (account_id, game_id, race_id_1, race_id_2, vote) |
26 | 24 | VALUES(' . $db->escapeNumber($player->getAccountID()) . ', ' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($player->getRaceID()) . ', '.$db->escapeNumber($race_id).', '.$db->escapeString($action).')'); |
27 | -} |
|
28 | -elseif ($action == 'VETO') { |
|
25 | +} elseif ($action == 'VETO') { |
|
29 | 26 | // try to cancel both votings |
30 | 27 | $db->query('DELETE FROM race_has_voting ' . |
31 | 28 | 'WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' |
@@ -13,8 +13,9 @@ |
||
13 | 13 | |
14 | 14 | if(isset($_REQUEST['note'])) { |
15 | 15 | $note = $_REQUEST['note']; |
16 | - if(strlen($note) > 1000) |
|
17 | - create_error('Note cannot be longer than 1000 characters.'); |
|
16 | + if(strlen($note) > 1000) { |
|
17 | + create_error('Note cannot be longer than 1000 characters.'); |
|
18 | + } |
|
18 | 19 | |
19 | 20 | $note = htmlentities($note,ENT_QUOTES,'utf-8'); |
20 | 21 | $note = nl2br($note); |
@@ -10,20 +10,22 @@ |
||
10 | 10 | } |
11 | 11 | $db->query(substr($query,0,-1)); |
12 | 12 | } |
13 | - if(!empty($_REQUEST['favourite']) && is_numeric($_REQUEST['favourite'])) |
|
14 | - $db->query('REPLACE INTO account_votes_for_feature VALUES('.$db->escapeNumber($account->getAccountID()).', '.$db->escapeNumber($_REQUEST['favourite']).',\'FAVOURITE\')'); |
|
13 | + if(!empty($_REQUEST['favourite']) && is_numeric($_REQUEST['favourite'])) { |
|
14 | + $db->query('REPLACE INTO account_votes_for_feature VALUES('.$db->escapeNumber($account->getAccountID()).', '.$db->escapeNumber($_REQUEST['favourite']).',\'FAVOURITE\')'); |
|
15 | + } |
|
15 | 16 | |
16 | 17 | forward(create_container('skeleton.php', 'feature_request.php')); |
17 | -} |
|
18 | -else if($_REQUEST['action']=='Set Status') { |
|
18 | +} else if($_REQUEST['action']=='Set Status') { |
|
19 | 19 | if(empty($_REQUEST['status'])) { |
20 | 20 | create_error('You have to select a status to set'); |
21 | 21 | } |
22 | 22 | $status = $_REQUEST['status']; |
23 | - if(empty($_REQUEST['set_status_ids'])) |
|
24 | - create_error('You have to select a feature'); |
|
25 | - if(!$account->hasPermission(PERMISSION_MODERATE_FEATURE_REQUEST)) |
|
26 | - create_error('You do not have permission to do that'); |
|
23 | + if(empty($_REQUEST['set_status_ids'])) { |
|
24 | + create_error('You have to select a feature'); |
|
25 | + } |
|
26 | + if(!$account->hasPermission(PERMISSION_MODERATE_FEATURE_REQUEST)) { |
|
27 | + create_error('You do not have permission to do that'); |
|
28 | + } |
|
27 | 29 | |
28 | 30 | $db->query('UPDATE feature_request fr SET status = ' . $db->escapeString($status) . ' |
29 | 31 | , fav = ( |
@@ -70,8 +70,7 @@ |
||
70 | 70 | $container = create_container('skeleton.php', 'alliance_roster.php'); |
71 | 71 | if($showRoles) { |
72 | 72 | $container['action'] = 'Hide Alliance Roles'; |
73 | - } |
|
74 | - else { |
|
73 | + } else { |
|
75 | 74 | $container['action'] = 'Show Alliance Roles'; |
76 | 75 | } |
77 | 76 | $template->assign('ToggleRolesHREF', SmrSession::getNewHREF($container)); |
@@ -1,24 +1,28 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ($_POST['action'] == 'No') |
|
3 | +if ($_POST['action'] == 'No') { |
|
4 | 4 | forward(create_container('skeleton.php', 'message_view.php')); |
5 | +} |
|
5 | 6 | |
6 | -if (empty($var['message_id'])) |
|
7 | +if (empty($var['message_id'])) { |
|
7 | 8 | create_error('Please click the small yellow icon to report a message!'); |
9 | +} |
|
8 | 10 | |
9 | 11 | // get next id |
10 | 12 | $db->query('SELECT max(notify_id) FROM message_notify WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY notify_id DESC'); |
11 | -if ($db->nextRecord()) |
|
13 | +if ($db->nextRecord()) { |
|
12 | 14 | $notify_id = $db->getField('max(notify_id)') + 1; |
13 | -else |
|
15 | +} else { |
|
14 | 16 | $notify_id = 1; |
17 | +} |
|
15 | 18 | |
16 | 19 | // get message form db |
17 | 20 | $db->query('SELECT account_id, sender_id, message_text |
18 | 21 | FROM message |
19 | 22 | WHERE message_id = ' . $var['message_id'].' AND receiver_delete = \'FALSE\''); |
20 | -if (!$db->nextRecord()) |
|
23 | +if (!$db->nextRecord()) { |
|
21 | 24 | create_error('Could not find the message you selected!'); |
25 | +} |
|
22 | 26 | |
23 | 27 | // insert |
24 | 28 | $db->query('INSERT INTO message_notify |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | $container = create_container('skeleton.php', '', $var); |
8 | 8 | if(!isset($var['thread_index'])) { |
9 | 9 | $container['body'] = 'alliance_message.php'; |
10 | - } |
|
11 | - else { |
|
10 | + } else { |
|
12 | 11 | $container['body'] = 'alliance_message_view.php'; |
13 | 12 | } |
14 | 13 | $container['preview'] = $body; |
@@ -40,8 +39,7 @@ discard block |
||
40 | 39 | if ($db->nextRecord()) { |
41 | 40 | $thread_id = $db->getInt('max(thread_id)') + 1; |
42 | 41 | } |
43 | -} |
|
44 | -else { |
|
42 | +} else { |
|
45 | 43 | $thread_index = $var['thread_index']; |
46 | 44 | $thread_id = $var['thread_ids'][$thread_index]; |
47 | 45 | } |
@@ -97,8 +95,7 @@ discard block |
||
97 | 95 | $container['thread_topics'] = $var['thread_topics']; |
98 | 96 | ++$var['thread_replies'][$thread_index]; |
99 | 97 | $container['thread_replies'] = $var['thread_replies']; |
100 | -} |
|
101 | -else { |
|
98 | +} else { |
|
102 | 99 | $container['body'] = 'alliance_message.php'; |
103 | 100 | } |
104 | 101 |
@@ -46,8 +46,7 @@ |
||
46 | 46 | transfer('LocationID'); |
47 | 47 | $container['message'] = '<div align="center">Galaxy maps have been added. Enjoy!</div><br />'; |
48 | 48 | forward($container); |
49 | -} |
|
50 | -else { |
|
49 | +} else { |
|
51 | 50 | // This is a display page! |
52 | 51 | $template->assign('PageTopic', 'Buy Galaxy Maps'); |
53 | 52 | Menu::bar(); |