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

Passed
Pull Request — master (#1004)
by Dan
06:40
created
src/tools/npc/npc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		}
120 120
 
121 121
 		try {
122
-			$TRADE_ROUTE =& $GLOBALS['TRADE_ROUTE'];
122
+			$TRADE_ROUTE = & $GLOBALS['TRADE_ROUTE'];
123 123
 			debug('Action #' . $actions);
124 124
 
125 125
 			//We have to reload player on each loop
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
 			}
139 139
 
140 140
 			if (!isset($TRADE_ROUTE)) { //We only want to change trade route if there isn't already one set.
141
-				$TRADE_ROUTES =& findRoutes($player);
142
-				$TRADE_ROUTE =& changeRoute($TRADE_ROUTES);
141
+				$TRADE_ROUTES = & findRoutes($player);
142
+				$TRADE_ROUTE = & changeRoute($TRADE_ROUTES);
143 143
 			}
144 144
 
145 145
 			if ($player->isDead()) {
146 146
 				debug('Some evil person killed us, let\'s move on now.');
147 147
 				$previousContainer = null; //We died, we don't care what we were doing beforehand.
148
-				$TRADE_ROUTE =& changeRoute($TRADE_ROUTES); //Change route
148
+				$TRADE_ROUTE = & changeRoute($TRADE_ROUTES); //Change route
149 149
 				processContainer(create_container('death_processing.php'));
150 150
 			}
151 151
 			if ($player->getNewbieTurns() <= NEWBIE_TURNS_WARNING_LIMIT && $player->getNewbieWarning()) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 								processContainer(tradeGoods($goodID, $player, $port));
228 228
 							} else {
229 229
 								//Move to next route or fed.
230
-								if (($TRADE_ROUTE =& changeRoute($TRADE_ROUTES)) === false) {
230
+								if (($TRADE_ROUTE = & changeRoute($TRADE_ROUTES)) === false) {
231 231
 									debug('Changing Route Failed');
232 232
 									processContainer(plotToFed($player));
233 233
 								} else {
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 							processContainer(tradeGoods($goodID, $player, $port));
255 255
 						} else {
256 256
 							//Move to next route or fed.
257
-							if (($TRADE_ROUTE =& changeRoute($TRADE_ROUTES)) === false) {
257
+							if (($TRADE_ROUTE = & changeRoute($TRADE_ROUTES)) === false) {
258 258
 								debug('Changing Route Failed');
259 259
 								processContainer(plotToFed($player));
260 260
 							} else {
@@ -586,9 +586,9 @@  discard block
 block discarded – undo
586 586
 		return $false;
587 587
 	}
588 588
 	$routeKey = array_rand($tradeRoutes);
589
-	$tradeRoute =& $tradeRoutes[$routeKey];
589
+	$tradeRoute = & $tradeRoutes[$routeKey];
590 590
 	unset($tradeRoutes[$routeKey]);
591
-	$GLOBALS['TRADE_ROUTE'] =& $tradeRoute;
591
+	$GLOBALS['TRADE_ROUTE'] = & $tradeRoute;
592 592
 	debug('Switched route', $tradeRoute);
593 593
 	return $tradeRoute;
594 594
 }
Please login to merge, or discard this patch.
src/lib/Default/SmrWeapon.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 			// If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods.
198 198
 			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
199 199
 		}
200
-		$damage =& $this->getModifiedDamage();
200
+		$damage = & $this->getModifiedDamage();
201 201
 		return $damage;
202 202
 	}
203 203
 	
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 			// If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods.
207 207
 			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
208 208
 		}
209
-		$damage =& $this->getModifiedDamage();
209
+		$damage = & $this->getModifiedDamage();
210 210
 		return $damage;
211 211
 	}
212 212
 	
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 			// If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods.
216 216
 			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
217 217
 		}
218
-		$damage =& $this->getModifiedDamage();
218
+		$damage = & $this->getModifiedDamage();
219 219
 		
220 220
 		$planetMod = self::PLANET_DAMAGE_MOD;
221 221
 		$damage['MaxDamage'] = ICeil($damage['MaxDamage'] * $planetMod);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
236 236
 			return $return;
237 237
 		}
238
-		$damage =& $this->getModifiedDamage();
238
+		$damage = & $this->getModifiedDamage();
239 239
 		return $damage;
240 240
 	}
241 241
 	
Please login to merge, or discard this patch.
src/lib/Default/SmrCombatDrones.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			// If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods.
133 133
 			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
134 134
 		}
135
-		$damage =& $this->getModifiedDamage();
135
+		$damage = & $this->getModifiedDamage();
136 136
 		$damage['Launched'] = ICeil($this->getNumberOfCDs() * $this->getModifiedAccuracyAgainstForces($weaponPlayer, $forces) / 100);
137 137
 		$damage['Kamikaze'] = 0;
138 138
 		if ($weaponPlayer->isCombatDronesKamikazeOnMines()) { // If kamikaze then damage is same as MINE_ARMOUR
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 			// If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods.
157 157
 			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
158 158
 		}
159
-		$damage =& $this->getModifiedDamage();
159
+		$damage = & $this->getModifiedDamage();
160 160
 		$damage['Launched'] = ICeil($this->getNumberOfCDs() * $this->getModifiedAccuracyAgainstPort($weaponPlayer, $port) / 100);
161 161
 		$damage['MaxDamage'] = ICeil($damage['Launched'] * $damage['MaxDamage']);
162 162
 		$damage['Shield'] = ICeil($damage['Launched'] * $damage['Shield']);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 			// If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods.
171 171
 			return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
172 172
 		}
173
-		$damage =& $this->getModifiedDamage();
173
+		$damage = & $this->getModifiedDamage();
174 174
 		$damage['Launched'] = ICeil($this->getNumberOfCDs() * $this->getModifiedAccuracyAgainstPlanet($weaponPlayer, $planet) / 100);
175 175
 		$planetMod = self::PLANET_DAMAGE_MOD;
176 176
 		$damage['MaxDamage'] = ICeil($damage['Launched'] * $damage['MaxDamage'] * $planetMod);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
186 186
 			return $return;
187 187
 		}
188
-		$damage =& $this->getModifiedDamage();
188
+		$damage = & $this->getModifiedDamage();
189 189
 		if ($targetPlayer->getShip()->hasDCS()) {
190 190
 			$damage['MaxDamage'] *= DCS_PLAYER_DAMAGE_DECIMAL_PERCENT;
191 191
 			$damage['Shield'] *= DCS_PLAYER_DAMAGE_DECIMAL_PERCENT;
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
204 204
 			return $return;
205 205
 		}
206
-		$damage =& $this->getModifiedDamage();
206
+		$damage = & $this->getModifiedDamage();
207 207
 		
208 208
 		if ($targetPlayer->getShip()->hasDCS()) {
209 209
 			$damage['MaxDamage'] *= DCS_FORCE_DAMAGE_DECIMAL_PERCENT;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
224 224
 			return $return;
225 225
 		}
226
-		$damage =& $this->getModifiedDamage();
226
+		$damage = & $this->getModifiedDamage();
227 227
 		
228 228
 		if ($targetPlayer->getShip()->hasDCS()) {
229 229
 			$damage['MaxDamage'] *= DCS_PORT_DAMAGE_DECIMAL_PERCENT;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
243 243
 			return $return;
244 244
 		}
245
-		$damage =& $this->getModifiedDamage();
245
+		$damage = & $this->getModifiedDamage();
246 246
 		
247 247
 		if ($targetPlayer->getShip()->hasDCS()) {
248 248
 			$damage['MaxDamage'] *= DCS_PLANET_DAMAGE_DECIMAL_PERCENT;
Please login to merge, or discard this patch.
src/lib/Default/SmrScoutDrones.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 			$return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover());
81 81
 			return $return;
82 82
 		}
83
-		$damage =& $this->getModifiedDamage();
83
+		$damage = & $this->getModifiedDamage();
84 84
 		$damage['Launched'] = ICeil($this->getNumberOfSDs() * $this->getModifiedForceAccuracyAgainstPlayer($forces, $targetPlayer) / 100);
85 85
 		$damage['MaxDamage'] = ICeil($damage['Launched'] * $damage['MaxDamage']);
86 86
 		$damage['Shield'] = ICeil($damage['Launched'] * $damage['Shield']);
Please login to merge, or discard this patch.
src/lib/Default/AbstractMenu.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$menuItems[] = array('Link'=>Globals::getPlanetListHREF($alliance_id), 'Text'=>'Defense');
13 13
 		$menuItems[] = array('Link'=>Globals::getPlanetListFinancialHREF($alliance_id), 'Text'=>'Financial');
14 14
 		// make the selected index bold
15
-		$boldItem =& $menuItems[$selected_index]['Text'];
15
+		$boldItem = & $menuItems[$selected_index]['Text'];
16 16
 		$boldItem = '<span class="bold">' . $boldItem . '</span>';
17 17
 		$template->assign('MenuItems', $menuItems);
18 18
 	}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$menuItems[] = ['Link' => SmrSession::getNewHREF($container),
108 108
 		                'Text' => 'Game News'];
109 109
 		// make the selected index bold
110
-		$boldItem =& $menuItems[$selected_index]['Text'];
110
+		$boldItem = & $menuItems[$selected_index]['Text'];
111 111
 		$boldItem = '<b>' . $boldItem . '</b>';
112 112
 		$template->assign('MenuItems', $menuItems);
113 113
 	}
Please login to merge, or discard this patch.
src/lib/Default/MySqlDatabase.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	}
39 39
 
40 40
 	public static function mysqliFactory(MySqlProperties $mysqlProperties): mysqli {
41
-		if (!mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT)) {
41
+		if (!mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT)) {
42 42
 			throw new RuntimeException('Failed to enable mysqli error reporting');
43 43
 		}
44 44
 		$mysql = new mysqli(
Please login to merge, or discard this patch.
src/lib/Default/DummyPlayer.class.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  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
 		$this->accountID				= 0;
6
-		$this->gameID					= (int) $gameID;
7
-		$this->playerName				= (string) $playerName;
6
+		$this->gameID = (int)$gameID;
7
+		$this->playerName = (string)$playerName;
8 8
 		$this->playerID					= 0;
9 9
 		$this->sectorID					= 0;
10
-		$this->lastSectorID				= 0;
10
+		$this->lastSectorID = 0;
11 11
 		$this->turns					= 1000;
12
-		$this->newbieTurns				= 0;
12
+		$this->newbieTurns = 0;
13 13
 		$this->lastNewsUpdate			= 0;
14 14
 		$this->dead						= false;
15 15
 		$this->landedOnPlanet			= false;
16
-		$this->lastActive				= 0;
17
-		$this->lastCPLAction			= 0;
18
-		$this->raceID					= (int) $raceID;
19
-		$this->credits					= 0;
20
-		$this->experience				= (int) $experience;
21
-		$this->alignment				= (int) $alignment;
22
-		$this->militaryPayment			= 0;
23
-		$this->allianceID				= (int) $allianceID;
24
-		$this->shipID					= (int) $shipTypeID;
16
+		$this->lastActive = 0;
17
+		$this->lastCPLAction = 0;
18
+		$this->raceID = (int)$raceID;
19
+		$this->credits = 0;
20
+		$this->experience				= (int)$experience;
21
+		$this->alignment = (int)$alignment;
22
+		$this->militaryPayment = 0;
23
+		$this->allianceID				= (int)$allianceID;
24
+		$this->shipID					= (int)$shipTypeID;
25 25
 		$this->kills					= 0;
26 26
 		$this->deaths					= 0;
27
-		$this->lastPort					= 0;
27
+		$this->lastPort = 0;
28 28
 		$this->bank						= 0;
29 29
 		$this->zoom						= 0;
30 30
 
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function setAllianceID($ID) {
51
-		if($this->allianceID == $ID)
51
+		if ($this->allianceID == $ID)
52 52
 			return;
53
-		$this->allianceID=$ID;
53
+		$this->allianceID = $ID;
54 54
 	}
55 55
 
56 56
 	public function &killPlayerByPlayer(AbstractSmrPlayer $killer) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$db = MySqlDatabase::getInstance();
77 77
 		$db->query('REPLACE INTO cached_dummys ' .
78 78
 					'(type, id, info) ' .
79
-					'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeString($cache).')');
79
+					'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeString($cache) . ')');
80 80
 		 unserialize($cache);
81 81
 	}
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$db->query('SELECT info FROM cached_dummys
86 86
 					WHERE type = \'DummyPlayer\'
87 87
 						AND id = ' . $db->escapeString($name) . ' LIMIT 1');
88
-		if($db->nextRecord()) {
88
+		if ($db->nextRecord()) {
89 89
 			$return = unserialize($db->getField('info'));
90 90
 			return $return;
91 91
 		}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$db->query('SELECT id FROM cached_dummys
101 101
 					WHERE type = \'DummyPlayer\'');
102 102
 		$dummyNames = array();
103
-		while($db->nextRecord()) {
103
+		while ($db->nextRecord()) {
104 104
 			$dummyNames[] = $db->getField('id');
105 105
 		}
106 106
 		return $dummyNames;
Please login to merge, or discard this patch.
src/tools/discord/GameLink.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 // Holds information linking the received message and the game data
4 4
 class GameLink
5 5
 {
6
-	public $valid = false;  // identifies if the message is linked to game data
7
-	public $account;        // SmrAccount instance
8
-	public $alliance;       // SmrAlliance instance
9
-	public $player;         // SmrPlayer instance
6
+	public $valid = false; // identifies if the message is linked to game data
7
+	public $account; // SmrAccount instance
8
+	public $alliance; // SmrAlliance instance
9
+	public $player; // SmrPlayer instance
10 10
 
11 11
 	// $author can be either Discord\Parts\User\{User,Member}
12 12
 	function __construct(Discord\Parts\Channel\Channel $channel, $author) {
Please login to merge, or discard this patch.
src/lib/Default/help.inc.php 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 = MySqlDatabase::getInstance();
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 = MySqlDatabase::getInstance();
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 = MySqlDatabase::getInstance();
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 = MySqlDatabase::getInstance();
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 = MySqlDatabase::getInstance();
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.