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
Branch master (0a752f)
by Dan
03:57
created
engine/Default/hall_of_fame_player_detail.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@
 block discarded – undo
20 20
 const USER_SCORE_NAME = 'User Score';
21 21
 $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true);
22 22
 while ($db->nextRecord()) {
23
-	$hof =& $hofTypes;
23
+	$hof = & $hofTypes;
24 24
 	$typeList = explode(':', $db->getField('type'));
25 25
 	foreach ($typeList as $type) {
26 26
 		if (!isset($hof[$type])) {
27 27
 			$hof[$type] = array();
28 28
 		}
29
-		$hof =& $hof[$type];
29
+		$hof = & $hof[$type];
30 30
 	}
31 31
 	$hof = true;
32 32
 }
Please login to merge, or discard this patch.
lib/Default/smr.inc 1 patch
Braces   +80 added lines, -58 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@  discard block
 block discarded – undo
8 8
 
9 9
 function parseBoolean($check) {
10 10
 	// Only negative strings are not implicitly converted to the correct bool
11
-	if (is_string($check) && (strcasecmp($check, 'NO') == 0 || strcasecmp($check, 'FALSE') == 0))
12
-		return false;
11
+	if (is_string($check) && (strcasecmp($check, 'NO') == 0 || strcasecmp($check, 'FALSE') == 0)) {
12
+			return false;
13
+	}
13 14
 	return (bool)$check;
14 15
 }
15 16
 
@@ -32,8 +33,9 @@  discard block
 block discarded – undo
32 33
 			break;
33 34
 			case 'player':
34 35
 				$playerID = $default;
35
-				if (!is_numeric($playerID))
36
-					$playerID = $tagParams['id'];
36
+				if (!is_numeric($playerID)) {
37
+									$playerID = $tagParams['id'];
38
+				}
37 39
 				$bbPlayer = SmrPlayer::getPlayerByPlayerID($playerID, $overrideGameID);
38 40
 				if ($action == \Nbbc\BBCode::BBCODE_CHECK) {
39 41
 					return true;
@@ -46,8 +48,9 @@  discard block
 block discarded – undo
46 48
 			break;
47 49
 			case 'alliance':
48 50
 				$allianceID = $default;
49
-				if (!is_numeric($allianceID))
50
-					$allianceID = $tagParams['id'];
51
+				if (!is_numeric($allianceID)) {
52
+									$allianceID = $tagParams['id'];
53
+				}
51 54
 				$alliance = SmrAlliance::getAlliance($allianceID, $overrideGameID);
52 55
 				if ($action == \Nbbc\BBCode::BBCODE_CHECK) {
53 56
 					return true;
@@ -56,10 +59,11 @@  discard block
 block discarded – undo
56 59
 				if ($disableBBLinks === false && $overrideGameID == SmrSession::getGameID()) {
57 60
 					$container = create_container('skeleton.php');
58 61
 					$container['alliance_id'] = $alliance->getAllianceID();
59
-					if (is_object($player) && $alliance->getAllianceID() == $player->getAllianceID())
60
-						$container['body'] = 'alliance_mod.php';
61
-					else
62
-						$container['body'] = 'alliance_roster.php';
62
+					if (is_object($player) && $alliance->getAllianceID() == $player->getAllianceID()) {
63
+											$container['body'] = 'alliance_mod.php';
64
+					} else {
65
+											$container['body'] = 'alliance_roster.php';
66
+					}
63 67
 					return create_link($container, $alliance->getAllianceName());
64 68
 				}
65 69
 				return $alliance->getAllianceName();
@@ -83,8 +87,9 @@  discard block
 block discarded – undo
83 87
 					return true;
84 88
 				}
85 89
 				if ($timeString != '' && ($time = strtotime($timeString)) !== false) {
86
-					if (is_object($account))
87
-						$time += $account->getOffset() * 3600;
90
+					if (is_object($account)) {
91
+											$time += $account->getOffset() * 3600;
92
+					}
88 93
 					return date(DATE_FULL_SHORT, $time);
89 94
 				}
90 95
 			break;
@@ -127,8 +132,7 @@  discard block
 block discarded – undo
127 132
 				return '<div class="buttonA"><a class="buttonA" href="' . SmrSession::getNewHREF($container) . '">Join ' . $alliance->getAllianceName() . '</a></div>';
128 133
 			break;
129 134
 		}
130
-	}
131
-	catch (Exception $e) {
135
+	} catch (Exception $e) {
132 136
 	}
133 137
 	if ($action == \Nbbc\BBCode::BBCODE_CHECK) {
134 138
 		return false;
@@ -173,15 +177,15 @@  discard block
 block discarded – undo
173 177
 		$bbParser->addRule('join_alliance', $smrRule);
174 178
 	}
175 179
 	global $disableBBLinks;
176
-	if ($noLinks === true)
177
-		$disableBBLinks = true;
178
-	else
179
-		$disableBBLinks = false;
180
+	if ($noLinks === true) {
181
+			$disableBBLinks = true;
182
+	} else {
183
+			$disableBBLinks = false;
184
+	}
180 185
 	if (strpos($message, '[') !== false) { //We have BBCode so let's do a full parse.
181 186
 		$message = $bbParser->parse($message);
182 187
 		$message = str_replace('&lt;br /&gt;', '<br />', $message);
183
-	}
184
-	else { //Otherwise just convert newlines
188
+	} else { //Otherwise just convert newlines
185 189
 		$message = nl2br($message, true);
186 190
 	}
187 191
 	return $message;
@@ -221,8 +225,7 @@  discard block
 block discarded – undo
221 225
 
222 226
 	if (!is_array($actions)) {
223 227
 		$form['submit'] = '<input class="submit" type="submit" name="action" value="' . htmlspecialchars($actions) . '">';
224
-	}
225
-	else {
228
+	} else {
226 229
 		$form['submit'] = array();
227 230
 		foreach ($actions as $action) {
228 231
 			$form['submit'][$action[0]] = '<input class="submit" type="submit" name="action" value="' . htmlspecialchars($action[1]) . '">';
@@ -267,8 +270,9 @@  discard block
 block discarded – undo
267 270
 }
268 271
 
269 272
 function forward($new_container) {
270
-	if (defined('OVERRIDE_FORWARD') && OVERRIDE_FORWARD === true)
271
-		return overrideForward($new_container);
273
+	if (defined('OVERRIDE_FORWARD') && OVERRIDE_FORWARD === true) {
274
+			return overrideForward($new_container);
275
+	}
272 276
 	resetContainer($new_container);
273 277
 	do_voodoo();
274 278
 }
@@ -284,8 +288,9 @@  discard block
 block discarded – undo
284 288
 	global $var, $container;
285 289
 
286 290
 	// transfer this value to next container
287
-	if (isset($var[$what]))
288
-		$container[$what] = $var[$what];
291
+	if (isset($var[$what])) {
292
+			$container[$what] = $var[$what];
293
+	}
289 294
 
290 295
 }
291 296
 
@@ -313,8 +318,7 @@  discard block
 block discarded – undo
313 318
 	}
314 319
 	if ($maxValue - $minValue == 0) {
315 320
 		return $text;
316
-	}
317
-	else {
321
+	} else {
318 322
 		$normalisedValue = round(510 * max(0, min($maxValue, $value) - $minValue) / ($maxValue - $minValue)) - 255;
319 323
 	}
320 324
 	if ($type == 'Game') {
@@ -324,28 +328,33 @@  discard block
 block discarded – undo
324 328
 			if (strlen($g_component) == 1) {
325 329
 				$g_component = '0' . $g_component;
326 330
 			}
327
-		}
328
-		else if ($normalisedValue > 0) {
331
+		} else if ($normalisedValue > 0) {
329 332
 			$g_component = 'ff';
330 333
 			$r_component = dechex(255 - $normalisedValue);
331 334
 			if (strlen($r_component) == 1) {
332 335
 				$r_component = '0' . $r_component;
333 336
 			}
334
-		}
335
-		else {
337
+		} else {
336 338
 			$r_component = 'ff';
337 339
 			$g_component = 'ff';
338 340
 		}
339 341
 		$colour = $r_component . $g_component . '00';
340
-		if ($return_type == 'Colour') return $colour;
342
+		if ($return_type == 'Colour') {
343
+			return $colour;
344
+		}
341 345
 		return '<span style="color:#' . $colour . '">' . $text . '</span>';
342
-	}
343
-	elseif ($type == 'IRC') {
346
+	} elseif ($type == 'IRC') {
344 347
 		//IRC color codes
345
-		if ($normalisedValue == 255) $colour = '[k03]';
346
-		elseif ($normalisedValue == -255) $colour = '[k04]';
347
-		else $colour = '[k08]';
348
-		if ($return_type == 'Colour') return $colour;
348
+		if ($normalisedValue == 255) {
349
+			$colour = '[k03]';
350
+		} elseif ($normalisedValue == -255) {
351
+			$colour = '[k04]';
352
+		} else {
353
+			$colour = '[k08]';
354
+		}
355
+		if ($return_type == 'Colour') {
356
+			return $colour;
357
+		}
349 358
 		return $colour . $text;
350 359
 	}
351 360
 }
@@ -416,10 +425,18 @@  discard block
 block discarded – undo
416 425
 	// create account object
417 426
 	$account = SmrSession::getAccount();
418 427
 
419
-	if (!defined('DATE_DATE_SHORT')) define('DATE_DATE_SHORT', $account->getShortDateFormat());
420
-	if (!defined('DATE_TIME_SHORT')) define('DATE_TIME_SHORT', $account->getShortTimeFormat());
421
-	if (!defined('DATE_FULL_SHORT')) define('DATE_FULL_SHORT', DATE_DATE_SHORT . ' ' . DATE_TIME_SHORT);
422
-	if (!defined('DATE_FULL_SHORT_SPLIT')) define('DATE_FULL_SHORT_SPLIT', DATE_DATE_SHORT . '\<b\r /\>' . DATE_TIME_SHORT);
428
+	if (!defined('DATE_DATE_SHORT')) {
429
+		define('DATE_DATE_SHORT', $account->getShortDateFormat());
430
+	}
431
+	if (!defined('DATE_TIME_SHORT')) {
432
+		define('DATE_TIME_SHORT', $account->getShortTimeFormat());
433
+	}
434
+	if (!defined('DATE_FULL_SHORT')) {
435
+		define('DATE_FULL_SHORT', DATE_DATE_SHORT . ' ' . DATE_TIME_SHORT);
436
+	}
437
+	if (!defined('DATE_FULL_SHORT_SPLIT')) {
438
+		define('DATE_FULL_SHORT_SPLIT', DATE_DATE_SHORT . '\<b\r /\>' . DATE_TIME_SHORT);
439
+	}
423 440
 
424 441
 	if ($var['url'] == 'game_play_preprocessing.php') { // Would rather not have these here but if we go through the initialisation based on game id when leaving a classic game it breaks.
425 442
 		SmrSession::clearLinks();
@@ -478,8 +495,9 @@  discard block
 block discarded – undo
478 495
 
479 496
 		if (!$player->isDead() && $player->getNewbieTurns() <= NEWBIE_TURNS_WARNING_LIMIT &&
480 497
 			$player->getNewbieWarning() &&
481
-			$var['url'] != 'newbie_warning_processing.php')
482
-			forward(create_container('newbie_warning_processing.php'));
498
+			$var['url'] != 'newbie_warning_processing.php') {
499
+					forward(create_container('newbie_warning_processing.php'));
500
+		}
483 501
 	}
484 502
 
485 503
 	// Initialize the template
@@ -557,8 +575,9 @@  discard block
 block discarded – undo
557 575
 function acquire_lock($sector) {
558 576
 	global $db, $lock, $locksFailed;
559 577
 
560
-	if ($lock)
561
-		return true;
578
+	if ($lock) {
579
+			return true;
580
+	}
562 581
 
563 582
 	// Insert ourselves into the queue.
564 583
 	$db->query('INSERT INTO locks_queue (game_id,account_id,sector_id,timestamp) VALUES(' . $db->escapeNumber(SmrSession::getGameID()) . ',' . $db->escapeNumber(SmrSession::getAccountID()) . ',' . $db->escapeNumber($sector) . ',' . $db->escapeNumber(TIME) . ')');
@@ -584,8 +603,7 @@  discard block
 block discarded – undo
584 603
 
585 604
 			usleep(25000 * $locksInQueue);
586 605
 			continue;
587
-		}
588
-		else {
606
+		} else {
589 607
 			return true;
590 608
 		}
591 609
 	}
@@ -782,7 +800,9 @@  discard block
 block discarded – undo
782 800
 		$container['player_id'] = $player->getPlayerID();
783 801
 		$template->assign('PlayerNameLink', SmrSession::getNewHREF($container));
784 802
 
785
-		if (is_array(Globals::getHiddenPlayers()) && in_array($player->getAccountID(), Globals::getHiddenPlayers())) $template->assign('PlayerInvisible', true);
803
+		if (is_array(Globals::getHiddenPlayers()) && in_array($player->getAccountID(), Globals::getHiddenPlayers())) {
804
+			$template->assign('PlayerInvisible', true);
805
+		}
786 806
 
787 807
 		// ******* Hardware *******
788 808
 		$container = create_container('skeleton.php', 'configure_hardware.php');
@@ -921,16 +941,18 @@  discard block
 block discarded – undo
921 941
 
922 942
 function number_colour_format($number, $justSign = false) {
923 943
 	$formatted = '<span';
924
-	if ($number > 0)
925
-		$formatted .= ' class="green">+';
926
-	else if ($number < 0)
927
-		$formatted .= ' class="red">-';
928
-	else
929
-		$formatted .= '>';
944
+	if ($number > 0) {
945
+			$formatted .= ' class="green">+';
946
+	} else if ($number < 0) {
947
+			$formatted .= ' class="red">-';
948
+	} else {
949
+			$formatted .= '>';
950
+	}
930 951
 	if ($justSign === false) {
931 952
 		$decimalPlaces = 0;
932
-		if (($pos = strpos($number, '.')) !== false)
933
-			$decimalPlaces = strlen(substr($number, $pos + 1));
953
+		if (($pos = strpos($number, '.')) !== false) {
954
+					$decimalPlaces = strlen(substr($number, $pos + 1));
955
+		}
934 956
 		$formatted .= number_format(abs($number), $decimalPlaces);
935 957
 	}
936 958
 	$formatted .= '</span>';
Please login to merge, or discard this patch.
templates/Default/admin/Default/location_edit.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
19 19
 	</tr><?php
20 20
 if (isset($Locations)) {
21 21
 	$this->includeTemplate('includes/ViewLocations.inc', array('Locations'=>$Locations));
22
-}
23
-else { ?>
22
+} else { ?>
24 23
 	<tr>
25 24
 		<td><input name="name" type="text" value="<?php echo htmlspecialchars($Location->getName()); ?>" /></td>
26 25
 		<td><input name="action" type="text" value="<?php echo htmlspecialchars($Location->getAction()); ?>" /></td>
Please login to merge, or discard this patch.
templates/Default/engine/Default/includes/PlanetFullCombatResults.inc 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 		<h1>Attacker Results</h1><br /><?php
5 5
 	}
6 6
 	$this->includeTemplate('includes/PlanetTraderTeamCombatResults.inc', array('TraderTeamCombatResults'=>$FullPlanetCombatResults['Attackers'], 'MinimalDisplay'=>$MinimalDisplay));
7
-}
8
-else if (!$MinimalDisplay) {
7
+} else if (!$MinimalDisplay) {
9 8
 	?><span class="bold">The planet is already destroyed.</span><?php
10 9
 }
11 10
 ?><br /><?php
Please login to merge, or discard this patch.
templates/Default/engine/Default/includes/ForceTraderTeamCombatResults.inc 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -1,119 +1,119 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(is_array($TraderTeamCombatResults['Traders'])) {
4
-	foreach($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) {
5
-		$ShootingPlayer =& $TraderResults['Player'];
6
-		$TotalDamage =& $TraderResults['TotalDamage'];
7
-		if($TraderResults['DeadBeforeShot']) {
3
+if (is_array($TraderTeamCombatResults['Traders'])) {
4
+	foreach ($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) {
5
+		$ShootingPlayer = & $TraderResults['Player'];
6
+		$TotalDamage = & $TraderResults['TotalDamage'];
7
+		if ($TraderResults['DeadBeforeShot']) {
8 8
 			echo $ShootingPlayer->getDisplayName() ?> died before they were able to attack!<br /><?php
9 9
 		} else {
10
-			if(isset($TraderResults['Weapons']) && is_array($TraderResults['Weapons'])) {
11
-				foreach($TraderResults['Weapons'] as $WeaponResults) {
12
-					$ShootingWeapon =& $WeaponResults['Weapon'];
13
-					$ShotHit =& $WeaponResults['Hit'];
14
-					$ActualDamage =& $WeaponResults['ActualDamage'];
15
-					$WeaponDamage =& $WeaponResults['WeaponDamage'];
16
-					$TargetPlayer =& $WeaponResults['TargetPlayer'];
10
+			if (isset($TraderResults['Weapons']) && is_array($TraderResults['Weapons'])) {
11
+				foreach ($TraderResults['Weapons'] as $WeaponResults) {
12
+					$ShootingWeapon = & $WeaponResults['Weapon'];
13
+					$ShotHit = & $WeaponResults['Hit'];
14
+					$ActualDamage = & $WeaponResults['ActualDamage'];
15
+					$WeaponDamage = & $WeaponResults['WeaponDamage'];
16
+					$TargetPlayer = & $WeaponResults['TargetPlayer'];
17 17
 					$DamageTypes = 0;
18
-					if($ActualDamage['NumMines'] > 0){ $DamageTypes = $DamageTypes+1; }
19
-					if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
20
-					if($ActualDamage['NumSDs'] > 0){ $DamageTypes = $DamageTypes+1; }
21
-					echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at<?php if($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once<?php } ?> the forces<?php
22
-					if(!$ActualDamage['TargetAlreadyDead']) {
23
-						if(!$ShotHit) {
18
+					if ($ActualDamage['NumMines'] > 0) { $DamageTypes = $DamageTypes + 1; }
19
+					if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
20
+					if ($ActualDamage['NumSDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
21
+					echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at<?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once<?php } ?> the forces<?php
22
+					if (!$ActualDamage['TargetAlreadyDead']) {
23
+						if (!$ShotHit) {
24 24
 							?> and misses<?php
25
-						} else if($ActualDamage['TotalDamage'] == 0) {
26
-							if($WeaponDamage['Shield'] > 0) {
27
-								?> which proves ineffective against the <?php if($ActualDamage['HasMines']){ ?>mines<?php } else if($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php }
28
-							} else if($WeaponDamage['Armour'] > 0) {
29
-								?> which is deflected by the <?php if($ActualDamage['HasMines']){ ?>mines<?php } else if($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } ?> shields<?php
25
+						} else if ($ActualDamage['TotalDamage'] == 0) {
26
+							if ($WeaponDamage['Shield'] > 0) {
27
+								?> which proves ineffective against the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } else if ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php }
28
+							} else if ($WeaponDamage['Armour'] > 0) {
29
+								?> which is deflected by the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } else if ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } ?> shields<?php
30 30
 							} else {
31 31
 								?> but it cannot do any damage<?php
32 32
 							}
33 33
 						} else {
34 34
 							?> destroying <?php
35
-							if($ActualDamage['NumMines'] > 0) {
35
+							if ($ActualDamage['NumMines'] > 0) {
36 36
 								?><span class="red"><?php echo number_format($ActualDamage['NumMines']) ?></span> mines<?php
37 37
 								$this->doDamageTypeReductionDisplay($DamageTypes);
38 38
 							}
39
-							if($ActualDamage['NumCDs'] > 0) {
39
+							if ($ActualDamage['NumCDs'] > 0) {
40 40
 								?><span class="red"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php
41 41
 								$this->doDamageTypeReductionDisplay($DamageTypes);
42 42
 							}
43
-							if($ActualDamage['NumSDs'] > 0) {
43
+							if ($ActualDamage['NumSDs'] > 0) {
44 44
 								?><span class="red"><?php echo number_format($ActualDamage['NumSDs']) ?></span> scout drones<?php
45 45
 							}
46 46
 						}
47 47
 					} ?>.
48 48
 					<br />
49
-					<?php if($ActualDamage['KillingShot']) {
49
+					<?php if ($ActualDamage['KillingShot']) {
50 50
 						?>Forces are <span class="red">DESTROYED!</span><br /><?php
51 51
 					}
52 52
 				}
53 53
 			}
54
-			if(isset($TraderResults['Drones'])) {
55
-				$Drones =& $TraderResults['Drones'];
56
-				$ActualDamage =& $Drones['ActualDamage'];
57
-				$WeaponDamage =& $Drones['WeaponDamage'];
58
-				$TargetPlayer =& $Drones['TargetPlayer'];
54
+			if (isset($TraderResults['Drones'])) {
55
+				$Drones = & $TraderResults['Drones'];
56
+				$ActualDamage = & $Drones['ActualDamage'];
57
+				$WeaponDamage = & $Drones['WeaponDamage'];
58
+				$TargetPlayer = & $Drones['TargetPlayer'];
59 59
 				$DamageTypes = 0;
60
-				if($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) { $DamageTypes = $DamageTypes+1; }
61
-				if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
62
-				if($ActualDamage['NumSDs'] > 0){ $DamageTypes = $DamageTypes+1; }
60
+				if ($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) { $DamageTypes = $DamageTypes + 1; }
61
+				if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
62
+				if ($ActualDamage['NumSDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
63 63
 				echo $ShootingPlayer->getDisplayName();
64
-				if($WeaponDamage['Launched'] == 0) {
64
+				if ($WeaponDamage['Launched'] == 0) {
65 65
 					?> fails to launch their combat drones<?php
66 66
 				} else {
67
-					?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at<?php if($ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } ?> the forces<?php
68
-					if(!$ActualDamage['TargetAlreadyDead']) {
69
-						if($ActualDamage['TotalDamage'] == 0) {
70
-							if($WeaponDamage['Shield'] > 0) {
71
-								?> which prove ineffective against the <?php if($ActualDamage['HasMines']){ ?>mines<?php } else if($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php }
72
-							} else if($WeaponDamage['Armour'] > 0) {
67
+					?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at<?php if ($ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } ?> the forces<?php
68
+					if (!$ActualDamage['TargetAlreadyDead']) {
69
+						if ($ActualDamage['TotalDamage'] == 0) {
70
+							if ($WeaponDamage['Shield'] > 0) {
71
+								?> which prove ineffective against the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } else if ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php }
72
+							} else if ($WeaponDamage['Armour'] > 0) {
73 73
 								?> which is deflected by the <?php
74
-								if($ActualDamage['HasMines']){ ?>mines<?php } else if($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } ?> shields<?php
74
+								if ($ActualDamage['HasMines']) { ?>mines<?php } else if ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } ?> shields<?php
75 75
 							} else {
76 76
 								?> but they cannot do any damage<?php
77 77
 							}
78 78
 						} else {
79
-							if($WeaponDamage['Kamikaze'] == 0) {
79
+							if ($WeaponDamage['Kamikaze'] == 0) {
80 80
 								?> destroying <?php
81 81
 							} else {
82 82
 								?> of which <span class="cds"><?php echo $WeaponDamage['Kamikaze'] ?></span> kamikaze against <span class="red"><?php echo $WeaponDamage['Kamikaze'] ?></span> mines<?php
83
-								if($DamageTypes > 0) {
83
+								if ($DamageTypes > 0) {
84 84
 									?> whilst the others destroy <?php
85 85
 								}
86 86
 							}
87
-							if($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) {
87
+							if ($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) {
88 88
 								?><span class="red"><?php echo number_format($ActualDamage['NumMines']) ?></span> mines<?php
89 89
 								$this->doDamageTypeReductionDisplay($DamageTypes);
90 90
 							}
91
-							if($ActualDamage['NumCDs'] > 0) {
91
+							if ($ActualDamage['NumCDs'] > 0) {
92 92
 								?><span class="red"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php
93 93
 								$this->doDamageTypeReductionDisplay($DamageTypes);
94 94
 							}
95
-							if($ActualDamage['NumSDs'] > 0) {
95
+							if ($ActualDamage['NumSDs'] > 0) {
96 96
 								?><span class="red"><?php echo number_format($ActualDamage['NumSDs']) ?></span> scout drones<?php
97 97
 							}
98 98
 						}
99 99
 					}
100 100
 				}?>.
101 101
 				<br />
102
-				<?php if($ActualDamage['KillingShot']) {
102
+				<?php if ($ActualDamage['KillingShot']) {
103 103
 					?>Forces are <span class="red">DESTROYED!</span><br /><?php
104 104
 				}
105 105
 			}
106 106
 		}
107 107
 		echo $ShootingPlayer->getDisplayName();
108
-		if($TotalDamage > 0) {
108
+		if ($TotalDamage > 0) {
109 109
 			?> hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php
110 110
 		} else {
111 111
 			?> does no damage this round.<?php
112
-			if(!$TraderResults['DeadBeforeShot']) {
112
+			if (!$TraderResults['DeadBeforeShot']) {
113 113
 				?> Maybe they should go back to the academy<?php
114 114
 			}
115 115
 		} ?>.<br /><br /><?php
116 116
 	}
117 117
 }
118 118
 $TotalDamage = $TraderTeamCombatResults['TotalDamage']; ?>
119
-This fleet <?php if($TotalDamage > 0){ ?>hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php } else{ ?>does no damage this round. You call that a fleet? They need a better recruiter<?php } ?>.
120 119
\ No newline at end of file
120
+This fleet <?php if ($TotalDamage > 0) { ?>hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php } else { ?>does no damage this round. You call that a fleet? They need a better recruiter<?php } ?>.
121 121
\ No newline at end of file
Please login to merge, or discard this patch.
templates/Default/engine/Default/includes/PortCombatResults.inc 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,116 +1,116 @@
 block discarded – undo
1 1
 <?php
2
-$CombatPort =& $PortCombatResults['Port'];
2
+$CombatPort = & $PortCombatResults['Port'];
3 3
 $TotalDamage = $PortCombatResults['TotalDamage'];
4
-if($MinimalDisplay) {
4
+if ($MinimalDisplay) {
5 5
 	echo $CombatPort->getDisplayName();
6
-	if($TotalDamage > 0) {
6
+	if ($TotalDamage > 0) {
7 7
 		?> hit for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat of which <span class="red"><?php echo $PortCombatResults['TotalDamagePerTargetPlayer'][$ThisPlayer->getAccountID()]; ?></span> was done to you<?php
8 8
 	} else {
9 9
 		?> does no damage this round<?php
10 10
 	} ?>. <?php echo $AttackLogLink;
11 11
 	return;
12 12
 }
13
-if(isset($PortCombatResults['Weapons']) && is_array($PortCombatResults['Weapons'])) {
14
-	foreach($PortCombatResults['Weapons'] as $WeaponResults) {
15
-		$ShootingWeapon =& $WeaponResults['Weapon'];
16
-		$ShotHit =& $WeaponResults['Hit'];
17
-		$ActualDamage =& $WeaponResults['ActualDamage'];
18
-		$WeaponDamage =& $WeaponResults['WeaponDamage'];
19
-		$TargetPlayer =& $WeaponResults['TargetPlayer'];
13
+if (isset($PortCombatResults['Weapons']) && is_array($PortCombatResults['Weapons'])) {
14
+	foreach ($PortCombatResults['Weapons'] as $WeaponResults) {
15
+		$ShootingWeapon = & $WeaponResults['Weapon'];
16
+		$ShotHit = & $WeaponResults['Hit'];
17
+		$ActualDamage = & $WeaponResults['ActualDamage'];
18
+		$WeaponDamage = & $WeaponResults['WeaponDamage'];
19
+		$TargetPlayer = & $WeaponResults['TargetPlayer'];
20 20
 		$DamageTypes = 0;
21
-		if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; }
22
-		if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
23
-		if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; }
21
+		if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; }
22
+		if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
23
+		if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; }
24 24
 		
25
-		echo $CombatPort->getDisplayName() ?> fires an <?php echo $ShootingWeapon->getName() ?> at <?php if($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } echo $TargetPlayer->getDisplayName();
26
-		if(!$ActualDamage['TargetAlreadyDead']) {
27
-			if(!$ShotHit) {
25
+		echo $CombatPort->getDisplayName() ?> fires an <?php echo $ShootingWeapon->getName() ?> at <?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } echo $TargetPlayer->getDisplayName();
26
+		if (!$ActualDamage['TargetAlreadyDead']) {
27
+			if (!$ShotHit) {
28 28
 				?> and misses<?php
29
-			} else if($ActualDamage['TotalDamage'] == 0) {
30
-				if($WeaponDamage['Shield'] > 0) {
31
-					if($ActualDamage['HasCDs']) {
29
+			} else if ($ActualDamage['TotalDamage'] == 0) {
30
+				if ($WeaponDamage['Shield'] > 0) {
31
+					if ($ActualDamage['HasCDs']) {
32 32
 						?> which proves ineffective against their combat drones<?php
33 33
 					} else {
34 34
 						?> which washes harmlessly over their hull<?php
35 35
 					}
36
-				} else if($WeaponDamage['Armour'] > 0) {
36
+				} else if ($WeaponDamage['Armour'] > 0) {
37 37
 					?> which is deflected by their shields<?php
38 38
 				} else {
39 39
 					?> but it cannot do any damage<?php
40 40
 				}
41 41
 			} else {
42 42
 				?> destroying <?php
43
-				if($ActualDamage['Shield'] > 0) {
43
+				if ($ActualDamage['Shield'] > 0) {
44 44
 					?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php
45 45
 					$this->doDamageTypeReductionDisplay($DamageTypes);
46 46
 				}
47
-				if($ActualDamage['NumCDs'] > 0) {
47
+				if ($ActualDamage['NumCDs'] > 0) {
48 48
 					?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php
49 49
 					$this->doDamageTypeReductionDisplay($DamageTypes);
50 50
 				}
51
-				if($ActualDamage['Armour'] > 0) {
51
+				if ($ActualDamage['Armour'] > 0) {
52 52
 					?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php
53 53
 				}
54 54
 			}
55 55
 		} ?>.
56 56
 		<br />
57
-		<?php if($ActualDamage['KillingShot']) {
58
-			$this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer));
57
+		<?php if ($ActualDamage['KillingShot']) {
58
+			$this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$WeaponResults['KillResults'], 'TargetPlayer'=>$TargetPlayer));
59 59
 		}
60 60
 	}
61 61
 }
62
-if(isset($PortCombatResults['Drones'])) {
63
-	$Drones =& $PortCombatResults['Drones'];
64
-	$ActualDamage =& $Drones['ActualDamage'];
65
-	$WeaponDamage =& $Drones['WeaponDamage'];
66
-	$TargetPlayer =& $Drones['TargetPlayer'];
62
+if (isset($PortCombatResults['Drones'])) {
63
+	$Drones = & $PortCombatResults['Drones'];
64
+	$ActualDamage = & $Drones['ActualDamage'];
65
+	$WeaponDamage = & $Drones['WeaponDamage'];
66
+	$TargetPlayer = & $Drones['TargetPlayer'];
67 67
 	$DamageTypes = 0;
68
-	if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; }
69
-	if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
70
-	if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; }
68
+	if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; }
69
+	if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
70
+	if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; }
71 71
 	
72 72
 	echo $CombatPort->getDisplayName();
73
-	if($WeaponDamage['Launched'] == 0) {
73
+	if ($WeaponDamage['Launched'] == 0) {
74 74
 		?> fails to launch it's combat drones<?php
75 75
 	} else {
76
-		?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php if($ActualDamage['TargetAlreadyDead']){ ?>the debris that was once <?php } echo $TargetPlayer->getDisplayName();
77
-		if(!$ActualDamage['TargetAlreadyDead']) {
78
-			if($ActualDamage['TotalDamage'] == 0) {
79
-				if($WeaponDamage['Shield'] > 0) {
80
-					if($ActualDamage['HasCDs']) {
76
+		?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php if ($ActualDamage['TargetAlreadyDead']) { ?>the debris that was once <?php } echo $TargetPlayer->getDisplayName();
77
+		if (!$ActualDamage['TargetAlreadyDead']) {
78
+			if ($ActualDamage['TotalDamage'] == 0) {
79
+				if ($WeaponDamage['Shield'] > 0) {
80
+					if ($ActualDamage['HasCDs']) {
81 81
 						?> which prove ineffective against their combat drones<?php
82 82
 					} else {
83 83
 						?> which washes harmlessly over their hull<?php
84 84
 					}
85
-				} else if($WeaponDamage['Armour'] > 0) {
85
+				} else if ($WeaponDamage['Armour'] > 0) {
86 86
 					?> which is deflected by their shields<?php
87 87
 				} else {
88 88
 					?> but they cannot do any damage<?php
89 89
 				}
90 90
 			} else {
91 91
 				?> destroying <?php
92
-				if($ActualDamage['Shield'] > 0) {
92
+				if ($ActualDamage['Shield'] > 0) {
93 93
 					?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php
94 94
 					$this->doDamageTypeReductionDisplay($DamageTypes);
95 95
 				}
96
-				if($ActualDamage['NumCDs'] > 0) {
96
+				if ($ActualDamage['NumCDs'] > 0) {
97 97
 					?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php
98 98
 					$this->doDamageTypeReductionDisplay($DamageTypes);
99 99
 				}
100
-				if($ActualDamage['Armour'] > 0) {
100
+				if ($ActualDamage['Armour'] > 0) {
101 101
 					?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php
102 102
 				}
103 103
 			}
104 104
 		}
105 105
 	} ?>.
106 106
 	<br /><?php
107
-	if($ActualDamage['KillingShot']) {
108
-		$this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlayer'=>$TargetPlayer));
107
+	if ($ActualDamage['KillingShot']) {
108
+		$this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$Drones['KillResults'], 'TargetPlayer'=>$TargetPlayer));
109 109
 	}
110 110
 }
111 111
 
112 112
 echo $CombatPort->getDisplayName();
113
-if($TotalDamage > 0) {
113
+if ($TotalDamage > 0) {
114 114
 	?> hit for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php
115 115
 } else {
116 116
 	?> does no damage this round<?php
Please login to merge, or discard this patch.
engine/Default/bar_gambling_processing.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@
 block discarded – undo
180 180
 	//heres the AIs cards
181 181
 	$i = 1;
182 182
 	if ((get_value($ai_card) == 21 && count($ai_card) == 2) ||
183
-	    (get_value($player_card) > 21 && get_value($ai_card) <= 21)) {
183
+		(get_value($player_card) > 21 && get_value($ai_card) <= 21)) {
184 184
 		$message .= ('<h1 class="red center">Bank Wins</h1>');
185 185
 	}
186 186
 	$message .= ('<div class="center">Bank\'s Cards are</div><br /><table class="center"><tr>');
Please login to merge, or discard this patch.
lib/Album/album_functions.php 1 patch
Braces   +39 added lines, -30 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 
54 54
 			echo('<span style="font-size:85%;"><b>[' . date(defined('DATE_FULL_SHORT') ?DATE_FULL_SHORT:DEFAULT_DATE_FULL_SHORT, $created) . ']</b> Picture of <a href="?nick=' . urlencode($nick) . '">' . $nick . '</a> added</span><br />');
55 55
 		}
56
+	} else {
57
+			echo('<span style="font-size:85%;">no entries</span>');
56 58
 	}
57
-	else
58
-		echo('<span style="font-size:85%;">no entries</span>');
59 59
 	echo('</p>');
60 60
 }
61 61
 
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
 		$other = nl2br(stripslashes($db->getField('other')));
88 88
 		$page_views = $db->getField('page_views');
89 89
 		$disabled = $db->getField('disabled') == 'TRUE';
90
-	}
91
-	else {
90
+	} else {
92 91
 		echo('<h1>Error</h1>');
93 92
 		echo('This user doesn\'t have an entry in our album!');
94 93
 		return;
@@ -139,46 +138,54 @@  discard block
 block discarded – undo
139 138
 	echo('<tr>');
140 139
 	echo('<td colspan="2" class="center" valign="middle">');
141 140
 
142
-	if ($disabled == false)
143
-		echo('<img src="../upload/' . $album_id . '">');
144
-	else
145
-		echo('<img src="../images/album/disabled.jpg">');
141
+	if ($disabled == false) {
142
+			echo('<img src="../upload/' . $album_id . '">');
143
+	} else {
144
+			echo('<img src="../images/album/disabled.jpg">');
145
+	}
146 146
 
147 147
 	echo('</td>');
148 148
 	echo('</tr>');
149 149
 
150
-	if (empty($location))
151
-		$location = 'N/A';
150
+	if (empty($location)) {
151
+			$location = 'N/A';
152
+	}
152 153
 	echo('<tr>');
153 154
 	echo('<td class="right bold" width="10%">Location:</td><td>' . $location . '</td>');
154 155
 	echo('</tr>');
155 156
 
156
-	if (empty($email))
157
-		$email = 'N/A';
157
+	if (empty($email)) {
158
+			$email = 'N/A';
159
+	}
158 160
 	echo('<tr>');
159 161
 	echo('<td class="right bold" width="10%">E-mail:</td><td>' . $email . '</td>');
160 162
 	echo('</tr>');
161 163
 
162
-	if (empty($website))
163
-		$website = 'N/A';
164
-	else
165
-		$website = '<a href="' . $website . '" target="_new">' . $website . '</a>';
164
+	if (empty($website)) {
165
+			$website = 'N/A';
166
+	} else {
167
+			$website = '<a href="' . $website . '" target="_new">' . $website . '</a>';
168
+	}
166 169
 	echo('<tr>');
167 170
 	echo('<td class="right bold" width="10%">Website:</td><td>' . $website . '</td>');
168 171
 	echo('</tr>');
169 172
 
170 173
 	echo('<tr>');
171
-	if (!empty($day) && !empty($month) && !empty($year))
172
-		$birthdate = $month . ' / ' . $day . ' / ' . $year;
173
-	if (empty($birthdate) && !empty($year))
174
-		$birthdate = 'Year ' . $year;
175
-	if (empty($birthdate))
176
-		$birthdate = 'N/A';
174
+	if (!empty($day) && !empty($month) && !empty($year)) {
175
+			$birthdate = $month . ' / ' . $day . ' / ' . $year;
176
+	}
177
+	if (empty($birthdate) && !empty($year)) {
178
+			$birthdate = 'Year ' . $year;
179
+	}
180
+	if (empty($birthdate)) {
181
+			$birthdate = 'N/A';
182
+	}
177 183
 	echo('<td class="right bold" width="10%">Birthdate:</td><td>' . $birthdate . '</td>');
178 184
 	echo('</tr>');
179 185
 
180
-	if (empty($other))
181
-		$other = 'N/A';
186
+	if (empty($other)) {
187
+			$other = 'N/A';
188
+	}
182 189
 	echo('<tr>');
183 190
 	echo('<td class="right bold" valign="top" width="10%">Other&nbsp;Info:</td><td>' . $other . '</td>');
184 191
 	echo('</tr>');
@@ -210,15 +217,16 @@  discard block
 block discarded – undo
210 217
 					FROM account_has_permission
211 218
 					WHERE account_id = '.$db->escapeNumber(SmrSession::getAccountID()) . ' AND
212 219
 						permission_id = '.$db->escapeNumber(PERMISSION_MODERATE_PHOTO_ALBUM));
213
-		if ($db->nextRecord())
214
-			echo('<td style="color:green; font-size:70%;"><br /><input type="submit" name="action" value="Moderate" class="InputFields"></td>');
220
+		if ($db->nextRecord()) {
221
+					echo('<td style="color:green; font-size:70%;"><br /><input type="submit" name="action" value="Moderate" class="InputFields"></td>');
222
+		}
215 223
 
216 224
 		echo('</tr>');
217 225
 		echo('</table>');
218 226
 		echo('</form>');
227
+	} else {
228
+			echo('<p>Please <a href="/login.php?return_page=/album/?nick=' . urlencode($nick) . '"><u>login</u></a> if you want comment on this picture!</p>');
219 229
 	}
220
-	else
221
-		echo('<p>Please <a href="/login.php?return_page=/album/?nick=' . urlencode($nick) . '"><u>login</u></a> if you want comment on this picture!</p>');
222 230
 
223 231
 	echo('</td>');
224 232
 	echo('</tr>');
@@ -288,8 +296,9 @@  discard block
 block discarded – undo
288 296
 
289 297
 
290 298
 function get_album_nick($album_id) {
291
-	if ($album_id == 0)
292
-		return 'System';
299
+	if ($album_id == 0) {
300
+			return 'System';
301
+	}
293 302
 
294 303
 	return SmrAccount::getAccount($album_id)->getHofName();
295 304
 }
Please login to merge, or discard this patch.
htdocs/ship_list.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@
 block discarded – undo
16 16
 	$template->assign('shipArray', $shipArray);
17 17
 
18 18
 	$template->display('ship_list.php');
19
-}
20
-catch(Throwable $e) {
19
+} catch(Throwable $e) {
21 20
 	handleException($e);
22 21
 }
23 22
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 	$template->display('ship_list.php');
19 19
 }
20
-catch(Throwable $e) {
20
+catch (Throwable $e) {
21 21
 	handleException($e);
22 22
 }
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	$selector = '<select onchange="filterSelect(this)"><option>All</option>';
26 26
 	$db->query('SELECT DISTINCT ' . $name . ' FROM ' . $table . ' ORDER BY ' . $name);
27 27
 	while ($db->nextRecord()) {
28
-		$selector .= '<option>'.$db->getField($name).'</option>';
28
+		$selector .= '<option>' . $db->getField($name) . '</option>';
29 29
 	}
30 30
 	$selector .= '</select>';
31 31
 	return $selector;
Please login to merge, or discard this patch.