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
Push — master ( 8d8584...432c27 )
by Dan
31s queued 20s
created
lib/Default/AbstractSmrPort.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 			do {
1181 1181
 				$targetPlayer = $targetPlayers[array_rand($targetPlayers)];
1182 1182
 			} while ($results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()] > min($results['TotalShotsPerTargetPlayer']));
1183
-			$results['Weapons'][$orderID] =& $weapon->shootPlayerAsPort($this, $targetPlayer);
1183
+			$results['Weapons'][$orderID] = & $weapon->shootPlayerAsPort($this, $targetPlayer);
1184 1184
 			$results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()]++;
1185 1185
 			if ($results['Weapons'][$orderID]['Hit']) {
1186 1186
 				$results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage'];
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 		}
1190 1190
 		if ($this->hasCDs()) {
1191 1191
 			$thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true);
1192
-			$results['Drones'] =& $thisCDs->shootPlayerAsPort($this, $targetPlayers[array_rand($targetPlayers)]);
1192
+			$results['Drones'] = & $thisCDs->shootPlayerAsPort($this, $targetPlayers[array_rand($targetPlayers)]);
1193 1193
 			$results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage'];
1194 1194
 			$results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage'];
1195 1195
 		}
Please login to merge, or discard this patch.
lib/Default/SmrPlanet.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 		$results['DeadBeforeShot'] = false;
1147 1147
 		$weapons = $this->getWeapons();
1148 1148
 		foreach ($weapons as $orderID => $weapon) {
1149
-			$results['Weapons'][$orderID] =& $weapon->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1149
+			$results['Weapons'][$orderID] = & $weapon->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1150 1150
 			if ($results['Weapons'][$orderID]['Hit']) {
1151 1151
 				$results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage'];
1152 1152
 				$results['TotalDamagePerTargetPlayer'][$results['Weapons'][$orderID]['TargetPlayer']->getAccountID()] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage'];
@@ -1154,7 +1154,7 @@  discard block
 block discarded – undo
1154 1154
 		}
1155 1155
 		if ($this->hasCDs()) {
1156 1156
 			$thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true);
1157
-			$results['Drones'] =& $thisCDs->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1157
+			$results['Drones'] = & $thisCDs->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1158 1158
 			$results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage'];
1159 1159
 			$results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage'];
1160 1160
 		}
Please login to merge, or discard this patch.
engine/Default/chat_sharing.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
 	$shareFrom[$fromAccountId] = array(
20 20
 		'Player ID'   => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(),
21 21
 		'Player Name' => $otherPlayer == null ?
22
-		                 '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() :
23
-		                 $otherPlayer->getPlayerName(),
22
+		                 '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : $otherPlayer->getPlayerName(),
24 23
 		'All Games'   => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>',
25 24
 		'Game ID'     => $gameId,
26 25
 	);
@@ -40,8 +39,7 @@  discard block
 block discarded – undo
40 39
 	$shareTo[$toAccountId] = array(
41 40
 		'Player ID'   => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(),
42 41
 		'Player Name' => $otherPlayer == null ?
43
-		                 '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() :
44
-		                 $otherPlayer->getPlayerName(),
42
+		                 '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : $otherPlayer->getPlayerName(),
45 43
 		'All Games'   => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>',
46 44
 		'Game ID'     => $gameId,
47 45
 	);
Please login to merge, or discard this patch.
engine/Default/combat_simulator.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,91 +1,91 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2
-$template->assign('PageTopic','Combat Simulator');
2
+$template->assign('PageTopic', 'Combat Simulator');
3 3
 
4
-$template->assign('EditDummysLink',SmrSession::getNewHREF(create_container('skeleton.php','edit_dummys.php')));
4
+$template->assign('EditDummysLink', SmrSession::getNewHREF(create_container('skeleton.php', 'edit_dummys.php')));
5 5
 $template->assign('DummyNames', DummyPlayer::getDummyPlayerNames());
6 6
 
7 7
 $duplicates = false;
8 8
 $usedNames = array();
9 9
 $realAttackers = array();
10 10
 $attackers = array();
11
-$i=1;
12
-if(isset($_POST['attackers']))
13
-	foreach($_POST['attackers'] as $attackerName) {
14
-		if($attackerName=='none')
11
+$i = 1;
12
+if (isset($_POST['attackers']))
13
+	foreach ($_POST['attackers'] as $attackerName) {
14
+		if ($attackerName == 'none')
15 15
 			continue;
16
-		if(isset($usedNames[$attackerName])) {
16
+		if (isset($usedNames[$attackerName])) {
17 17
 			$duplicates = true;
18 18
 			continue;
19 19
 		}
20 20
 		$usedNames[$attackerName] = true;
21
-		$attackers[$i] =& DummyPlayer::getCachedDummyPlayer($attackerName);
21
+		$attackers[$i] = & DummyPlayer::getCachedDummyPlayer($attackerName);
22 22
 		$attackers[$i]->setAllianceID(1);
23
-		$realAttackers[$i] =& $attackers[$i];
23
+		$realAttackers[$i] = & $attackers[$i];
24 24
 		++$i;
25 25
 	}
26 26
 
27
-for(;$i<=10;++$i)
27
+for (;$i <= 10; ++$i)
28 28
 	$attackers[$i] = null;
29
-$template->assign('Attackers',$attackers);
29
+$template->assign('Attackers', $attackers);
30 30
 
31
-$i=1;
31
+$i = 1;
32 32
 $realDefenders = array();
33 33
 $defenders = array();
34
-if(isset($_POST['defenders']))
35
-	foreach($_POST['defenders'] as $defenderName) {
36
-		if($defenderName=='none')
34
+if (isset($_POST['defenders']))
35
+	foreach ($_POST['defenders'] as $defenderName) {
36
+		if ($defenderName == 'none')
37 37
 			continue;
38
-		if(isset($usedNames[$defenderName])) {
38
+		if (isset($usedNames[$defenderName])) {
39 39
 			$duplicates = true;
40 40
 			continue;
41 41
 		}
42 42
 		$usedNames[$attackerName] = true;
43
-		$defenders[$i] =& DummyPlayer::getCachedDummyPlayer($defenderName);
43
+		$defenders[$i] = & DummyPlayer::getCachedDummyPlayer($defenderName);
44 44
 		$defenders[$i]->setAllianceID(2);
45
-		$realDefenders[$i] =& $defenders[$i];
45
+		$realDefenders[$i] = & $defenders[$i];
46 46
 		++$i;
47 47
 	}
48 48
 	
49
-for(;$i<=10;++$i)
49
+for (;$i <= 10; ++$i)
50 50
 	$defenders[$i] = null;
51
-$template->assign('Defenders',$defenders);
51
+$template->assign('Defenders', $defenders);
52 52
 
53
-$template->assign('Duplicates',$duplicates);
53
+$template->assign('Duplicates', $duplicates);
54 54
 
55
-$template->assign('CombatSimHREF',SmrSession::getNewHREF(create_container('skeleton.php','combat_simulator.php')));
55
+$template->assign('CombatSimHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'combat_simulator.php')));
56 56
 
57 57
 if (!empty($realAttackers) && !empty($realDefenders)) {
58
-	if(isset($_REQUEST['run'])) {
59
-		runAnAttack($realAttackers,$realDefenders);
58
+	if (isset($_REQUEST['run'])) {
59
+		runAnAttack($realAttackers, $realDefenders);
60 60
 	}
61
-	if(isset($_REQUEST['death_run'])) {
62
-		while(count($realAttackers)>0 && count($realDefenders)>0) {
63
-			runAnAttack($realAttackers,$realDefenders);
64
-			foreach($realAttackers as $key => &$teamPlayer) {
65
-				if($teamPlayer->isDead())
61
+	if (isset($_REQUEST['death_run'])) {
62
+		while (count($realAttackers) > 0 && count($realDefenders) > 0) {
63
+			runAnAttack($realAttackers, $realDefenders);
64
+			foreach ($realAttackers as $key => &$teamPlayer) {
65
+				if ($teamPlayer->isDead())
66 66
 					unset($realAttackers[$key]);
67 67
 			} unset($teamPlayer);
68
-			foreach($realDefenders as $key => &$teamPlayer) {
69
-				if($teamPlayer->isDead())
68
+			foreach ($realDefenders as $key => &$teamPlayer) {
69
+				if ($teamPlayer->isDead())
70 70
 					unset($realDefenders[$key]);
71 71
 			} unset($teamPlayer);
72 72
 		}
73 73
 	}
74 74
 }
75 75
 
76
-function runAnAttack($realAttackers,$realDefenders) {
76
+function runAnAttack($realAttackers, $realDefenders) {
77 77
 	global $template;
78 78
 	$results = array('Attackers' => array('Traders' => array(), 'TotalDamage' => 0), 
79 79
 					'Defenders' => array('Traders' => array(), 'TotalDamage' => 0));
80 80
 	foreach ($realAttackers as $accountID => $teamPlayer) {
81
-		$playerResults =& $teamPlayer->shootPlayers($realDefenders);
82
-		$results['Attackers']['Traders'][] =& $playerResults;
81
+		$playerResults = & $teamPlayer->shootPlayers($realDefenders);
82
+		$results['Attackers']['Traders'][] = & $playerResults;
83 83
 		$results['Attackers']['TotalDamage'] += $playerResults['TotalDamage'];
84 84
 	}
85 85
 	foreach ($realDefenders as $accountID => $teamPlayer) {
86
-		$playerResults =& $teamPlayer->shootPlayers($realAttackers);
87
-		$results['Defenders']['Traders'][]  =& $playerResults;
86
+		$playerResults = & $teamPlayer->shootPlayers($realAttackers);
87
+		$results['Defenders']['Traders'][] = & $playerResults;
88 88
 		$results['Defenders']['TotalDamage'] += $playerResults['TotalDamage'];
89 89
 	}
90
-	$template->assign('TraderCombatResults',$results);
90
+	$template->assign('TraderCombatResults', $results);
91 91
 }
Please login to merge, or discard this patch.
lib/Default/DummyPlayer.class.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,31 +1,31 @@  discard block
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3 3
 class DummyPlayer extends AbstractSmrPlayer {
4
-	public function __construct($gameID=0,$playerName='Dummy',$raceID=1,$experience=1000,$alignment=100,$allianceID=0,$shipTypeID=60) {
4
+	public function __construct($gameID = 0, $playerName = 'Dummy', $raceID = 1, $experience = 1000, $alignment = 100, $allianceID = 0, $shipTypeID = 60) {
5 5
 		parent::__construct();
6 6
 		$this->accountID				= 0;
7
-		$this->gameID					= (int) $gameID;
8
-		$this->playerName				= (string) $playerName;
7
+		$this->gameID = (int)$gameID;
8
+		$this->playerName = (string)$playerName;
9 9
 		$this->playerID					= 0;
10 10
 		$this->sectorID					= 0;
11
-		$this->lastSectorID				= 0;
11
+		$this->lastSectorID = 0;
12 12
 		$this->turns					= 1000;
13
-		$this->newbieTurns				= 0;
13
+		$this->newbieTurns = 0;
14 14
 		$this->lastNewsUpdate			= 0;
15 15
 		$this->dead						= false;
16 16
 		$this->landedOnPlanet			= false;
17
-		$this->lastActive				= 0;
18
-		$this->lastCPLAction			= 0;
19
-		$this->raceID					= (int) $raceID;
20
-		$this->credits					= 0;
21
-		$this->experience				= (int) $experience;
22
-		$this->alignment				= (int) $alignment;
23
-		$this->militaryPayment			= 0;
24
-		$this->allianceID				= (int) $allianceID;
25
-		$this->shipID					= (int) $shipTypeID;
17
+		$this->lastActive = 0;
18
+		$this->lastCPLAction = 0;
19
+		$this->raceID = (int)$raceID;
20
+		$this->credits = 0;
21
+		$this->experience				= (int)$experience;
22
+		$this->alignment = (int)$alignment;
23
+		$this->militaryPayment = 0;
24
+		$this->allianceID				= (int)$allianceID;
25
+		$this->shipID					= (int)$shipTypeID;
26 26
 		$this->kills					= 0;
27 27
 		$this->deaths					= 0;
28
-		$this->lastPort					= 0;
28
+		$this->lastPort = 0;
29 29
 		$this->bank						= 0;
30 30
 		$this->zoom						= 0;
31 31
 		
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	}
54 54
 	
55 55
 	public function setAllianceID($ID) {
56
-		if($this->allianceID == $ID)
56
+		if ($this->allianceID == $ID)
57 57
 			return;
58
-		$this->allianceID=$ID;
58
+		$this->allianceID = $ID;
59 59
 	}
60 60
 	
61 61
 	public function &killPlayerByPlayer(AbstractSmrPlayer $killer) {
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 		$db = new SmrMySqlDatabase();
82 82
 		$db->query('REPLACE INTO cached_dummys ' .
83 83
 					'(type, id, info) ' .
84
-					'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeString($cache).')');	
84
+					'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeString($cache) . ')');	
85 85
 		 unserialize($cache);
86 86
 	}
87 87
 	
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		$db->query('SELECT info FROM cached_dummys
91 91
 					WHERE type = \'DummyPlayer\'
92 92
 						AND id = ' . $db->escapeString($name) . ' LIMIT 1');
93
-		if($db->nextRecord()) {
93
+		if ($db->nextRecord()) {
94 94
 			$return = unserialize($db->getField('info'));
95 95
 			return $return;
96 96
 		}
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		$db->query('SELECT id FROM cached_dummys
106 106
 					WHERE type = \'DummyPlayer\'');
107 107
 		$dummyNames = array();
108
-		while($db->nextRecord()) {
108
+		while ($db->nextRecord()) {
109 109
 			$dummyNames[] = $db->getField('id');
110 110
 		}
111 111
 		return $dummyNames;
Please login to merge, or discard this patch.
admin/Default/1.6/game_create_processing.php 1 patch
Spacing   +26 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,22 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3 3
 //first create the game
4
-$db->query('SELECT game_id FROM game WHERE game_name='.$db->escapeString($_REQUEST['game_name']).' LIMIT 1');
4
+$db->query('SELECT game_id FROM game WHERE game_name=' . $db->escapeString($_REQUEST['game_name']) . ' LIMIT 1');
5 5
 if ($db->nextRecord()) {
6 6
 	create_error('That game name is already taken.');
7 7
 }
8 8
 
9 9
 $db->query('SELECT game_id FROM game ORDER BY game_id DESC LIMIT 1');
10 10
 if ($db->nextRecord()) {
11
-	$newID = $db->getInt('game_id')+1;
11
+	$newID = $db->getInt('game_id') + 1;
12 12
 } else {
13 13
 	$newID = 1;
14 14
 }
15 15
 
16 16
 // Get the dates ("|" sets hr/min/sec to 0)
17 17
 $join = DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_join']);
18
-$start = empty($_REQUEST['game_start']) ? $join :
19
-         DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_start']);
18
+$start = empty($_REQUEST['game_start']) ? $join : DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_start']);
20 19
 $end = DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_end']);
21 20
 
22 21
 $game = SmrGame::createGame($newID);
@@ -70,7 +69,7 @@  discard block
 block discarded – undo
70 69
 	7) Contact Newbie Help Leader for help, advice or with any questions you have.<br />
71 70
 	<br />
72 71
 	8) Most of all - have fun out there!';
73
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 1, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
72
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 1, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
74 73
 	
75 74
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 2, \'What the Newbie Help Alliance (NHA) can do for you\')');
76 75
 	$text = 'There are a number of ways this alliance can help you as a new player, and you are welcome to make use of as many or as few of these as you wish:<br />
@@ -84,7 +83,7 @@  discard block
 block discarded – undo
84 83
 	4) If you stay in NHA, stay active, try to learn, and keep in touch with the Newbie Help Leader then this alliance can be a stepping stone to the more established alliances. Every game I get alliance leaders asking me to recommend newbies who are active and have potential.<br />
85 84
 	<br />
86 85
 	5) Newbie Help Leader will work with each of you individually on specific questions and game goals if you want. If resources allow it (I am dependent on my own trading income for cash) I try to reward players for achieving the game goals they work towards. I also try to make sure that members have at least a mid-level tradeship after they have been killed, although I try to make sure that they have learned from their mistakes before buying replacement ships (to be fair to the rest of the players in the game, you can no longer get cash or new ships after reaching fledgling status, although you are welcome to stay in the alliance as long as you like).';
87
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 2, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
86
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 2, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
88 87
 	
89 88
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 3, \'Turns\')');
90 89
 	$text = 'Many of the basic actions performed in SMR cost turns, the most common examples being moving, trading &amp; attacking. One of the keys to success in the game is good turn management, no matter what you are busing the turns to accomplish. If you are a trader, you want to get as much cash and xp as possible per turn used. If you are a hunter, you want to spend as many turns as possible efficiently locating targets and getting kills, and as few as possible chasing traders around without getting the final trigger shot off. In an alliance, you will often be expected to save turns for op\'s, where it is often crucial to have plenty of alliance members show up with plenty of turns.<br />
@@ -92,7 +91,7 @@  discard block
 block discarded – undo
92 91
 	Turns are accumulated constantly, whether you are logged in or not, and are a product of ship speed and game speed. When you click the Trader link on the left of your screen, one of the things you will see is how many turns you get per hour in the ship you are in, and also the maximum number of turns you can accumulate in the current game. It is important to manage your turns carefully - make sure to always leave yourself enough turns to get back to somewhere you can park safely (preferably with some to spare in case you run into trouble on the way). It can sometimes be a good idea to save up a large number of turns so you can use them all in one session, but be aware that this is not always possible or even ideal. You should try to avoid reaching the maximum number of turns, since you will then stop getting more and will basically be wasting the turns you would usually have accumulated.<br />
93 92
 	<br />
94 93
 	A good way to get a few extra turns and help the game at the same time is to click on the voting links at the bottom of your screen. Voting for SMR helps our rankings, which brings more players to the game - making it better for all of us.';
95
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 3, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
94
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 3, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
96 95
 	
97 96
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 4, \'How to trade\')');
98 97
 	$text = 'In SMR, trading is the easiest and most fundamental way to accumulate both cash and experience points. The basic principles of trading are easy, but getting really good at it takes time and experience.<br />
@@ -106,7 +105,7 @@  discard block
 block discarded – undo
106 105
 	The experience you get from a trade depends on your relations with that race, and on how good a deal you make. With perfect relations (1000) you will automatically be offered the best possible deal by a port and will not need to bargain at all. At less than 1000 relations, you get experience depending on how well you bargain, where bargaining means offering a little less than the port asks for when you are buying and asking for a little more than the port is offering when you are selling. relations go up with successful trades, and they go down when a port refuses the bargain you offer them. If you are trading with your own race, it is often a good idea not to worry too much about making the best bargains at first and try to get maximum relations as quickly as possible.<br />
107 106
 	<br />
108 107
 	One of the major contributing factors to how well you can trade is the ship you are using. Profit and experience depend on the number of goods you are able to trade which depends in turn on the number of cargo holds you have and the speed of your ship. A general guide to how efficient a tradeship is is to multiply the number of holds by the ship speed to give you the trade potential. It is important to note, however, that trade potential is not the only important factor in choosing a tradeship. For example, the planetary super freighter is a very efficient trader with good defenses but is very slow and therefore very inefficient if you have to travel a lot between traderoutes and parking spots; whereas the Interstellar trader has pretty good trade potential and a jump drive to allow you to travel easily but has very weak defenses and is easily killed.';
109
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 4, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
108
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 4, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
110 109
 	
111 110
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 5, \'Safe trading\')');
112 111
 	$text = 'This topic is extensive, and there is no substitute for playing the game, probably dying a few times, and learning through experience. However, it doesn\'t hurt to keep a few tips and tricks in mind:<br />
@@ -122,7 +121,7 @@  discard block
 block discarded – undo
122 121
 	4) Watch the CPL. Before and during trading, keep an eye on the current player list and the news, and look for hunters who you think may come for you. It is sometimes better to leave trading for another time, but at least stay alive.<br />
123 122
 	<br />
124 123
 	5) Use local map. It can sometimes be useful to enter your port sectors using local map, especially if you suspect there may be trouble close by. This allows you to see ships sitting in neighbouring sectors waiting to ambush you, but it only works if you have a scanner.';
125
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 5, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
124
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 5, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
126 125
 	
127 126
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 6, \'Get a scanner\')');
128 127
 	$text = ' 	If your ship can equip with a scanner, then get one and learn how to use it. Scanners are very useful for moving around safely and for gathering information about local sectors. Some examples:<br />
@@ -132,19 +131,19 @@  discard block
 block discarded – undo
132 131
 	Scanners can warn you of cloaked ships. Scanning a sector (from a neighbouring sector) will give you a reading on the number of ships there. Enemy ships scan as their defensive value x 10. For example, if you scan a sector and get a reading of 300, then enter and see only a planetary super freighter there (def value of 15) then you know there is a 150 scan unaccounted for, which means a cloaked ship. At this point, you will probably want to get out of there fast! (Note that ship scans can sometimes also be off due to Illusion generator ships pretending to be something they are not).<br />
133 132
 	<br />
134 133
 	Scanners will give you force readings. Scanning a neighbouring sector will tell you the total number of forces in the sector (scouts scan as 1, drones as 2, mines as 3). This allows you to avoid sectors with heavy force scans (which usually means a lot of mines) when navigating.';
135
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 6, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
134
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 6, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
136 135
 	
137 136
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 7, \'Logging off safely\')');
138 137
 	$text = 'Before logging off, it is very important to ALWAYS check that your are as safe as you can be. Until you join a major alliance, you should all be parking safely in federally protected space every time you log off (sectors with a "Federal Beacon"). Before leaving SMR, ALWAYS check your main screen protection message and/or click the "Trader" link to make sure you are in fact protected.<br />
139 138
 	<br />
140 139
 	The two things that can prevent you from having federal protection are carrying illegal goods (slaves, weapons or narcotics) or having an attack rating that is too high. At neutral alignment, that is +/-149, you can park safely with an attack rating of 3 or less. The attack rating you can park with increases with increasing alignment and decreases with decreasing alignment.';
141
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 7, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
140
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 7, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
142 141
 	
143 142
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 8, \'Merchant\\\'s Guide to the Universe\')');
144 143
 	$text = 'MGU, as everyone calls it, is an extremely valuable tool to use alongside SMR. Details on how to get the software (as well as instructions and discussions) can be found on the SMR Webboard at http://smrcnn.smrealms.de/viewforum.php?f=32<br />
145 144
 	<br />
146 145
 	Basically, after you have installed MGU, you need to download your game maps using the link on the left side of the SMR page, and save them into your MGU directory. From MGU, you can then open the game maps and access the map information to do may useful things. MGU functions include things like finding traderoutes (listed by experience or cash), finding locations, plotting arming routes, finding safe course plots, etc.';
147
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 8, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
146
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 8, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
148 147
 		
149 148
 // remove newbie gals
150 149
 //	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 9, \'Racial galaxies\')');
@@ -157,19 +156,19 @@  discard block
 block discarded – undo
157 156
 	If you do get killed, it can be useful to politely message your killer and ask what you did wrong - most veteran players will be more than happy to advise you on how to avoid the same thing happening again, plus it shows them that you want to learn how to improve at the game. If you get a kill, it is considered impolite to send messages gloating over the fact, although some veteran players will sometimes message newbies they have killed with offers of cash to get them back on their feet or advice on how to avoid the same thing happening again.<br />
158 157
 	<br />
159 158
 	There are all kinds of ways to play and enjoy this game, different players choose to emphasize different aspects of gameplay - but whatever choices you make, the bottom line is that if you treat your fellow players (both allies and enemies) with respect, then they will respect you.';
160
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 10, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
159
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 10, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
161 160
 		
162 161
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 11, \'Talk to the players\')');
163 162
 	$text = 'SMR has a very active community, and it is always a good idea to talk to the other players. You can do this in the #smr chatroom, or by messaging them ingame. Most players will be happy to talk to you or help you if you send them polite messages.<br />
164 163
 	<br />
165 164
 	It is also a good idea to talk to veteran players, especially alliance leaders, about their alliances and what they look for in their team members. You probably won\'t be asked to join a major alliance right away, but many of them have training alliances and they are always looking for active players who are willing to learn and contribute to an alliance.';
166
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 11, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
165
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 11, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
167 166
 	
168 167
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 12, \'The Webboard\')');
169 168
 	$text = 'The SMR webboard (often referred to simply as the WB) is full of all kinds of advice and discussions, and I recommend stopping by to take a look every so often. It will all seem a bit much at first, but start with the sections that seem most useful to you and you will quickly learn to recognize what is important and what is not.<br />
170 169
 	<br />
171 170
 	You should also contribute to the webboard if you have an opinion or something you feel needs discussed, but please use the search function before starting new topics to make sure you are not repeating what someone else has posted somewhere else.';
172
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 12, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
171
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 12, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
173 172
 	
174 173
 	
175 174
 	
@@ -182,7 +181,7 @@  discard block
 block discarded – undo
182 181
 	If you are good (alignment 100 or higher) you can buy federal ships (Federal Discovery, Warrant and Ultimatum which all have jump drive and take half damage from forces) and buy the federal level 5 weapon (holy hand grenade). If you are neutral (between -99 and 99 alignment) you can become good by deputizing at any racial HQ. Good players cannot enter the underground HQ.<br />
183 182
 	<br />
184 183
 	Alignment also affects the attack ratings you can have and still be federally protected in fed space. At neutral alignment you can park with an attack rating of 3, and the protected rating goes up 1 for every +150 alignment and down 1 for every -150 alignment. You are always protected with an attack rating of zero.';
185
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 13, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
184
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 13, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
186 185
 	
187 186
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 14, \'Watching the news and CPL\')');
188 187
 	$text = 'Whether you are a trader or a hunter, it is very valuable to know as much as possible about who is currently active in the game, and where they might be. Two of the resources you need to learn to use, but also know the limitations of, are the news and the current player list (CPL).<br />
@@ -190,7 +189,7 @@  discard block
 block discarded – undo
190 189
 	Reading the news before you trade can be valuable in letting you know which hunters are currently active in the game, even if they don\'t show on the CPL. If there has been a recent kill near your traderoute, or a hunter that knows where you like to trade has recently been active, it is often a good idea to wait and trade another time.<br />
191 190
 	<br />
192 191
 	The CPL will let you know who has recently accessed the database, and also how many players are "lurking" (logged into the game, but not moving). It is a good idea to check the CPL for hunters you believe are a threat to you before you trade, and also every so often while you trade (especially if you are trading over a scout drone).';
193
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 14, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
192
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 14, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
194 193
 	
195 194
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 15, \'IRC chat\')');
196 195
 	$text = ' 	It is very helpful to learn to use IRC chat often while playing this game. The first step is to simply use the IRC chat link on the left of your screen and just spend some time in the #smr room getting to know some of the players. This is also a good time to ask questions - not just about technical or tactical aspects of the game, but about what the players like about the game, about the alliances, about pretty much anything. Getting to know the players and the community is part of getting to know SMR.<br />
@@ -198,7 +197,7 @@  discard block
 block discarded – undo
198 197
 	When you end up in an alliance, playing with a team, you will find that they pretty much all use dedicated alliance chatrooms that they use for conducting alliance operations. These rooms are also a place to simply hang out and chat, which is a great way to get to know your teammates.<br />
199 198
 	<br />
200 199
 	In time, if you are able to do so, it is useful to install an IRC client on the computer(s) you use. mIRC is free and works well. If you have trouble getting your IRC client to work, there are instructions and help to be found on the webboard.';
201
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 15, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
200
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 15, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
202 201
 	
203 202
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 16, \'Avoiding mines\')');
204 203
 	$text = 'Enemy mines are something you will encounter on a regular basis in SMR, and there are a couple of things that can help prevent you dying to them.<br />
@@ -210,11 +209,11 @@  discard block
 block discarded – undo
210 209
 	3) Work from UNO. If you are travelling a long way, it is often a very good idea not to plot your route directly from A to B, but to plan it so that you pass UNO shops along the way - this will allow you to refill your defenses as you go if you take some damage. This is especially important when travelling through large neutral galaxies.<br />
211 210
 	<br />
212 211
 	4) Use your maps. If you encounter heavily mined sectors, retreat to safety, then take the time to look carefully at your maps to see if the area you were in is close to something an alliance would want to protect (usually a galaxy warp or a Combat Accessories shop). Then plan a new route avoiding this area.';
213
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 16, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
212
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 16, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
214 213
 	
215 214
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 17, \'Port raiding\')');
216 215
 	$text = 'It\'s simple - don\'t do it! Raiding small ports will gain you nothing and will often get you killed, and raiding big ports is impossible without a well-armed fleet of warships.';
217
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 17, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
216
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 17, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
218 217
 	
219 218
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 18, \'Operations guide\')');
220 219
 	$text = ' 	http://smrcnn.smrealms.de/viewtopic.php?t=3922<br />
@@ -222,13 +221,13 @@  discard block
 block discarded – undo
222 221
 	Once you graduate to alliances that are more active in the bigger picture of a game, you will want to take part in alliance operations. SMR op\'s come in all kinds of shapes &amp; sizes and flavours, and involve things like territory wars, planet busts, port raids and fleet battles.<br />
223 222
 	<br />
224 223
 	The link I posted here is a rough guide to what you might expect, and what will be expected of you, in alliance op\'s.';
225
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 18, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
224
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 18, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
226 225
 	
227 226
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 19, \'Multiple accounts\')');
228 227
 	$text = 'Multiple accounts are NOT permitted in SMR. The game has admins who actively look for multiple accounts and suspicious activity. If you are caught playing more than one account, you risk losing all your accumulated stats and being banned from the game.<br />
229 228
 	<br />
230 229
 	One of the results of this strict policy on multiple accounts is that you should try to avoid logging into your account from any computer also used by other SMR players. Even though you are not actually playing more than one account, it can seem as though you are when the connection logs are checked.';
231
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 19, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
230
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 19, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
232 231
 	
233 232
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 20, \'Moving on to a new alliance\')');
234 233
 	$text = 'When you feel you are ready to move on from this alliance to a new one, it is a good idea to take the time to talk to the alliance leaders out there, When you do, don\'t be afraid to talk to the major alliances as well as the small ones - they probably won\'t offer you a spot right away, but they can give good advice and it also puts your name on their radar for future games.<br />
@@ -242,7 +241,7 @@  discard block
 block discarded – undo
242 241
 	5) Since you are still learning, what can you expect to learn from flying with a given alliance.<br />
243 242
 	<br />
244 243
 	There is no right time to leave this alliance and join a new one, but I recommend that you do not jump hastily or blindly into a random small alliance. Apart from anything else, some of the small ones are made up of new players who have as little game knowledge as you and are not doing anything remotely organized or coordinated.';
245
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 20, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
244
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 20, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
246 245
 			
247 246
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 21, \'Experience\')');
248 247
 	$text = 'There are many ways to play SMR, and many different aspects of the game to enjoy - but experience points are important whether you play with a high ranking as a goal in itself, or whether you see it as just another tool to help achieve other goals.<br />
@@ -253,7 +252,7 @@  discard block
 block discarded – undo
253 252
 	1) Higher weapon accuracy when you fire, and lower weapon accuracy for your opponents.<br />
254 253
 	2) The ability to cloak from lower ranked players.<br />
255 254
 	3) Demonstrating the ability to accumulate and keep a good experience level. This last benefit is especially important for new players since climbing the rankings and avoiding too many deaths will get you noticed.';
256
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 21, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
255
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 21, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
257 256
 	
258 257
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 22, \'Ships\')');
259 258
 	$text = 'Everything you do in SMR is done while you are flying some kind of ship - it can be anything from an escape pod to a huge IkThorne mothership, but you are always the pilot of something. In addition to the neutral ships, each race also has unique ships that only race members can purchase. You can find the SMR shiplist <a href="ship_list.php" target="_blank"><b><u>here</u></b></a>.<br />
@@ -280,7 +279,7 @@  discard block
 block discarded – undo
280 279
 	- Speed. Ship speed determines how fast your ship will accumulate turns. Faster ships gain more turns per hour and vice versa.<br />
281 280
 	- Hardware. Most ships can use one or more hardware items, each of which adds certain capabilities to the ship. These are Scanners (see scanner thread), Cloaks (invisibility from lower ranked traders when activated), Illusion Generators (the ability to disguise your ship), Jump Drives (allows you to jump from place to place without travelling through the sectors between), and Drone Scramblers (improved defense against combat drones).<br />
282 281
 	- Restricted ships. There are restrictions on who can buy certain ships. These include racial restrictions, top racial restrictions (the top racial ships cannot be purchased until you reach fledgling status), and alignment restrictions (Underground and Federal ships require you to be evil or good respectively, Federal ships also take half damage from forces).';
283
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 22, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
282
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 22, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
284 283
 	
285 284
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 23, \'Weapons\')');
286 285
 	$text = 'SMR has a wide variety of weapons with which to arm your ships, and information on weapon capabilities can be found <a href="weapon_list.php" target="_blank"><b><u>here</b></u></a>.<br />
@@ -292,7 +291,7 @@  discard block
 block discarded – undo
292 291
 	- Accuracy. Weapon accuracy (modified by trader level) determines how likely it is that your weapon will hit your target on any shot. In ship to ship combat, higher ranked traders get accuracy benefits over their lower ranked opponents. There is (and always has been since the dawn of this game) an ongoing debate about when it is better to use either high accuracy low damage weapons or low accuracy high damage weapons.<br />
293 292
 	- Rating. There are restrictions on how many weapons of certain ratings you are allowed to arm yourself with. Weapon rating is determined by accuracy and damage, and higher is better. You are allowed up to one level 5 weapon, up to 2 level 4 weapons, and up to 3 level 3 weapons.<br />
294 293
 	- Availability.Weapon choice when arming is sometimes determined by the availability of certain weapons. Racial weapons are only available to the owner race or races that have peaceful relations with them; weapons may be sold at weapon shops that are not safely accessible; or the number of turns it would take to acquire all the weapons you would like may be too high.';
295
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 23, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
294
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 23, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
296 295
 	
297 296
 	$db->query('REPLACE INTO alliance_thread_topic (game_id, alliance_id, thread_id, topic) VALUES (' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 24, \'Planets and Territory\')');
298 297
 	$text = 'Except for your ship and what it carries, a planet is the only thing in SMR that you can claim for yourself or your alliance. This means that planets and planet galaxies are often the main focus of the rivalries and wars between alliances.<br />
@@ -302,5 +301,5 @@  discard block
 block discarded – undo
302 301
 	Kill counts and experience are important measures of success, but many veteran players feel that the only true measure of success in alliance wars is the ability to hold and/or take territory from enemy alliances.<br />
303 302
 	<br />
304 303
 	It is important to note that weakly defended planets should NOT be considered safe parking spots.';
305
-	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 24, 1, '.$db->escapeString($text).', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
304
+	$db->query('REPLACE INTO alliance_thread (game_id, alliance_id, thread_id, reply_id, text, sender_id, time) VALUES(' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber(NHA_ID) . ', 24, 1, ' . $db->escapeString($text) . ', ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ', ' . $db->escapeNumber(TIME) . ')');
306 305
 }
Please login to merge, or discard this patch.
engine/Default/message_view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
 					AND receiver_delete = ' . $db->escapeBoolean(false) . '
203 203
 					ORDER BY send_time DESC');
204 204
 	while ($db->nextRecord()) {
205
-		$groupBox =& $messageBox['GroupedMessages'][$db->getInt('sender_id')];
205
+		$groupBox = & $messageBox['GroupedMessages'][$db->getInt('sender_id')];
206 206
 		// Limit the number of messages in each group
207 207
 		if (!isset($groupBox['Messages']) || count($groupBox['Messages']) < MESSAGE_SCOUT_GROUP_LIMIT) {
208 208
 			displayMessage($groupBox, $db->getInt('message_id'), $db->getInt('account_id'), $db->getInt('sender_id'), stripslashes($db->getField('message_text')), $db->getInt('send_time'), $db->getBoolean('msg_read'), MSG_SCOUT);
Please login to merge, or discard this patch.
engine/Default/help.inc 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	$db3 = new SmrMySqlDatabase();
8 8
 
9 9
 	// get current entry
10
-	$db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id));
10
+	$db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id));
11 11
 	if ($db->nextRecord()) {
12 12
 		$parent_topic_id = $db->getInt('parent_topic_id');
13 13
 		$order_id = $db->getInt('order_id');
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
 		// **************************
20 20
 		// **  PREVIOUS
21 21
 		// **************************
22
-		$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id - 1));
22
+		$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id - 1));
23 23
 
24 24
 		// no result?
25 25
 		if (!$db2->getNumRows())
26
-			$db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id));
26
+			$db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id));
27 27
 
28 28
 		echo ('<th width="32">');
29 29
 		if ($db2->nextRecord()) {
30 30
 			$previous_topic_id = $db2->getInt('topic_id');
31 31
 			$previous_topic = stripslashes($db2->getField('topic'));
32
-			echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>');
32
+			echo ('<a href="/manual.php?' . $previous_topic_id . '"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>');
33 33
 		} else
34 34
 			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
35 35
 		echo ('</th>');
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 		// **************************
38 38
 		// **  UP
39 39
 		// **************************
40
-		$db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id));
40
+		$db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id));
41 41
 		echo ('<th width="32">');
42 42
 		if ($db2->nextRecord()) {
43 43
 			$up_topic_id = $db2->getInt('topic_id');
44 44
 			$up_topic = stripslashes($db2->getField('topic'));
45
-			echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>');
45
+			echo ('<a href="/manual.php?' . $up_topic_id . '"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>');
46 46
 		} else
47 47
 			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
48 48
 		echo ('</th>');
@@ -50,35 +50,35 @@  discard block
 block discarded – undo
50 50
 		// **************************
51 51
 		// **  NEXT
52 52
 		// **************************
53
-		$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1');
53
+		$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($topic_id) . ' AND order_id = 1');
54 54
 
55 55
 		if (!$db2->getNumRows())
56
-			$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1));
56
+			$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id + 1));
57 57
 
58 58
 		$seenParentIDs = array(0);
59 59
 		$curr_parent_topic_id = $parent_topic_id;
60 60
 		while (!$db2->getNumRows() && !in_array($curr_parent_topic_id, $seenParentIDs)) {
61 61
 			$seenParentIDs[] = $curr_parent_topic_id;
62
-			$db3->query('SELECT * FROM manual WHERE topic_id = '.$db3->escapeNumber($parent_topic_id));
62
+			$db3->query('SELECT * FROM manual WHERE topic_id = ' . $db3->escapeNumber($parent_topic_id));
63 63
 			$db3->nextRecord();
64 64
 			$curr_order_id = $db3->getInt('order_id');
65 65
 			$curr_parent_topic_id = $db3->getInt('parent_topic_id');
66 66
 
67
-			$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($curr_order_id + 1));
67
+			$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($curr_order_id + 1));
68 68
 		}
69 69
 
70 70
 		echo ('<th width="32">');
71 71
 		if ($db2->nextRecord()) {
72 72
 			$next_topic_id = $db2->getInt('topic_id');
73 73
 			$next_topic = stripslashes($db2->getField('topic'));
74
-			echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>');
74
+			echo ('<a href="/manual.php?' . $next_topic_id . '"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>');
75 75
 		}
76 76
 		else {
77 77
 			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
78 78
 		}
79 79
 		echo ('</th>');
80 80
 
81
-		echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic.'</th>');
81
+		echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic . '</th>');
82 82
 		echo ('<th width="32"><a href="/manual_toc.php"><img src="/images/help/contents.jpg" width="32" height="32" border="0"></a></th>');
83 83
 
84 84
 		echo ('</tr>');
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
 		echo ('<tr>');
87 87
 		echo ('<td colspan="5">');
88 88
 		if (isset($previous_topic_id) && $previous_topic_id > 0)
89
-			echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a>&nbsp;&nbsp;&nbsp;');
89
+			echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a>&nbsp;&nbsp;&nbsp;');
90 90
 		if (isset($up_topic_id) && $up_topic_id > 0)
91
-			echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a>&nbsp;&nbsp;&nbsp;');
91
+			echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a>&nbsp;&nbsp;&nbsp;');
92 92
 		if (isset($next_topic_id) && $next_topic_id > 0)
93
-			echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>');
93
+			echo ('<b>Next:</b> <a href="/manual.php?' . $next_topic_id . '">' . get_numbering($next_topic_id) . $next_topic . '</a>');
94 94
 		echo ('</tr>');
95 95
 
96 96
 		echo ('</table>');
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	$db = new SmrMySqlDatabase();
104 104
 
105 105
 	// get current entry
106
-	$db->query('SELECT * FROM manual WHERE topic_id = '.$topic_id);
106
+	$db->query('SELECT * FROM manual WHERE topic_id = ' . $topic_id);
107 107
 	if ($db->nextRecord()) {
108 108
 		$parent_topic_id = $db->getInt('parent_topic_id');
109 109
 		$order_id = $db->getInt('order_id');
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 		$text = stripslashes($db->getField('text'));
112 112
 
113 113
 		echo ('<div id="help_content">');
114
-		echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>');
115
-		echo ('<p>'.$text.'<p>');
114
+		echo ('<h1>' . get_numbering($topic_id) . $topic . '</h1>');
115
+		echo ('<p>' . $text . '<p>');
116 116
 		echo ('</div>');
117 117
 	} else
118 118
 		echo ('Invalid Topic!');
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 function echo_subsection($topic_id) {
122 122
 	// database object
123 123
 	$db = new SmrMySqlDatabase();
124
-	$return='';
124
+	$return = '';
125 125
 	// check if there are subsections
126
-	$db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id');
126
+	$db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id');
127 127
 	if ($db->getNumRows()) {
128 128
 		echo ('<hr noshade width="75%" size="1" class="center"/>');
129 129
 		echo ('<div id="help_menu">');
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
 }
138 138
 
139 139
 function echo_menu($topic_id) {
140
-	$return='';
140
+	$return = '';
141 141
 	// database object
142 142
 	$db = new SmrMySqlDatabase();
143 143
 
144
-	$db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id');
144
+	$db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id');
145 145
 	if ($db->getNumRows()) {
146 146
 		echo ('<ul type="disc">');
147
-		while($db->nextRecord()) {
147
+		while ($db->nextRecord()) {
148 148
 			$sub_topic_id = $db->getInt('topic_id');
149 149
 			$order_id = $db->getInt('order_id');
150 150
 			$sub_topic = stripslashes($db->getField('topic'));
151 151
 
152
-			echo ('<li><a href="/manual.php?'.$sub_topic_id.'">' . get_numbering($sub_topic_id) . $sub_topic.'</a></li>');
152
+			echo ('<li><a href="/manual.php?' . $sub_topic_id . '">' . get_numbering($sub_topic_id) . $sub_topic . '</a></li>');
153 153
 			echo_menu($sub_topic_id);
154 154
 		}
155 155
 		echo ('</ul>');
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 function get_numbering($topic_id) {
161 161
 	$db = new SmrMySqlDatabase();
162 162
 
163
-	$db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id));
163
+	$db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id));
164 164
 	if ($db->nextRecord()) {
165 165
 		$up_topic_id = $db->getInt('parent_topic_id');
166 166
 		$order_id = $db->getInt('order_id');
Please login to merge, or discard this patch.
admin/Default/game_delete_processing.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 	$game_id = $var['delete_game_id'];
22 22
 
23 23
 	if ($save) {
24
-		$db->query('SELECT * FROM alliance WHERE game_id = '.$db->escapeNumber($game_id));
24
+		$db->query('SELECT * FROM alliance WHERE game_id = ' . $db->escapeNumber($game_id));
25 25
 
26 26
 		while ($db->nextRecord()) {
27 27
 			$id = $db->getInt('alliance_id');
28 28
 			//we need info for forces
29 29
 			//populate alliance list
30 30
 			$db2->query('SELECT * FROM player
31
-						WHERE alliance_id = '.$db2->escapeNumber($id).'
31
+						WHERE alliance_id = '.$db2->escapeNumber($id) . '
32 32
 							AND game_id = '.$db2->escapeNumber($game_id));
33 33
 			$list = array(0);
34 34
 			while ($db2->nextRecord()) {
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 			}
37 37
 			$db2->query('SELECT sum(mines) as sum_m, sum(combat_drones) as cds, sum(scout_drones) as sds
38 38
 						FROM sector_has_forces
39
-						WHERE owner_id IN ('.$db2->escapeArray($list).') AND game_id = '.$db2->escapeNumber($game_id));
39
+						WHERE owner_id IN ('.$db2->escapeArray($list) . ') AND game_id = ' . $db2->escapeNumber($game_id));
40 40
 			if ($db2->nextRecord()) {
41 41
 
42 42
 				$mines = $db2->getInt('sum_m');
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 			$deaths = $db->getInt('alliance_deaths');
57 57
 			// insert into history db
58 58
 			$history_db_sql[] = 'INSERT INTO alliance (game_id, alliance_id, leader_id, kills, deaths, alliance_name, mines, cds, sds) ' .
59
-								'VALUES ('.$db->escapeNumber($game_id).', '.$db->escapeNumber($id).', '.$db->escapeNumber($leader).', '.$db->escapeNumber($kills).', '.$db->escapeNumber($deaths).', ' . $db->escapeString($name) . ', '.$db->escapeNumber($mines).', '.$db->escapeNumber($cds).', '.$db->escapeNumber($sds).')';
59
+								'VALUES (' . $db->escapeNumber($game_id) . ', ' . $db->escapeNumber($id) . ', ' . $db->escapeNumber($leader) . ', ' . $db->escapeNumber($kills) . ', ' . $db->escapeNumber($deaths) . ', ' . $db->escapeString($name) . ', ' . $db->escapeNumber($mines) . ', ' . $db->escapeNumber($cds) . ', ' . $db->escapeNumber($sds) . ')';
60 60
 
61 61
 		}
62 62
 
@@ -65,56 +65,56 @@  discard block
 block discarded – undo
65 65
 	// these table is nothing worth without the players
66 66
 	//$smr_db_sql[] = 'DELETE FROM account_has_logs WHERE game_id = '.$game_id;
67 67
 
68
-	$smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = '.$db->escapeNumber($game_id);
69
-	$smr_db_sql[] = 'DELETE FROM alliance WHERE game_id = '.$db->escapeNumber($game_id);
70
-	$smr_db_sql[] = 'DELETE FROM alliance_bank_transactions WHERE game_id = '.$db->escapeNumber($game_id);
71
-	$smr_db_sql[] = 'DELETE FROM alliance_has_roles WHERE game_id = '.$db->escapeNumber($game_id);
72
-	$smr_db_sql[] = 'DELETE FROM alliance_thread WHERE game_id = '.$db->escapeNumber($game_id);
73
-	$smr_db_sql[] = 'DELETE FROM alliance_thread_topic WHERE game_id = '.$db->escapeNumber($game_id);
68
+	$smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = ' . $db->escapeNumber($game_id);
69
+	$smr_db_sql[] = 'DELETE FROM alliance WHERE game_id = ' . $db->escapeNumber($game_id);
70
+	$smr_db_sql[] = 'DELETE FROM alliance_bank_transactions WHERE game_id = ' . $db->escapeNumber($game_id);
71
+	$smr_db_sql[] = 'DELETE FROM alliance_has_roles WHERE game_id = ' . $db->escapeNumber($game_id);
72
+	$smr_db_sql[] = 'DELETE FROM alliance_thread WHERE game_id = ' . $db->escapeNumber($game_id);
73
+	$smr_db_sql[] = 'DELETE FROM alliance_thread_topic WHERE game_id = ' . $db->escapeNumber($game_id);
74 74
 
75 75
 	if ($save) {
76 76
 
77
-		$db->query('SELECT * FROM alliance_vs_alliance WHERE game_id = '.$db->escapeNumber($game_id));
77
+		$db->query('SELECT * FROM alliance_vs_alliance WHERE game_id = ' . $db->escapeNumber($game_id));
78 78
 		while ($db->nextRecord()) {
79 79
 
80 80
 			$alliance_1 = $db->getInt('alliance_id_1');
81 81
 			$alliance_2 = $db->getInt('alliance_id_2');
82 82
 			$kills = $db->getInt('kills');
83 83
 			$history_db_sql[] = 'INSERT INTO alliance_vs_alliance (game_id, alliance_id_1, alliance_id_2, kills) ' .
84
-								'VALUES ('.$game_id.', '.$alliance_1.', '.$alliance_2.', '.$kills.')';
84
+								'VALUES (' . $game_id . ', ' . $alliance_1 . ', ' . $alliance_2 . ', ' . $kills . ')';
85 85
 
86 86
 		}
87 87
 
88 88
 	}
89 89
 
90 90
 
91
-	$smr_db_sql[] = 'DELETE FROM alliance_vs_alliance WHERE game_id = '.$db->escapeNumber($game_id);
92
-	$smr_db_sql[] = 'DELETE FROM anon_bank WHERE game_id = '.$db->escapeNumber($game_id);
93
-	$smr_db_sql[] = 'DELETE FROM anon_bank_transactions WHERE game_id = '.$db->escapeNumber($game_id);
94
-	$smr_db_sql[] = 'DELETE FROM bar_tender WHERE game_id = '.$db->escapeNumber($game_id);
95
-	$smr_db_sql[] = 'DELETE FROM blackjack WHERE game_id = '.$db->escapeNumber($game_id);
96
-	$smr_db_sql[] = 'DELETE FROM galactic_post_applications WHERE game_id = '.$db->escapeNumber($game_id);
97
-	$smr_db_sql[] = 'DELETE FROM galactic_post_article WHERE game_id = '.$db->escapeNumber($game_id);
98
-	$smr_db_sql[] = 'DELETE FROM galactic_post_paper WHERE game_id = '.$db->escapeNumber($game_id);
99
-	$smr_db_sql[] = 'DELETE FROM galactic_post_paper_content WHERE game_id = '.$db->escapeNumber($game_id);
100
-	$smr_db_sql[] = 'DELETE FROM galactic_post_writer WHERE game_id = '.$db->escapeNumber($game_id);
101
-	$smr_db_sql[] = 'DELETE FROM game_galaxy WHERE game_id = '.$db->escapeNumber($game_id);
91
+	$smr_db_sql[] = 'DELETE FROM alliance_vs_alliance WHERE game_id = ' . $db->escapeNumber($game_id);
92
+	$smr_db_sql[] = 'DELETE FROM anon_bank WHERE game_id = ' . $db->escapeNumber($game_id);
93
+	$smr_db_sql[] = 'DELETE FROM anon_bank_transactions WHERE game_id = ' . $db->escapeNumber($game_id);
94
+	$smr_db_sql[] = 'DELETE FROM bar_tender WHERE game_id = ' . $db->escapeNumber($game_id);
95
+	$smr_db_sql[] = 'DELETE FROM blackjack WHERE game_id = ' . $db->escapeNumber($game_id);
96
+	$smr_db_sql[] = 'DELETE FROM galactic_post_applications WHERE game_id = ' . $db->escapeNumber($game_id);
97
+	$smr_db_sql[] = 'DELETE FROM galactic_post_article WHERE game_id = ' . $db->escapeNumber($game_id);
98
+	$smr_db_sql[] = 'DELETE FROM galactic_post_paper WHERE game_id = ' . $db->escapeNumber($game_id);
99
+	$smr_db_sql[] = 'DELETE FROM galactic_post_paper_content WHERE game_id = ' . $db->escapeNumber($game_id);
100
+	$smr_db_sql[] = 'DELETE FROM galactic_post_writer WHERE game_id = ' . $db->escapeNumber($game_id);
101
+	$smr_db_sql[] = 'DELETE FROM game_galaxy WHERE game_id = ' . $db->escapeNumber($game_id);
102 102
 
103 103
 	if ($save) {
104 104
 		$game = SmrGame::getGame($game_id);
105 105
 		// insert into history db
106 106
 		$history_db_sql[] = 'INSERT INTO game (game_id, end_date, start_date, game_name, speed, type) VALUES ' .
107
-								'('.$db->escapeNumber($game_id).', '.$game->getEndTime().', '.$game->getStartTime().', ' . $db->escapeString($game->getGameName()) . ', '.$game->getGameSpeed().', '.$db->escapeString($game->getGameType()).')';
107
+								'(' . $db->escapeNumber($game_id) . ', ' . $game->getEndTime() . ', ' . $game->getStartTime() . ', ' . $db->escapeString($game->getGameName()) . ', ' . $game->getGameSpeed() . ', ' . $db->escapeString($game->getGameType()) . ')';
108 108
 	}
109 109
 
110
-	$smr_db_sql[] = 'DELETE FROM location WHERE game_id = '.$db->escapeNumber($game_id);
111
-	$smr_db_sql[] = 'DELETE FROM mb_exceptions WHERE value LIKE '.$db->escapeString($game_id.'%');
112
-	$smr_db_sql[] = 'DELETE FROM message WHERE game_id = '.$db->escapeNumber($game_id);
113
-	$smr_db_sql[] = 'DELETE FROM message_notify WHERE game_id = '.$db->escapeNumber($game_id);
110
+	$smr_db_sql[] = 'DELETE FROM location WHERE game_id = ' . $db->escapeNumber($game_id);
111
+	$smr_db_sql[] = 'DELETE FROM mb_exceptions WHERE value LIKE ' . $db->escapeString($game_id . '%');
112
+	$smr_db_sql[] = 'DELETE FROM message WHERE game_id = ' . $db->escapeNumber($game_id);
113
+	$smr_db_sql[] = 'DELETE FROM message_notify WHERE game_id = ' . $db->escapeNumber($game_id);
114 114
 
115 115
 	if ($save) {
116 116
 
117
-		$db->query('SELECT * FROM news WHERE game_id = '.$game_id.' AND type = \'regular\'');
117
+		$db->query('SELECT * FROM news WHERE game_id = ' . $game_id . ' AND type = \'regular\'');
118 118
 		$id = 1;
119 119
 
120 120
 		while ($db->nextRecord()) {
@@ -124,17 +124,17 @@  discard block
 block discarded – undo
124 124
 			$msg = $db->getField('news_message');
125 125
 
126 126
 			// insert into history db
127
-			$history_db_sql[] = 'INSERT INTO news (game_id, news_id, time, message) VALUES ('.$game_id.', '.$id.', '.$time.', ' . $db->escapeString($msg) . ')';
127
+			$history_db_sql[] = 'INSERT INTO news (game_id, news_id, time, message) VALUES (' . $game_id . ', ' . $id . ', ' . $time . ', ' . $db->escapeString($msg) . ')';
128 128
 			$id++;
129 129
 
130 130
 		}
131 131
 	}
132 132
 
133
-	$smr_db_sql[] = 'DELETE FROM news WHERE game_id = '.$db->escapeNumber($game_id);
133
+	$smr_db_sql[] = 'DELETE FROM news WHERE game_id = ' . $db->escapeNumber($game_id);
134 134
 
135 135
 	if ($save) {
136 136
 
137
-		$db->query('SELECT * FROM planet WHERE game_id = '.$db->escapeNumber($game_id));
137
+		$db->query('SELECT * FROM planet WHERE game_id = ' . $db->escapeNumber($game_id));
138 138
 
139 139
 		while ($db->nextRecord()) {
140 140
 
@@ -142,34 +142,34 @@  discard block
 block discarded – undo
142 142
 			$sector = $db->getInt('sector_id');
143 143
 			$owner = $db->getInt('owner_id');
144 144
 
145
-			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 1');
145
+			$db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 1');
146 146
 			if ($db2->nextRecord()) $gens = $db2->getInt('amount');
147 147
 			else $gens = 0;
148 148
 
149
-			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 2');
149
+			$db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 2');
150 150
 			if ($db2->nextRecord()) $hangs = $db2->getInt('amount');
151 151
 			else $hangs = 0;
152 152
 
153
-			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 3');
153
+			$db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 3');
154 154
 			if ($db2->nextRecord()) $turs = $db2->getInt('amount');
155 155
 			else $turs = 0;
156 156
 
157 157
 			// insert into history db
158 158
 			$history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' .
159
-								'('.$game_id.', '.$sector.', '.$owner.', '.$gens.', '.$hangs.', '.$turs.')';
159
+								'(' . $game_id . ', ' . $sector . ', ' . $owner . ', ' . $gens . ', ' . $hangs . ', ' . $turs . ')';
160 160
 
161 161
 		}
162 162
 
163 163
 	}
164 164
 
165
-	$smr_db_sql[] = 'DELETE FROM planet WHERE game_id = '.$db->escapeNumber($game_id);
166
-	$smr_db_sql[] = 'DELETE FROM planet_is_building WHERE game_id = '.$db->escapeNumber($game_id);
167
-	$smr_db_sql[] = 'DELETE FROM planet_has_cargo WHERE game_id = '.$db->escapeNumber($game_id);
168
-	$smr_db_sql[] = 'DELETE FROM planet_has_building WHERE game_id = '.$db->escapeNumber($game_id);
165
+	$smr_db_sql[] = 'DELETE FROM planet WHERE game_id = ' . $db->escapeNumber($game_id);
166
+	$smr_db_sql[] = 'DELETE FROM planet_is_building WHERE game_id = ' . $db->escapeNumber($game_id);
167
+	$smr_db_sql[] = 'DELETE FROM planet_has_cargo WHERE game_id = ' . $db->escapeNumber($game_id);
168
+	$smr_db_sql[] = 'DELETE FROM planet_has_building WHERE game_id = ' . $db->escapeNumber($game_id);
169 169
 
170 170
 	if ($save) {
171 171
 
172
-		$db->query('SELECT * FROM player WHERE game_id = '.$game_id);
172
+		$db->query('SELECT * FROM player WHERE game_id = ' . $game_id);
173 173
 
174 174
 		while ($db->nextRecord()) {
175 175
 
@@ -187,48 +187,48 @@  discard block
 block discarded – undo
187 187
 
188 188
 			$amount = 0;
189 189
 			$smrCredits = 0;
190
-			$db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = '.$game_id.' AND account_id = '.$acc_id.' AND claimer_id = 0');
190
+			$db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = ' . $game_id . ' AND account_id = ' . $acc_id . ' AND claimer_id = 0');
191 191
 			if ($db2->nextRecord()) {
192 192
 				if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am');
193 193
 				if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred');
194 194
 
195 195
 			}
196 196
 
197
-			$db2->query('SELECT * FROM ship_has_name WHERE game_id = '.$game_id.' AND account_id = '.$acc_id);
197
+			$db2->query('SELECT * FROM ship_has_name WHERE game_id = ' . $game_id . ' AND account_id = ' . $acc_id);
198 198
 			if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name');
199 199
 			else $ship_name = 'None';
200 200
 
201 201
 			// insert into history db
202 202
 			$history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' .
203
-								'VALUES ('.$acc_id.', '.$game_id.', ' . $db->escapeString($name) . ', '.$id.', '.$exp.', '.$ship.', '.$race.', '.$align.', '.$alli.', '.$kills.', '.$deaths.', '.$amount.','.$smrCredits.', ' . $db->escapeString($ship_name) . ')';
203
+								'VALUES (' . $acc_id . ', ' . $game_id . ', ' . $db->escapeString($name) . ', ' . $id . ', ' . $exp . ', ' . $ship . ', ' . $race . ', ' . $align . ', ' . $alli . ', ' . $kills . ', ' . $deaths . ', ' . $amount . ',' . $smrCredits . ', ' . $db->escapeString($ship_name) . ')';
204 204
 
205 205
 		}
206 206
 
207 207
 	}
208 208
 
209
-	$smr_db_sql[] = 'DELETE FROM player WHERE game_id = '.$db->escapeNumber($game_id);
210
-	$smr_db_sql[] = 'DELETE FROM bounty WHERE game_id = '.$db->escapeNumber($game_id);
211
-	$smr_db_sql[] = 'DELETE FROM player_has_ticker WHERE game_id = '.$db->escapeNumber($game_id);
212
-	$smr_db_sql[] = 'DELETE FROM player_has_ticket WHERE game_id = '.$db->escapeNumber($game_id);
213
-	$smr_db_sql[] = 'DELETE FROM player_has_alliance_role WHERE game_id = '.$db->escapeNumber($game_id);
214
-	$smr_db_sql[] = 'DELETE FROM player_has_drinks WHERE game_id = '.$db->escapeNumber($game_id);
215
-	$smr_db_sql[] = 'DELETE FROM player_has_relation WHERE game_id = '.$db->escapeNumber($game_id);
216
-	$smr_db_sql[] = 'DELETE FROM player_has_unread_messages WHERE game_id = '.$db->escapeNumber($game_id);
217
-	$smr_db_sql[] = 'DELETE FROM player_plotted_course WHERE game_id = '.$db->escapeNumber($game_id);
218
-	$smr_db_sql[] = 'DELETE FROM player_read_thread WHERE game_id = '.$db->escapeNumber($game_id);
219
-	$smr_db_sql[] = 'DELETE FROM player_visited_port WHERE game_id = '.$db->escapeNumber($game_id);
220
-	$smr_db_sql[] = 'DELETE FROM player_visited_sector WHERE game_id = '.$db->escapeNumber($game_id);
221
-	$smr_db_sql[] = 'DELETE FROM player_votes_pact WHERE game_id = '.$db->escapeNumber($game_id);
222
-	$smr_db_sql[] = 'DELETE FROM player_votes_relation WHERE game_id = '.$db->escapeNumber($game_id);
223
-	$smr_db_sql[] = 'DELETE FROM plot_cache WHERE game_id = '.$db->escapeNumber($game_id);
224
-	$smr_db_sql[] = 'DELETE FROM port WHERE game_id = '.$db->escapeNumber($game_id);
225
-	$smr_db_sql[] = 'DELETE FROM port_has_goods WHERE game_id = '.$db->escapeNumber($game_id);
226
-	$smr_db_sql[] = 'DELETE FROM race_has_relation WHERE game_id = '.$db->escapeNumber($game_id);
227
-	$smr_db_sql[] = 'DELETE FROM race_has_voting WHERE game_id = '.$db->escapeNumber($game_id);
209
+	$smr_db_sql[] = 'DELETE FROM player WHERE game_id = ' . $db->escapeNumber($game_id);
210
+	$smr_db_sql[] = 'DELETE FROM bounty WHERE game_id = ' . $db->escapeNumber($game_id);
211
+	$smr_db_sql[] = 'DELETE FROM player_has_ticker WHERE game_id = ' . $db->escapeNumber($game_id);
212
+	$smr_db_sql[] = 'DELETE FROM player_has_ticket WHERE game_id = ' . $db->escapeNumber($game_id);
213
+	$smr_db_sql[] = 'DELETE FROM player_has_alliance_role WHERE game_id = ' . $db->escapeNumber($game_id);
214
+	$smr_db_sql[] = 'DELETE FROM player_has_drinks WHERE game_id = ' . $db->escapeNumber($game_id);
215
+	$smr_db_sql[] = 'DELETE FROM player_has_relation WHERE game_id = ' . $db->escapeNumber($game_id);
216
+	$smr_db_sql[] = 'DELETE FROM player_has_unread_messages WHERE game_id = ' . $db->escapeNumber($game_id);
217
+	$smr_db_sql[] = 'DELETE FROM player_plotted_course WHERE game_id = ' . $db->escapeNumber($game_id);
218
+	$smr_db_sql[] = 'DELETE FROM player_read_thread WHERE game_id = ' . $db->escapeNumber($game_id);
219
+	$smr_db_sql[] = 'DELETE FROM player_visited_port WHERE game_id = ' . $db->escapeNumber($game_id);
220
+	$smr_db_sql[] = 'DELETE FROM player_visited_sector WHERE game_id = ' . $db->escapeNumber($game_id);
221
+	$smr_db_sql[] = 'DELETE FROM player_votes_pact WHERE game_id = ' . $db->escapeNumber($game_id);
222
+	$smr_db_sql[] = 'DELETE FROM player_votes_relation WHERE game_id = ' . $db->escapeNumber($game_id);
223
+	$smr_db_sql[] = 'DELETE FROM plot_cache WHERE game_id = ' . $db->escapeNumber($game_id);
224
+	$smr_db_sql[] = 'DELETE FROM port WHERE game_id = ' . $db->escapeNumber($game_id);
225
+	$smr_db_sql[] = 'DELETE FROM port_has_goods WHERE game_id = ' . $db->escapeNumber($game_id);
226
+	$smr_db_sql[] = 'DELETE FROM race_has_relation WHERE game_id = ' . $db->escapeNumber($game_id);
227
+	$smr_db_sql[] = 'DELETE FROM race_has_voting WHERE game_id = ' . $db->escapeNumber($game_id);
228 228
 
229 229
 	if ($save) {
230 230
 
231
-		$db->query('SELECT * FROM sector WHERE game_id = '.$game_id);
231
+		$db->query('SELECT * FROM sector WHERE game_id = ' . $game_id);
232 232
 
233 233
 		while ($db->nextRecord()) {
234 234
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 			$gal_id = $db->getInt('galaxy_id');
239 239
 
240 240
 			$db2->query('SELECT sum(mines) as sum_mines, sum(combat_drones) as cds, sum(scout_drones) as sds FROM sector_has_forces ' .
241
-						'WHERE sector_id = '.$sector.' AND game_id = '.$game_id.' GROUP BY sector_id');
241
+						'WHERE sector_id = ' . $sector . ' AND game_id = ' . $game_id . ' GROUP BY sector_id');
242 242
 			if ($db2->nextRecord()) {
243 243
 
244 244
 				$mines = $db2->getInt('sum_mines');
@@ -258,32 +258,32 @@  discard block
 block discarded – undo
258 258
 
259 259
 			// insert into history db
260 260
 			$history_db_sql[] = 'INSERT INTO sector (game_id, sector_id, gal_id, mines, kills, combat, scouts) ' .
261
-								'VALUES ('.$game_id.','. $sector.','. $gal_id.','. $mines.','. $kills.','. $cds.','. $sds.')';
261
+								'VALUES (' . $game_id . ',' . $sector . ',' . $gal_id . ',' . $mines . ',' . $kills . ',' . $cds . ',' . $sds . ')';
262 262
 
263 263
 		}
264 264
 
265 265
 	}
266 266
 
267
-	$smr_db_sql[] = 'DELETE FROM sector WHERE game_id = '.$game_id;
268
-	$smr_db_sql[] = 'DELETE FROM sector_has_forces WHERE game_id = '.$game_id;
269
-	$smr_db_sql[] = 'DELETE FROM ship_has_cargo WHERE game_id = '.$game_id;
270
-	$smr_db_sql[] = 'DELETE FROM ship_has_hardware WHERE game_id = '.$game_id;
271
-	$smr_db_sql[] = 'DELETE FROM ship_has_name WHERE game_id = '.$game_id;
272
-	$smr_db_sql[] = 'DELETE FROM ship_has_illusion WHERE game_id = '.$game_id;
273
-	$smr_db_sql[] = 'DELETE FROM ship_has_weapon WHERE game_id = '.$game_id;
274
-	$smr_db_sql[] = 'DELETE FROM ship_is_cloaked WHERE game_id = '.$game_id;
275
-	$smr_db_sql[] = 'UPDATE game SET end_time='.TIME.' WHERE game_id = '.$game_id.' AND end_time > '.TIME; // Do not delete game placeholder, just make sure game is finished
276
-	$smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = '.$game_id;
267
+	$smr_db_sql[] = 'DELETE FROM sector WHERE game_id = ' . $game_id;
268
+	$smr_db_sql[] = 'DELETE FROM sector_has_forces WHERE game_id = ' . $game_id;
269
+	$smr_db_sql[] = 'DELETE FROM ship_has_cargo WHERE game_id = ' . $game_id;
270
+	$smr_db_sql[] = 'DELETE FROM ship_has_hardware WHERE game_id = ' . $game_id;
271
+	$smr_db_sql[] = 'DELETE FROM ship_has_name WHERE game_id = ' . $game_id;
272
+	$smr_db_sql[] = 'DELETE FROM ship_has_illusion WHERE game_id = ' . $game_id;
273
+	$smr_db_sql[] = 'DELETE FROM ship_has_weapon WHERE game_id = ' . $game_id;
274
+	$smr_db_sql[] = 'DELETE FROM ship_is_cloaked WHERE game_id = ' . $game_id;
275
+	$smr_db_sql[] = 'UPDATE game SET end_time=' . TIME . ' WHERE game_id = ' . $game_id . ' AND end_time > ' . TIME; // Do not delete game placeholder, just make sure game is finished
276
+	$smr_db_sql[] = 'UPDATE active_session SET game_id = 0 WHERE game_id = ' . $game_id;
277 277
 
278 278
 	// now do the sql stuff
279
-	foreach($smr_db_sql as $sql) {
279
+	foreach ($smr_db_sql as $sql) {
280 280
 
281 281
 		$db->query($sql);
282 282
 
283 283
 	}
284 284
 
285 285
 	$db = new SmrHistoryMySqlDatabase();
286
-	foreach($history_db_sql as $sql) {
286
+	foreach ($history_db_sql as $sql) {
287 287
 
288 288
 		$db->query($sql);
289 289
 
Please login to merge, or discard this patch.