We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -9,10 +9,11 @@ discard block |
||
| 9 | 9 | $realAttackers = array(); |
| 10 | 10 | $attackers = array(); |
| 11 | 11 | $i=1; |
| 12 | -if(isset($_POST['attackers'])) |
|
| 12 | +if(isset($_POST['attackers'])) { |
|
| 13 | 13 | foreach($_POST['attackers'] as $attackerName) { |
| 14 | 14 | if($attackerName=='none') |
| 15 | 15 | continue; |
| 16 | +} |
|
| 16 | 17 | if(isset($usedNames[$attackerName])) { |
| 17 | 18 | $duplicates = true; |
| 18 | 19 | continue; |
@@ -24,17 +25,19 @@ discard block |
||
| 24 | 25 | ++$i; |
| 25 | 26 | } |
| 26 | 27 | |
| 27 | -for(;$i<=10;++$i) |
|
| 28 | +for(;$i<=10;++$i) { |
|
| 28 | 29 | $attackers[$i] = null; |
| 30 | +} |
|
| 29 | 31 | $template->assign('Attackers',$attackers); |
| 30 | 32 | |
| 31 | 33 | $i=1; |
| 32 | 34 | $realDefenders = array(); |
| 33 | 35 | $defenders = array(); |
| 34 | -if(isset($_POST['defenders'])) |
|
| 36 | +if(isset($_POST['defenders'])) { |
|
| 35 | 37 | foreach($_POST['defenders'] as $defenderName) { |
| 36 | 38 | if($defenderName=='none') |
| 37 | 39 | continue; |
| 40 | +} |
|
| 38 | 41 | if(isset($usedNames[$defenderName])) { |
| 39 | 42 | $duplicates = true; |
| 40 | 43 | continue; |
@@ -46,8 +49,9 @@ discard block |
||
| 46 | 49 | ++$i; |
| 47 | 50 | } |
| 48 | 51 | |
| 49 | -for(;$i<=10;++$i) |
|
| 52 | +for(;$i<=10;++$i) { |
|
| 50 | 53 | $defenders[$i] = null; |
| 54 | +} |
|
| 51 | 55 | $template->assign('Defenders',$defenders); |
| 52 | 56 | |
| 53 | 57 | $template->assign('Duplicates',$duplicates); |
@@ -62,12 +66,14 @@ discard block |
||
| 62 | 66 | while(count($realAttackers)>0 && count($realDefenders)>0) { |
| 63 | 67 | runAnAttack($realAttackers,$realDefenders); |
| 64 | 68 | foreach($realAttackers as $key => &$teamPlayer) { |
| 65 | - if($teamPlayer->isDead()) |
|
| 66 | - unset($realAttackers[$key]); |
|
| 69 | + if($teamPlayer->isDead()) { |
|
| 70 | + unset($realAttackers[$key]); |
|
| 71 | + } |
|
| 67 | 72 | } unset($teamPlayer); |
| 68 | 73 | foreach($realDefenders as $key => &$teamPlayer) { |
| 69 | - if($teamPlayer->isDead()) |
|
| 70 | - unset($realDefenders[$key]); |
|
| 74 | + if($teamPlayer->isDead()) { |
|
| 75 | + unset($realDefenders[$key]); |
|
| 76 | + } |
|
| 71 | 77 | } unset($teamPlayer); |
| 72 | 78 | } |
| 73 | 79 | } |
@@ -5,8 +5,9 @@ discard block |
||
| 5 | 5 | require_once(ENGINE . 'Default/help.inc'); |
| 6 | 6 | |
| 7 | 7 | $topic_id = $_SERVER['QUERY_STRING']; |
| 8 | - if (empty($topic_id) || !is_numeric($topic_id)) |
|
| 9 | - $topic_id = 1; |
|
| 8 | + if (empty($topic_id) || !is_numeric($topic_id)) { |
|
| 9 | + $topic_id = 1; |
|
| 10 | + } |
|
| 10 | 11 | ?> |
| 11 | 12 | <!DOCTYPE html> |
| 12 | 13 | |
@@ -48,8 +49,7 @@ discard block |
||
| 48 | 49 | |
| 49 | 50 | </body> |
| 50 | 51 | </html><?php |
| 51 | -} |
|
| 52 | -catch (Throwable $e) { |
|
| 52 | +} catch (Throwable $e) { |
|
| 53 | 53 | handleException($e); |
| 54 | 54 | } |
| 55 | 55 | ?> |
@@ -68,8 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | </body> |
| 70 | 70 | </html><?php |
| 71 | -} |
|
| 72 | -catch (Throwable $e) { |
|
| 71 | +} catch (Throwable $e) { |
|
| 73 | 72 | handleException($e); |
| 74 | 73 | } |
| 75 | 74 | ?> |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
| 2 | -<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) echo ": $GameName"; ?></title> |
|
| 2 | +<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) { |
|
| 3 | + echo ": $GameName"; |
|
| 4 | +} |
|
| 5 | +?></title> |
|
| 3 | 6 | <meta http-equiv="pragma" content="no-cache" /><?php |
| 4 | 7 | if (!is_object($ThisAccount) || $ThisAccount->isDefaultCSSEnabled()) { ?> |
| 5 | 8 | <link rel="stylesheet" type="text/css" href="<?php echo $CSSLink; ?>" /> |
@@ -10,7 +10,10 @@ |
||
| 10 | 10 | <td style="width: 80%" class="center"> |
| 11 | 11 | Local Map of the Known <span class="big bold"><?php echo $GalaxyName ?></span> Galaxy |
| 12 | 12 | <br /><br /> |
| 13 | - <?php if (isset($Error)) echo $Error; ?> |
|
| 13 | + <?php if (isset($Error)) { |
|
| 14 | + echo $Error; |
|
| 15 | +} |
|
| 16 | +?> |
|
| 14 | 17 | </td> |
| 15 | 18 | <td style="width: 10%"></td> |
| 16 | 19 | </tr> |
@@ -53,8 +53,9 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function setAllianceID($ID) { |
| 56 | - if($this->allianceID == $ID) |
|
| 57 | - return; |
|
| 56 | + if($this->allianceID == $ID) { |
|
| 57 | + return; |
|
| 58 | + } |
|
| 58 | 59 | $this->allianceID=$ID; |
| 59 | 60 | } |
| 60 | 61 | |
@@ -93,8 +94,7 @@ discard block |
||
| 93 | 94 | if($db->nextRecord()) { |
| 94 | 95 | $return = unserialize($db->getField('info')); |
| 95 | 96 | return $return; |
| 96 | - } |
|
| 97 | - else { |
|
| 97 | + } else { |
|
| 98 | 98 | $return = new DummyPlayer(); |
| 99 | 99 | return $return; |
| 100 | 100 | } |
@@ -22,16 +22,18 @@ discard block |
||
| 22 | 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 | - if (!$db2->getNumRows()) |
|
| 26 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
| 25 | + if (!$db2->getNumRows()) { |
|
| 26 | + $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | echo ('<th width="32">'); |
| 29 | 30 | if ($db2->nextRecord()) { |
| 30 | 31 | $previous_topic_id = $db2->getInt('topic_id'); |
| 31 | 32 | $previous_topic = stripslashes($db2->getField('topic')); |
| 32 | 33 | echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
| 33 | - } else |
|
| 34 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
| 34 | + } else { |
|
| 35 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
| 36 | + } |
|
| 35 | 37 | echo ('</th>'); |
| 36 | 38 | |
| 37 | 39 | // ************************** |
@@ -43,8 +45,9 @@ discard block |
||
| 43 | 45 | $up_topic_id = $db2->getInt('topic_id'); |
| 44 | 46 | $up_topic = stripslashes($db2->getField('topic')); |
| 45 | 47 | echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
| 46 | - } else |
|
| 47 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
| 48 | + } else { |
|
| 49 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
| 50 | + } |
|
| 48 | 51 | echo ('</th>'); |
| 49 | 52 | |
| 50 | 53 | // ************************** |
@@ -52,8 +55,9 @@ discard block |
||
| 52 | 55 | // ************************** |
| 53 | 56 | $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1'); |
| 54 | 57 | |
| 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)); |
|
| 58 | + if (!$db2->getNumRows()) { |
|
| 59 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1)); |
|
| 60 | + } |
|
| 57 | 61 | |
| 58 | 62 | $seenParentIDs = array(0); |
| 59 | 63 | $curr_parent_topic_id = $parent_topic_id; |
@@ -72,8 +76,7 @@ discard block |
||
| 72 | 76 | $next_topic_id = $db2->getInt('topic_id'); |
| 73 | 77 | $next_topic = stripslashes($db2->getField('topic')); |
| 74 | 78 | echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
| 75 | - } |
|
| 76 | - else { |
|
| 79 | + } else { |
|
| 77 | 80 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
| 78 | 81 | } |
| 79 | 82 | echo ('</th>'); |
@@ -85,18 +88,22 @@ discard block |
||
| 85 | 88 | |
| 86 | 89 | echo ('<tr>'); |
| 87 | 90 | echo ('<td colspan="5">'); |
| 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> '); |
|
| 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> '); |
|
| 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>'); |
|
| 91 | + if (isset($previous_topic_id) && $previous_topic_id > 0) { |
|
| 92 | + echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a> '); |
|
| 93 | + } |
|
| 94 | + if (isset($up_topic_id) && $up_topic_id > 0) { |
|
| 95 | + echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a> '); |
|
| 96 | + } |
|
| 97 | + if (isset($next_topic_id) && $next_topic_id > 0) { |
|
| 98 | + echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>'); |
|
| 99 | + } |
|
| 94 | 100 | echo ('</tr>'); |
| 95 | 101 | |
| 96 | 102 | echo ('</table>'); |
| 97 | - } else |
|
| 98 | - echo ('Invalid Topic!'); |
|
| 99 | -} |
|
| 103 | + } else { |
|
| 104 | + echo ('Invalid Topic!'); |
|
| 105 | + } |
|
| 106 | + } |
|
| 100 | 107 | |
| 101 | 108 | function echo_content($topic_id) { |
| 102 | 109 | // database object |
@@ -114,9 +121,10 @@ discard block |
||
| 114 | 121 | echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>'); |
| 115 | 122 | echo ('<p>'.$text.'<p>'); |
| 116 | 123 | echo ('</div>'); |
| 117 | - } else |
|
| 118 | - echo ('Invalid Topic!'); |
|
| 119 | -} |
|
| 124 | + } else { |
|
| 125 | + echo ('Invalid Topic!'); |
|
| 126 | + } |
|
| 127 | + } |
|
| 120 | 128 | |
| 121 | 129 | function echo_subsection($topic_id) { |
| 122 | 130 | // database object |
@@ -469,8 +469,9 @@ |
||
| 469 | 469 | |
| 470 | 470 | if (!$player->isDead() && $player->getNewbieTurns() <= NEWBIE_TURNS_WARNING_LIMIT && |
| 471 | 471 | $player->getNewbieWarning() && |
| 472 | - $var['url'] != 'newbie_warning_processing.php') |
|
| 473 | - forward(create_container('newbie_warning_processing.php')); |
|
| 472 | + $var['url'] != 'newbie_warning_processing.php') { |
|
| 473 | + forward(create_container('newbie_warning_processing.php')); |
|
| 474 | + } |
|
| 474 | 475 | } |
| 475 | 476 | |
| 476 | 477 | // Initialize the template |
@@ -32,11 +32,16 @@ |
||
| 32 | 32 | $ship->increaseHardware($hardware_id, $amount); |
| 33 | 33 | |
| 34 | 34 | //HoF |
| 35 | - if ($hardware_id == HARDWARE_COMBAT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Combat Drones'), HOF_ALLIANCE); |
|
| 36 | - if ($hardware_id == HARDWARE_SCOUT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Scout Drones'), HOF_ALLIANCE); |
|
| 37 | - if ($hardware_id == HARDWARE_MINE) $player->increaseHOF($amount, array('Forces', 'Bought', 'Mines'), HOF_ALLIANCE); |
|
| 38 | -} |
|
| 39 | -elseif ($action == 'Sell') { |
|
| 35 | + if ($hardware_id == HARDWARE_COMBAT) { |
|
| 36 | + $player->increaseHOF($amount, array('Forces', 'Bought', 'Combat Drones'), HOF_ALLIANCE); |
|
| 37 | + } |
|
| 38 | + if ($hardware_id == HARDWARE_SCOUT) { |
|
| 39 | + $player->increaseHOF($amount, array('Forces', 'Bought', 'Scout Drones'), HOF_ALLIANCE); |
|
| 40 | + } |
|
| 41 | + if ($hardware_id == HARDWARE_MINE) { |
|
| 42 | + $player->increaseHOF($amount, array('Forces', 'Bought', 'Mines'), HOF_ALLIANCE); |
|
| 43 | + } |
|
| 44 | + } elseif ($action == 'Sell') { |
|
| 40 | 45 | // We only allow selling combat drones |
| 41 | 46 | if ($hardware_id != HARDWARE_COMBAT) { |
| 42 | 47 | throw new Exception('This item cannot be sold!'); |