Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Branch master (287493)
by Dan
06:08
created
engine/Default/forces_attack.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $results = unserialize($var['results']);
4
-$template->assign('FullForceCombatResults',$results);
4
+$template->assign('FullForceCombatResults', $results);
5 5
 
6
-if($var['owner_id']>0)
7
-	$template->assign('Target',SmrForce::getForce($player->getGameID(),$player->getSectorID(),$var['owner_id']));
6
+if ($var['owner_id'] > 0)
7
+	$template->assign('Target', SmrForce::getForce($player->getGameID(), $player->getSectorID(), $var['owner_id']));
8 8
 
9
-if(isset($var['override_death']))
10
-	$template->assign('OverrideDeath',true);
9
+if (isset($var['override_death']))
10
+	$template->assign('OverrideDeath', true);
11 11
 else
12
-	$template->assign('OverrideDeath',false);
12
+	$template->assign('OverrideDeath', false);
Please login to merge, or discard this patch.
engine/Default/planet_financial_processing.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 		$player->decreaseCredits($amount);
25 25
 		$planet->increaseCredits($amount);
26
-		$account->log(LOG_TYPE_BANK, 'Player puts '.$amount.' credits on planet', $player->getSectorID());
26
+		$account->log(LOG_TYPE_BANK, 'Player puts ' . $amount . ' credits on planet', $player->getSectorID());
27 27
 	}
28 28
 	elseif ($action == 'Withdraw') {
29 29
 		if ($planet->getCredits() < $amount)
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 		$player->increaseCredits($amount);
33 33
 		$planet->decreaseCredits($amount);
34
-		$account->log(LOG_TYPE_BANK, 'Player takes '.$amount.' credits from planet', $player->getSectorID());
34
+		$account->log(LOG_TYPE_BANK, 'Player takes ' . $amount . ' credits from planet', $player->getSectorID());
35 35
 	}
36 36
 }
37 37
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	$planet->bond();
41 41
 
42 42
 	// save to db
43
-	$account->log(LOG_TYPE_BANK, 'Player bonds '.$planet->getBonds().' credits at planet.', $player->getSectorID());
43
+	$account->log(LOG_TYPE_BANK, 'Player bonds ' . $planet->getBonds() . ' credits at planet.', $player->getSectorID());
44 44
 }
45 45
 
46 46
 forward(create_container('skeleton.php', 'planet_financial.php'));
Please login to merge, or discard this patch.
engine/Default/news_read.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!isset($var['GameID'])) SmrSession::updateVar('GameID',$player->getGameID());
2
+if (!isset($var['GameID'])) SmrSession::updateVar('GameID', $player->getGameID());
3 3
 $gameID = $var['GameID'];
4 4
 
5 5
 if (isset($_REQUEST['min_news'])) $min_news = $_REQUEST['min_news'];
@@ -11,21 +11,21 @@  discard block
 block discarded – undo
11 11
 elseif ($min_news > $max_news)
12 12
 		create_error('The first number must be lower than the second number!');
13 13
 
14
-$template->assign('PageTopic','Reading The News');
14
+$template->assign('PageTopic', 'Reading The News');
15 15
 
16 16
 Menu::news($template);
17 17
 
18 18
 require_once(get_file_loc('news.functions.inc'));
19
-doBreakingNewsAssign($gameID,$template);
20
-doLottoNewsAssign($gameID,$template);
19
+doBreakingNewsAssign($gameID, $template);
20
+doLottoNewsAssign($gameID, $template);
21 21
 
22
-$template->assign('ViewNewsFormHref',SmrSession::getNewHREF(create_container('skeleton.php','news_read.php',array('GameID'=>$var['GameID']))));
22
+$template->assign('ViewNewsFormHref', SmrSession::getNewHREF(create_container('skeleton.php', 'news_read.php', array('GameID'=>$var['GameID']))));
23 23
 
24
-$db->query('SELECT * FROM news WHERE game_id = '.$db->escapeNumber($gameID).' AND type != \'lotto\' ORDER BY news_id DESC LIMIT ' . ($min_news - 1) . ', ' . ($max_news - $min_news + 1));
24
+$db->query('SELECT * FROM news WHERE game_id = ' . $db->escapeNumber($gameID) . ' AND type != \'lotto\' ORDER BY news_id DESC LIMIT ' . ($min_news - 1) . ', ' . ($max_news - $min_news + 1));
25 25
 if ($db->getNumRows()) {
26 26
 	$NewsItems = array();
27 27
 	while ($db->nextRecord()) {
28 28
 		$NewsItems[] = array('Time' => $db->getField('time'), 'Message' => bbifyMessage($db->getField('news_message')));
29 29
 	}
30
-	$template->assign('NewsItems',$NewsItems);
30
+	$template->assign('NewsItems', $NewsItems);
31 31
 }
Please login to merge, or discard this patch.
engine/Default/cargo_dump_processing.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $good_id = $var['good_id'];
3 3
 $good_name = Globals::getGoodName($good_id);
4
-if(isset($_REQUEST['amount'])) {
5
-	SmrSession::updateVar('amount',$_REQUEST['amount']);
4
+if (isset($_REQUEST['amount'])) {
5
+	SmrSession::updateVar('amount', $_REQUEST['amount']);
6 6
 }
7 7
 $amount = $var['amount'];
8 8
 if (!is_numeric($amount)) {
@@ -39,24 +39,24 @@  discard block
 block discarded – undo
39 39
 	$x = Globals::getGood($good_id);
40 40
 	$x['TransactionType'] = 'Sell';
41 41
 	$good_distance = Plotter::findDistanceToX($x, $sector, true);
42
-	if(is_object($good_distance)) {
42
+	if (is_object($good_distance)) {
43 43
 		$good_distance = $good_distance->getRelativeDistance();
44 44
 	}
45
-	$good_distance = max(1,$good_distance);
45
+	$good_distance = max(1, $good_distance);
46 46
 
47 47
 	// Don't lose more exp than you have
48 48
 	$lost_xp = min($player->getExperience(),
49 49
 	               round(SmrPort::getBaseExperience($amount, $good_distance)));
50 50
 	$player->decreaseExperience($lost_xp);
51
-	$player->increaseHOF($lost_xp, array('Trade','Experience', 'Jettisoned'), HOF_PUBLIC);
51
+	$player->increaseHOF($lost_xp, array('Trade', 'Experience', 'Jettisoned'), HOF_PUBLIC);
52 52
 
53
-	$container['msg'] = 'You have jettisoned <span class="yellow">'.$amount.'</span> ' . pluralise('unit', $amount) . ' of '.$good_name.' and have lost <span class="exp">'.$lost_xp.'</span> experience.';
53
+	$container['msg'] = 'You have jettisoned <span class="yellow">' . $amount . '</span> ' . pluralise('unit', $amount) . ' of ' . $good_name . ' and have lost <span class="exp">' . $lost_xp . '</span> experience.';
54 54
 	// log action
55
-	$account->log(LOG_TYPE_TRADING, 'Dumps '.$amount.' of '.$good_name.' and loses '.$lost_xp.' experience', $player->getSectorID());
55
+	$account->log(LOG_TYPE_TRADING, 'Dumps ' . $amount . ' of ' . $good_name . ' and loses ' . $lost_xp . ' experience', $player->getSectorID());
56 56
 }
57 57
 else {
58 58
 	// No experience to lose, so damage the ship
59
-	$damage = ceil($amount/5);
59
+	$damage = ceil($amount / 5);
60 60
 
61 61
 	// Don't allow ship to be destroyed dumping cargo
62 62
 	if ($ship->getArmour() <= $damage) {
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 	$ship->decreaseArmour($damage);
67 67
 	$ship->removeUnderAttack(); // don't trigger attack warning
68 68
 
69
-	$container['msg'] = 'You have jettisoned <span class="yellow">'.$amount.'</span> ' . pluralise('unit', $amount) . ' of '.$good_name.'. Due to your lack of piloting experience, the cargo pierces the hull of your ship as you clumsily try to jettison the goods through the bay doors, destroying <span class="red">'.$damage.'</span> ' . pluralise('plate', $damage) . ' of armour!';
69
+	$container['msg'] = 'You have jettisoned <span class="yellow">' . $amount . '</span> ' . pluralise('unit', $amount) . ' of ' . $good_name . '. Due to your lack of piloting experience, the cargo pierces the hull of your ship as you clumsily try to jettison the goods through the bay doors, destroying <span class="red">' . $damage . '</span> ' . pluralise('plate', $damage) . ' of armour!';
70 70
 	// log action
71
-	$account->log(LOG_TYPE_TRADING, 'Dumps '.$amount.' of '.$good_name.' and takes '.$damage.' armour damage', $player->getSectorID());
71
+	$account->log(LOG_TYPE_TRADING, 'Dumps ' . $amount . ' of ' . $good_name . ' and takes ' . $damage . ' armour damage', $player->getSectorID());
72 72
 }
73 73
 
74 74
 // take turn
75
-$player->takeTurns(1,1);
75
+$player->takeTurns(1, 1);
76 76
 
77
-$ship->decreaseCargo($good_id,$amount);
78
-$player->increaseHOF($amount,array('Trade','Goods', 'Jettisoned'), HOF_ALLIANCE);
77
+$ship->decreaseCargo($good_id, $amount);
78
+$player->increaseHOF($amount, array('Trade', 'Goods', 'Jettisoned'), HOF_ALLIANCE);
79 79
 
80 80
 forward($container);
Please login to merge, or discard this patch.
engine/Default/council_embassy.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!$player->isPresident()) {
3
+if (!$player->isPresident()) {
4 4
 	create_error('Only the president can view the embassy.');
5 5
 }
6 6
 
7
-$template->assign('PageTopic','Ruling Council Of '.$player->getRaceName());
7
+$template->assign('PageTopic', 'Ruling Council Of ' . $player->getRaceName());
8 8
 
9 9
 Menu::council($player->getRaceID());
10 10
 
11 11
 $voteRaces = array();
12 12
 $RACES = Globals::getRaces();
13
-foreach($RACES as $raceID => $raceInfo) {
13
+foreach ($RACES as $raceID => $raceInfo) {
14 14
 	if ($raceID == RACE_NEUTRAL || $raceID == $player->getRaceID()) {
15 15
 		continue;
16 16
 	}
@@ -21,6 +21,6 @@  discard block
 block discarded – undo
21 21
 	if ($db->getNumRows() > 0) {
22 22
 		continue;
23 23
 	}
24
-	$voteRaces[$raceID] = SmrSession::getNewHREF(create_container('council_embassy_processing.php','',array('race_id' => $raceID)));
24
+	$voteRaces[$raceID] = SmrSession::getNewHREF(create_container('council_embassy_processing.php', '', array('race_id' => $raceID)));
25 25
 }
26
-$template->assign('VoteRaceHrefs',$voteRaces);
26
+$template->assign('VoteRaceHrefs', $voteRaces);
Please login to merge, or discard this patch.
engine/Default/galactic_post_add_article_to_paper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 //limit 4 per paper...make sure we arent over that
4
-$db->query('SELECT * FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = '.$db->escapeNumber($var['paper_id']));
4
+$db->query('SELECT * FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = ' . $db->escapeNumber($var['paper_id']));
5 5
 if ($db->getNumRows() >= 8) {
6 6
 	create_error('You can only have 8 articles per paper.');
7 7
 }
8
-$db->query('INSERT INTO galactic_post_paper_content (game_id, paper_id, article_id) VALUES (' . $db->escapeNumber($player->getGameID()) . ', '.$db->escapeNumber($var['paper_id']).', '.$db->escapeNumber($var['id']).')');
8
+$db->query('INSERT INTO galactic_post_paper_content (game_id, paper_id, article_id) VALUES (' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($var['paper_id']) . ', ' . $db->escapeNumber($var['id']) . ')');
9 9
 //we now have that article in the paper
10 10
 $container = create_container('skeleton.php', 'galactic_post_view_article.php');
11 11
 forward($container);
Please login to merge, or discard this patch.
engine/Default/hall_of_fame_player_detail.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -5,29 +5,29 @@  discard block
 block discarded – undo
5 5
 	$account_id = $var['account_id'];
6 6
 else
7 7
 	$account_id = $account->getAccountID();
8
-$game_id =null;
8
+$game_id = null;
9 9
 if (isset($var['game_id'])) $game_id = $var['game_id'];
10 10
 $base = array();
11 11
 
12
-if(isset($var['game_id'])) {
12
+if (isset($var['game_id'])) {
13 13
 	try {
14
-		$hofPlayer = SmrPlayer::getPlayer($account_id,$var['game_id']);
14
+		$hofPlayer = SmrPlayer::getPlayer($account_id, $var['game_id']);
15 15
 	}
16
-	catch(PlayerNotFoundException $e) {
16
+	catch (PlayerNotFoundException $e) {
17 17
 		create_error('That player has not yet joined this game.');
18 18
 	}
19
-	$template->assign('PageTopic',$hofPlayer->getPlayerName().'\'s Personal Hall of Fame For '.Globals::getGameName($var['game_id']));
19
+	$template->assign('PageTopic', $hofPlayer->getPlayerName() . '\'s Personal Hall of Fame For ' . Globals::getGameName($var['game_id']));
20 20
 }
21 21
 else {
22
-	$template->assign('PageTopic',$account->getHofName().'\'s All Time Personal Hall of Fame');
22
+	$template->assign('PageTopic', $account->getHofName() . '\'s All Time Personal Hall of Fame');
23 23
 }
24
-$PHP_OUTPUT.=('<div class="center">');
24
+$PHP_OUTPUT .= ('<div class="center">');
25 25
 $allowedVisibities = array(HOF_PUBLIC);
26
-if($account->getAccountID()==$account_id) {
26
+if ($account->getAccountID() == $account_id) {
27 27
 	$allowedVisibities[] = HOF_ALLIANCE;
28 28
 	$allowedVisibities[] = HOF_PRIVATE;
29 29
 }
30
-else if(isset($hofPlayer) && $hofPlayer->sameAlliance($player)) {
30
+else if (isset($hofPlayer) && $hofPlayer->sameAlliance($player)) {
31 31
 	$allowedVisibities[] = HOF_ALLIANCE;
32 32
 }
33 33
 $db->query('SELECT type FROM hof_visibility WHERE visibility IN (' . $db->escapeArray($allowedVisibities) . ') ORDER BY type');
@@ -35,82 +35,82 @@  discard block
 block discarded – undo
35 35
 const DONATION_NAME = 'Money Donated To SMR';
36 36
 const USER_SCORE_NAME = 'User Score';
37 37
 $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true);
38
-while($db->nextRecord()) {
39
-	$hof =& $hofTypes;
40
-	$typeList = explode(':',$db->getField('type'));
41
-	foreach($typeList as $type) {
42
-		if(!isset($hof[$type])) {
38
+while ($db->nextRecord()) {
39
+	$hof = & $hofTypes;
40
+	$typeList = explode(':', $db->getField('type'));
41
+	foreach ($typeList as $type) {
42
+		if (!isset($hof[$type])) {
43 43
 			$hof[$type] = array();
44 44
 		}
45
-		$hof =& $hof[$type];
45
+		$hof = & $hof[$type];
46 46
 	}
47 47
 	$hof = true;
48 48
 }
49
-$PHP_OUTPUT .= buildBreadcrumb($var,$hofTypes,'Personal HoF');
50
-$PHP_OUTPUT.= '<table class="standard" align="center">';
49
+$PHP_OUTPUT .= buildBreadcrumb($var, $hofTypes, 'Personal HoF');
50
+$PHP_OUTPUT .= '<table class="standard" align="center">';
51 51
 
52
-if(!isset($var['view'])) {
53
-	$PHP_OUTPUT.=('<tr><th>Category</th><th width="60%">Subcategory</th></tr>');
52
+if (!isset($var['view'])) {
53
+	$PHP_OUTPUT .= ('<tr><th>Category</th><th width="60%">Subcategory</th></tr>');
54 54
 
55
-	foreach($hofTypes as $type => $value) {
56
-		$PHP_OUTPUT.=('<tr>');
57
-		$PHP_OUTPUT.=('<td>'.$type.'</td>');
55
+	foreach ($hofTypes as $type => $value) {
56
+		$PHP_OUTPUT .= ('<tr>');
57
+		$PHP_OUTPUT .= ('<td>' . $type . '</td>');
58 58
 		$container = $var;
59 59
 		if (!isset($var['type']))
60 60
 			$container['type'] = array();
61 61
 		$container['type'][] = $type;
62
-		$PHP_OUTPUT.=('<td valign="middle">');
63
-		$i=0;
64
-		if(is_array($value)) {
65
-			foreach($value as $subType => $subTypeValue) {
62
+		$PHP_OUTPUT .= ('<td valign="middle">');
63
+		$i = 0;
64
+		if (is_array($value)) {
65
+			foreach ($value as $subType => $subTypeValue) {
66 66
 				++$i;
67 67
 				$container['view'] = $subType;
68 68
 
69 69
 				$rankType = $container['type'];
70 70
 				$rankType[] = $subType;
71
-				$rank = getHofRank($subType,$rankType,$account->getAccountID(),$game_id,$db);
72
-				$rankMsg='';
73
-				if($rank['Rank']!=0)
74
-					$rankMsg = ' (#' . $rank['Rank'] .')';
71
+				$rank = getHofRank($subType, $rankType, $account->getAccountID(), $game_id, $db);
72
+				$rankMsg = '';
73
+				if ($rank['Rank'] != 0)
74
+					$rankMsg = ' (#' . $rank['Rank'] . ')';
75 75
 
76
-				$PHP_OUTPUT.=create_submit_link($container,$subType.$rankMsg);
77
-				$PHP_OUTPUT.=('&nbsp;');
78
-				if ($i % 3 == 0) $PHP_OUTPUT.=('<br />');
76
+				$PHP_OUTPUT .= create_submit_link($container, $subType . $rankMsg);
77
+				$PHP_OUTPUT .= ('&nbsp;');
78
+				if ($i % 3 == 0) $PHP_OUTPUT .= ('<br />');
79 79
 			}
80 80
 		}
81 81
 		else {
82 82
 			unset($container['view']);
83
-			$rank = getHofRank($type,$container['type'],$account->getAccountID(),$game_id,$db);
84
-			$PHP_OUTPUT.=create_submit_link($container,'View (#' . $rank['Rank'] .')');
83
+			$rank = getHofRank($type, $container['type'], $account->getAccountID(), $game_id, $db);
84
+			$PHP_OUTPUT .= create_submit_link($container, 'View (#' . $rank['Rank'] . ')');
85 85
 		}
86
-		$PHP_OUTPUT.=('</td></tr>');
86
+		$PHP_OUTPUT .= ('</td></tr>');
87 87
 	}
88 88
 }
89 89
 else {
90
-	$PHP_OUTPUT.=('<tr><th>Rank</th><th>Player</th><th>Total</th></tr>');
90
+	$PHP_OUTPUT .= ('<tr><th>Rank</th><th>Player</th><th>Total</th></tr>');
91 91
 
92 92
 	$viewType = $var['type'];
93 93
 	$viewType[] = $var['view'];
94 94
 
95
-	$hofRank = getHofRank($var['view'],$viewType,$account_id,$game_id,$db);
95
+	$hofRank = getHofRank($var['view'], $viewType, $account_id, $game_id, $db);
96 96
 
97
-	if($account->getAccountID() != $account_id) {
97
+	if ($account->getAccountID() != $account_id) {
98 98
 		//current player's score.
99
-		$playerRank = getHofRank($var['view'],$viewType,$account->getAccountID(),$game_id,$db);
99
+		$playerRank = getHofRank($var['view'], $viewType, $account->getAccountID(), $game_id, $db);
100 100
 
101 101
 		//display in order
102
-		if($playerRank['Rank']<$hofRank)
103
-			$PHP_OUTPUT .= displayHOFRow($playerRank['Rank'],$account->getAccountID(),$playerRank['Amount']);
102
+		if ($playerRank['Rank'] < $hofRank)
103
+			$PHP_OUTPUT .= displayHOFRow($playerRank['Rank'], $account->getAccountID(), $playerRank['Amount']);
104 104
 		else
105
-			$PHP_OUTPUT .= displayHOFRow($hofRank['Rank'],$account_id,$hofRank['Amount']);
105
+			$PHP_OUTPUT .= displayHOFRow($hofRank['Rank'], $account_id, $hofRank['Amount']);
106 106
 
107
-		if($playerRank['Rank']>$hofRank)
108
-			$PHP_OUTPUT .= displayHOFRow($playerRank['Rank'],$account->getAccountID(),$playerRank['Amount']);
107
+		if ($playerRank['Rank'] > $hofRank)
108
+			$PHP_OUTPUT .= displayHOFRow($playerRank['Rank'], $account->getAccountID(), $playerRank['Amount']);
109 109
 		else
110
-			$PHP_OUTPUT .= displayHOFRow($hofRank['Rank'],$account_id,$hofRank['Amount']);
110
+			$PHP_OUTPUT .= displayHOFRow($hofRank['Rank'], $account_id, $hofRank['Amount']);
111 111
 	}
112 112
 	else
113
-		$PHP_OUTPUT .= displayHOFRow($hofRank['Rank'],$account_id,$hofRank['Amount']);
113
+		$PHP_OUTPUT .= displayHOFRow($hofRank['Rank'], $account_id, $hofRank['Amount']);
114 114
 }
115 115
 
116
-$PHP_OUTPUT.=('</table></div>');
116
+$PHP_OUTPUT .= ('</table></div>');
Please login to merge, or discard this patch.
engine/Default/smr_file_create.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false)
2
+if (isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false)
3 3
 	$gameID = $var['AdminCreateGameID'];
4 4
 else
5 5
 	$gameID = $player->getGameID();
6 6
 
7
-if(isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false)
7
+if (isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false)
8 8
 	$adminCreate = true;
9 9
 else
10 10
 	$adminCreate = false;
@@ -13,94 +13,94 @@  discard block
 block discarded – undo
13 13
 [Races]
14 14
 ; Name = ID' . EOL;
15 15
 foreach (Globals::getRaces() as $race) {
16
-	$file.=inify($race['Race Name']).'='.$race['Race ID'] . EOL;
16
+	$file .= inify($race['Race Name']) . '=' . $race['Race ID'] . EOL;
17 17
 }
18 18
 
19
-$file.='[Goods]
19
+$file .= '[Goods]
20 20
 ; ID = Name, BasePrice' . EOL;
21 21
 foreach (Globals::getGoods() as $good) {
22
-	$file.=$good['ID'].'='.inify($good['Name']).','.$good['BasePrice'] . EOL;
22
+	$file .= $good['ID'] . '=' . inify($good['Name']) . ',' . $good['BasePrice'] . EOL;
23 23
 }
24 24
 
25
-$file.='[Weapons]
25
+$file .= '[Weapons]
26 26
 ; Weapon = Race,Cost,Shield,Armour,Accuracy,Power level,EMP (%),Align Restriction,Attack Restriction
27 27
 ; Align: 0=none, 1=good, 2=evil, 3=newbie
28 28
 ; Attack: 0=none, 1=raid' . EOL;
29 29
 foreach (SmrWeapon::getAllWeapons(Globals::getGameType($gameID)) as $weapon) {
30
-	$file.=inify($weapon->getName()).'='.inify($weapon->getRaceName()).','.$weapon->getCost().','.$weapon->getShieldDamage().','.$weapon->getArmourDamage().','.$weapon->getBaseAccuracy().','.$weapon->getPowerLevel().','.$weapon->getEmpDamage().','.$weapon->getBuyerRestriction().','.($weapon->isRaidWeapon()?'1':'0') . EOL;
30
+	$file .= inify($weapon->getName()) . '=' . inify($weapon->getRaceName()) . ',' . $weapon->getCost() . ',' . $weapon->getShieldDamage() . ',' . $weapon->getArmourDamage() . ',' . $weapon->getBaseAccuracy() . ',' . $weapon->getPowerLevel() . ',' . $weapon->getEmpDamage() . ',' . $weapon->getBuyerRestriction() . ',' . ($weapon->isRaidWeapon() ? '1' : '0') . EOL;
31 31
 }
32 32
 
33
-$file.='[ShipEquipment]
33
+$file .= '[ShipEquipment]
34 34
 ; Name = Cost' . EOL;
35 35
 $hardwares = Globals::getHardwareTypes();
36 36
 foreach ($hardwares as $hardware) {
37
-	$file.=inify($hardware['Name']).'='.$hardware['Cost'] . EOL;
37
+	$file .= inify($hardware['Name']) . '=' . $hardware['Cost'] . EOL;
38 38
 }
39 39
 
40
-$file.='[Ships]
40
+$file .= '[Ships]
41 41
 ; Name = Race,Cost,TPH,Hardpoints,Power,+Equipment (Optional),+Restrictions(Optional)
42 42
 ; Restrictions:Align(Integer)' . EOL;
43 43
 foreach (AbstractSmrShip::getAllBaseShips(Globals::getGameType($gameID)) as $ship) {
44
-	$file.=inify($ship['Name']).'='.Globals::getRaceName($ship['RaceID']).','.$ship['Cost'].','.$ship['Speed'].','.$ship['Hardpoint'].','.$ship['MaxPower'];
45
-	if($ship['MaxHardware']>0) {
46
-		$shipEquip=',ShipEquipment=';
47
-		foreach($ship['MaxHardware'] as $hardwareID => $maxHardware) {
48
-			$shipEquip.=$hardwares[$hardwareID]['Name'].'='.$maxHardware.';';
44
+	$file .= inify($ship['Name']) . '=' . Globals::getRaceName($ship['RaceID']) . ',' . $ship['Cost'] . ',' . $ship['Speed'] . ',' . $ship['Hardpoint'] . ',' . $ship['MaxPower'];
45
+	if ($ship['MaxHardware'] > 0) {
46
+		$shipEquip = ',ShipEquipment=';
47
+		foreach ($ship['MaxHardware'] as $hardwareID => $maxHardware) {
48
+			$shipEquip .= $hardwares[$hardwareID]['Name'] . '=' . $maxHardware . ';';
49 49
 		}
50
-		$file .= substr($shipEquip,0,-1);
51
-		$file.=',Restrictions='.$ship['AlignRestriction'];
50
+		$file .= substr($shipEquip, 0, -1);
51
+		$file .= ',Restrictions=' . $ship['AlignRestriction'];
52 52
 	}
53
-	$file.= EOL;
53
+	$file .= EOL;
54 54
 }
55 55
 
56
-$file.='[Locations]
56
+$file .= '[Locations]
57 57
 ; Name = +Sells' . EOL;
58 58
 foreach (SmrLocation::getAllLocations() as $location) {
59
-	$file.=inify($location->getName()).'=';
60
-	$locSells='';
61
-	if($location->isWeaponSold()) {
62
-		$locSells.='Weapons=';
59
+	$file .= inify($location->getName()) . '=';
60
+	$locSells = '';
61
+	if ($location->isWeaponSold()) {
62
+		$locSells .= 'Weapons=';
63 63
 		foreach ($location->getWeaponsSold() as $locWeapon) {
64
-			$locSells.=$locWeapon->getName().';';
64
+			$locSells .= $locWeapon->getName() . ';';
65 65
 		}
66
-		$locSells = substr($locSells,0,-1).',';
66
+		$locSells = substr($locSells, 0, -1) . ',';
67 67
 	}
68
-	if($location->isHardwareSold()) {
69
-		$locSells.='ShipEquipment=';
68
+	if ($location->isHardwareSold()) {
69
+		$locSells .= 'ShipEquipment=';
70 70
 		foreach ($location->getHardwareSold() as $locHardware) {
71
-			$locSells.=$locHardware['Name'].';';
71
+			$locSells .= $locHardware['Name'] . ';';
72 72
 		}
73
-		$locSells = substr($locSells,0,-1).',';
73
+		$locSells = substr($locSells, 0, -1) . ',';
74 74
 	}
75
-	if($location->isShipSold()) {
76
-		$locSells.='Ships=';
75
+	if ($location->isShipSold()) {
76
+		$locSells .= 'Ships=';
77 77
 		foreach ($location->getShipsSold() as $locShip) {
78
-			$locSells.=$locShip['Name'].';';
78
+			$locSells .= $locShip['Name'] . ';';
79 79
 		}
80
-		$locSells = substr($locSells,0,-1).',';
80
+		$locSells = substr($locSells, 0, -1) . ',';
81 81
 	}
82
-	if($location->isBank()) {
83
-		$locSells.='Bank=,';
82
+	if ($location->isBank()) {
83
+		$locSells .= 'Bank=,';
84 84
 	}
85
-	if($location->isBar()) {
86
-		$locSells.='Bar=,';
85
+	if ($location->isBar()) {
86
+		$locSells .= 'Bar=,';
87 87
 	}
88
-	if($location->isHQ()) {
89
-		$locSells.='HQ=,';
88
+	if ($location->isHQ()) {
89
+		$locSells .= 'HQ=,';
90 90
 	}
91
-	if($location->isUG()) {
92
-		$locSells.='UG=,';
91
+	if ($location->isUG()) {
92
+		$locSells .= 'UG=,';
93 93
 	}
94
-	if($location->isFed()) {
95
-		$locSells.='Fed=,';
94
+	if ($location->isFed()) {
95
+		$locSells .= 'Fed=,';
96 96
 	}
97
-	if($locSells!='')
98
-		$file .= substr($locSells,0,-1);
99
-	$file.= EOL;
97
+	if ($locSells != '')
98
+		$file .= substr($locSells, 0, -1);
99
+	$file .= EOL;
100 100
 }
101 101
 
102
-$file.='[Game]
103
-Name='.inify(Globals::getGameName($gameID)).'
102
+$file .= '[Game]
103
+Name='.inify(Globals::getGameName($gameID)) . '
104 104
 [Galaxies]
105 105
 ';
106 106
 $galaxies = SmrGalaxy::getGameGalaxies($gameID);
@@ -113,20 +113,20 @@  discard block
 block discarded – undo
113 113
 	foreach ($galaxy->getSectors() as $sector) {
114 114
 		$file .= '[Sector=' . $sector->getSectorID() . ']' . EOL;
115 115
 		
116
-		if(!$sector->isVisited($player) && $adminCreate === false)
116
+		if (!$sector->isVisited($player) && $adminCreate === false)
117 117
 			continue;
118 118
 		
119
-		foreach($sector->getLinks() as $linkName => $link) {
120
-			$file .= $linkName.'='.$link . EOL;
119
+		foreach ($sector->getLinks() as $linkName => $link) {
120
+			$file .= $linkName . '=' . $link . EOL;
121 121
 		}
122
-		if($sector->hasWarp())
123
-			$file .= 'Warp='.$sector->getWarp() . EOL;
124
-		if(($adminCreate !== false && $sector->hasPort()) || is_object($player) && $sector->hasCachedPort($player)) {
125
-			if($adminCreate !== false)
122
+		if ($sector->hasWarp())
123
+			$file .= 'Warp=' . $sector->getWarp() . EOL;
124
+		if (($adminCreate !== false && $sector->hasPort()) || is_object($player) && $sector->hasCachedPort($player)) {
125
+			if ($adminCreate !== false)
126 126
 				$port = $sector->getPort();
127 127
 			else
128 128
 				$port = $sector->getCachedPort($player);
129
-			$file .= 'Port Level='.$port->getLevel() . EOL;
129
+			$file .= 'Port Level=' . $port->getLevel() . EOL;
130 130
 			$file .= 'Port Race=' . $port->getRaceID() . EOL;
131 131
 			if (!empty($port->getSoldGoodIDs())) {
132 132
 				$file .= 'Buys=' . join(',', $port->getSoldGoodIDs()) . EOL;
@@ -136,23 +136,23 @@  discard block
 block discarded – undo
136 136
 				$file .= 'Sells=' . join(',', $port->getBoughtGoodIDs()) . EOL;
137 137
 			}
138 138
 		}
139
-		if($sector->hasPlanet()) {
139
+		if ($sector->hasPlanet()) {
140 140
 			$planetType = $sector->getPlanet()->getTypeID();
141 141
 			$file .= 'Planet=' . $planetType . EOL;
142 142
 		}
143
-		if($sector->hasLocation()) {
144
-			$locationsString= 'Locations=';
143
+		if ($sector->hasLocation()) {
144
+			$locationsString = 'Locations=';
145 145
 			foreach ($sector->getLocations() as $location) {
146 146
 				$locationsString .= inify($location->getName()) . ',';
147 147
 			}
148
-			$file .= substr($locationsString,0,-1) . EOL;
148
+			$file .= substr($locationsString, 0, -1) . EOL;
149 149
 		}
150
-		if($adminCreate === false && $sector->hasFriendlyForces($player)) {
151
-			$forcesString= 'FriendlyForces=';
150
+		if ($adminCreate === false && $sector->hasFriendlyForces($player)) {
151
+			$forcesString = 'FriendlyForces=';
152 152
 			foreach ($sector->getFriendlyForces($player) as $forces) {
153
-				$forcesString .= inify($forces->getOwner()->getPlayerName()) . '='.inify(Globals::getHardwareName(HARDWARE_MINE)).'='.$forces->getMines().';'.inify(Globals::getHardwareName(HARDWARE_COMBAT)).'='.$forces->getCDs().';'.inify(Globals::getHardwareName(HARDWARE_SCOUT)).'='.$forces->getSDs().',';
153
+				$forcesString .= inify($forces->getOwner()->getPlayerName()) . '=' . inify(Globals::getHardwareName(HARDWARE_MINE)) . '=' . $forces->getMines() . ';' . inify(Globals::getHardwareName(HARDWARE_COMBAT)) . '=' . $forces->getCDs() . ';' . inify(Globals::getHardwareName(HARDWARE_SCOUT)) . '=' . $forces->getSDs() . ',';
154 154
 			}
155
-			$file .= substr($forcesString,0,-1) . EOL;
155
+			$file .= substr($forcesString, 0, -1) . EOL;
156 156
 		}
157 157
 	}
158 158
 	SmrPort::clearCache();
@@ -166,11 +166,11 @@  discard block
 block discarded – undo
166 166
 header('Pragma: public');
167 167
 header('Expires: 0');
168 168
 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
169
-header('Cache-Control: private',false);
169
+header('Cache-Control: private', false);
170 170
 header('Content-Type: application/force-download');
171
-header('Content-Disposition: attachment; filename="'.Globals::getGameName($gameID).'.smr"');
171
+header('Content-Disposition: attachment; filename="' . Globals::getGameName($gameID) . '.smr"');
172 172
 header('Content-Transfer-Encoding: binary');
173
-header('Content-Length: '.$size);
173
+header('Content-Length: ' . $size);
174 174
 
175 175
 echo $file;
176 176
 
Please login to merge, or discard this patch.
engine/Default/reopen_account.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$template->assign('PageTopic','Re-Open Account?');
3
+$template->assign('PageTopic', 'Re-Open Account?');
4 4
 
5 5
 // This page should only be accessed by players whose accounts
6 6
 // have been closed at their own request.
Please login to merge, or discard this patch.