Passed
Push — trunk ( 338765...433e05 )
by SuperNova.WS
04:23
created
includes/alliance/ali_internal_admin_mail.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 global $lang;
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
6 6
 {
7 7
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
8 8
 }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 $page = gettemplate('ali_admin_mail', true);
21 21
 
22 22
 if ($ranks) {
23
-  foreach($ranks as $id => $array) {
23
+  foreach ($ranks as $id => $array) {
24 24
     $page->assign_block_vars('ranks', array(
25 25
       'NAME' => $array['name'],
26 26
       'VALUE' => $id,
Please login to merge, or discard this patch.
jumpgate.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -14,39 +14,39 @@  discard block
 block discarded – undo
14 14
 
15 15
 lng_include('fleet');
16 16
 
17
-if($TargetPlanet = sys_get_param_id('jmpto'))
17
+if ($TargetPlanet = sys_get_param_id('jmpto'))
18 18
 {
19 19
   sn_db_transaction_start();
20 20
   db_user_by_id($user['id'], true, 'id');
21 21
   $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true);
22
-  if(!($NextJumpTime = uni_get_time_to_jump($planetrow)))
22
+  if (!($NextJumpTime = uni_get_time_to_jump($planetrow)))
23 23
   {
24 24
     $TargetGate = DBStaticPlanet::db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`');
25
-    if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0)
25
+    if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0)
26 26
     {
27
-      $NextDestTime = uni_get_time_to_jump ( $TargetGate );
28
-      if(!$NextDestTime)
27
+      $NextDestTime = uni_get_time_to_jump($TargetGate);
28
+      if (!$NextDestTime)
29 29
       {
30 30
         // $SubQueryOri = "";
31 31
         // $SubQueryDes = "";
32 32
         $ship_list = sys_get_param('ships');
33 33
         $db_changeset = array();
34
-        foreach($ship_list as $ship_id => $ship_count)
34
+        foreach ($ship_list as $ship_id => $ship_count)
35 35
         {
36
-          if(!in_array($ship_id, sn_get_groups('fleet')))
36
+          if (!in_array($ship_id, sn_get_groups('fleet')))
37 37
           {
38 38
             continue;
39 39
           }
40 40
 
41 41
           $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id)));
42
-          if($ship_count)
42
+          if ($ship_count)
43 43
           {
44 44
             $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($ship_id, -$ship_count, $user, $planetrow['id']);
45 45
             $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($ship_id, $ship_count, $user, $TargetGate['id']);
46 46
           }
47 47
         }
48 48
         // Dit monsieur, y avait quelque chose a envoyer ???
49
-        if(!empty($db_changeset))
49
+        if (!empty($db_changeset))
50 50
         {
51 51
           DBStaticPlanet::db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = " . SN_TIME_NOW . "");
52 52
           DBStaticPlanet::db_planet_set_by_id($planetrow['id'], "`last_jump_time` = " . SN_TIME_NOW . "");
@@ -55,31 +55,31 @@  discard block
 block discarded – undo
55 55
           db_user_set_by_id($user['id'], "`current_planet` = '{$TargetGate['id']}'");
56 56
 
57 57
           $planetrow['last_jump_time'] = SN_TIME_NOW;
58
-          $RetMessage = $lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow));
58
+          $RetMessage = $lang['gate_jump_done'] . " - " . pretty_time(uni_get_time_to_jump($planetrow));
59 59
         } else {
60 60
           $RetMessage = $lang['gate_wait_data'];
61 61
         }
62 62
       } else {
63
-        $RetMessage = $lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime);
63
+        $RetMessage = $lang['gate_wait_dest'] . " - " . pretty_time($NextDestTime);
64 64
       }
65 65
     } else {
66 66
       $RetMessage = $lang['gate_no_dest_g'];
67 67
     }
68 68
   } else {
69
-    $RetMessage = $lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime);
69
+    $RetMessage = $lang['gate_wait_star'] . " - " . pretty_time($NextJumpTime);
70 70
   }
71 71
   sn_db_transaction_commit();
72 72
   messageBox($RetMessage, $lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10);
73 73
 } else {
74 74
   $template = gettemplate('jumpgate', true);
75
-  if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0)
75
+  if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0)
76 76
   {
77 77
     $Combo = '';
78 78
     $MoonList = DBStaticPlanet::db_planet_list_moon_other($user['id'], $planetrow['id']);
79 79
     // while($CurMoon = db_fetch($MoonList))
80
-    foreach($MoonList as $CurMoon)
80
+    foreach ($MoonList as $CurMoon)
81 81
     {
82
-      if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1)
82
+      if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1)
83 83
       {
84 84
         $NextJumpTime = uni_get_time_to_jump($CurMoon);
85 85
         $template->assign_block_vars('moon', array(
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
       }
94 94
     }
95 95
 
96
-    foreach(sn_get_groups('fleet') as $Ship)
96
+    foreach (sn_get_groups('fleet') as $Ship)
97 97
     {
98
-      if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0)
98
+      if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0)
99 99
       {
100 100
         continue;
101 101
       }
Please login to merge, or discard this patch.
includes/alliance/ali_external_request.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
4 4
 {
5 5
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
6 6
 }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     sys_redirect('alliance.php');
21 21
   }
22 22
 
23
-  if($user_request['request_denied'])
23
+  if ($user_request['request_denied'])
24 24
   {
25 25
     $lang['request_text'] = sprintf($lang['ali_req_deny_msg'], $ally['ally_tag'], $user_request['request_text']);
26 26
   }
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 
44 44
 $ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$id_ally}'", true);
45 45
 
46
-if(!$ally)
46
+if (!$ally)
47 47
 {
48 48
   messageBox($lang['ali_sys_notFound'], $lang['ali_req_title']);
49 49
 }
50 50
 
51
-if($ally['ally_request_notallow'])
51
+if ($ally['ally_request_notallow'])
52 52
 {
53 53
   messageBox($lang['ali_req_not_allowed'], $lang['ali_req_title']);
54 54
 }
Please login to merge, or discard this patch.
includes/alliance/ali_external_create_ally.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 // Pretty Safe
3 3
 // TODO: Add ally_tag to usertable
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
6 6
 {
7 7
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
8 8
 }
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
 $ally_name_raw = sys_get_param_str_unsafe('name');
13 13
 $ally_name     = db_escape($ally_name_raw);
14 14
 
15
-if($ally_tag)
15
+if ($ally_tag)
16 16
 {
17
-  if(!$ally_name_raw || !$ally_tag_raw)
17
+  if (!$ally_name_raw || !$ally_tag_raw)
18 18
   {
19 19
     messageBox($lang['have_not_name'], $lang['make_alliance']);
20 20
   }
21 21
 
22 22
   $query = doquery("SELECT ally_tag FROM {{alliance}} WHERE `ally_tag` = '{$ally_tag}' or `ally_name` = '{$ally_name}' LIMIT 1;", true);
23
-  if($query)
23
+  if ($query)
24 24
   {
25 25
     messageBox(str_replace('%s', $query['ally_tag'] == $ally_tag_raw ? $ally_tag_raw : $ally_name_raw, $lang['always_exist']), $lang['make_alliance']);
26 26
   }
Please login to merge, or discard this patch.
phalanx.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 $sensorLevel = mrc_get_level($user, $planetrow, STRUC_MOON_PHALANX);
20 20
 if (!intval($sensorLevel)) {
21
-  messageBox ($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
21
+  messageBox($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
22 22
 }
23 23
 
24 24
 if ($planetrow['planet_type'] != PT_MOON) {
25
-  messageBox ($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
25
+  messageBox($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
26 26
 }
27 27
 
28 28
 $scan_galaxy  = sys_get_param_int('galaxy');
29 29
 $scan_system  = sys_get_param_int('system');
30 30
 $scan_planet  = sys_get_param_int('planet');
31
-$scan_planet_type  = 1; // sys_get_param_int('planettype');
31
+$scan_planet_type = 1; // sys_get_param_int('planettype');
32 32
 $id = sys_get_param_id('id');
33 33
 
34 34
 $source_galaxy = $planetrow['galaxy'];
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 $sensorRange = GetPhalanxRange($sensorLevel);
39 39
 
40 40
 $system_distance = abs($source_system - $scan_system);
41
-if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
41
+if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
42 42
 {
43
-  messageBox ($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
43
+  messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
44 44
 }
45 45
 
46 46
 $cost = $sensorLevel * 1000;
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type);
54
-if(!$planet_scanned['id'])
54
+if (!$planet_scanned['id'])
55 55
 {
56 56
   messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
57 57
 }
58 58
 
59
-if($planet_scanned['destruyed'])
59
+if ($planet_scanned['destruyed'])
60 60
 {
61
-  messageBox ($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
61
+  messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
62 62
 }
63 63
 
64 64
 DBStaticPlanet::db_planet_set_by_id($user['current_planet'], "deuterium = deuterium - {$cost}");
Please login to merge, or discard this patch.
admin/adm_planet_list.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('INSIDE'  , true);
4
-define('INSTALL' , false);
3
+define('INSIDE', true);
4
+define('INSTALL', false);
5 5
 define('IN_ADMIN', true);
6 6
 
7 7
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
12 12
 
13 13
 $planet_active = sys_get_param_int('planet_active');
14
-if(!$planet_active) {
14
+if (!$planet_active) {
15 15
   $planet_type = sys_get_param_int('planet_type', 1);
16 16
   $planet_type = $planet_type == 3 ? 3 : 1;
17 17
 } else {
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 $page_title = 
42 42
   $lang['adm_planet_list_title'] . ': ' . 
43
-  ($planet_active ? $lang['adm_planet_active'] :
44
-    ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
43
+  ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
45 44
   );
46 45
 $template->assign_vars(array(
47 46
   'PAGE_TITLE' => $page_title,
Please login to merge, or discard this patch.
admin/adm_log_main.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,26 +18,26 @@  discard block
 block discarded – undo
18 18
 
19 19
 messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
20 20
 
21
-if($delete = sys_get_param_id('delete'))
21
+if ($delete = sys_get_param_id('delete'))
22 22
 {
23 23
   doquery("DELETE FROM `{{logs}}` WHERE `log_id` = {$delete} LIMIT 1;");
24 24
 }
25
-elseif(sys_get_param_str('delete_update_info'))
25
+elseif (sys_get_param_str('delete_update_info'))
26 26
 {
27 27
   doquery("DELETE FROM `{{logs}}` WHERE `log_code` in (103, 180, 191);");
28 28
 }
29
-elseif(sys_get_param_str('deleteall') == 'yes')
29
+elseif (sys_get_param_str('deleteall') == 'yes')
30 30
 {
31 31
 //  doquery("TRUNCATE TABLE `{{logs}}`");
32 32
 }
33 33
 
34
-if($detail = sys_get_param_id('detail'))
34
+if ($detail = sys_get_param_id('detail'))
35 35
 {
36 36
   $template = gettemplate('admin/adm_log_main_detail', true);
37 37
 
38 38
   $errorInfo = doquery("SELECT * FROM `{{logs}}` WHERE `log_id` = {$detail} LIMIT 1;", true);
39 39
   $error_dump = unserialize($errorInfo['log_dump']);
40
-  if(is_array($error_dump))
40
+  if (is_array($error_dump))
41 41
   {
42 42
     foreach ($error_dump as $key => $value)
43 43
     {
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 
58 58
   $i = 0;
59 59
   $query = doquery("SELECT * FROM `{{logs}}` ORDER BY log_id DESC LIMIT 100;");
60
-  while($u = db_fetch($query))
60
+  while ($u = db_fetch($query))
61 61
   {
62 62
     $i++;
63 63
     $v = array();
64
-    foreach($u as $key => $value)
64
+    foreach ($u as $key => $value)
65 65
     {
66 66
       $v[strtoupper($key)] = $value;
67 67
     }
Please login to merge, or discard this patch.
classes/Core/Watchdog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     $configValue = $forceLoad ? $this->config->db_loadItem($configName) : $this->config[$configName];
36 36
     $configType == WATCHDOG_TIME_SQL ? $configValue = strtotime($configValue, SN_TIME_NOW) : false;
37 37
 
38
-    if(SN_TIME_NOW - $configValue > $timeDiff) {
38
+    if (SN_TIME_NOW - $configValue > $timeDiff) {
39 39
       $callable();
40 40
     }
41 41
 
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_rights.inc 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 global $lang, $debug;
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
6 6
 {
7 7
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
8 8
 }
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 if ($new_rank_name = sys_get_param_str('newRankName'))
17 17
 {
18
-  foreach($ally_rights as $fieldName)
18
+  foreach ($ally_rights as $fieldName)
19 19
   {
20 20
     $newRank[$fieldName] = 0;
21 21
   }
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 {
29 29
   unset($ranks);
30 30
 
31
-  foreach($rankListInput as $rankID => $rank)
31
+  foreach ($rankListInput as $rankID => $rank)
32 32
   {
33
-    foreach($ally_rights as $rightName)
33
+    foreach ($ally_rights as $rightName)
34 34
     {
35 35
       $ranks[$rankID][$rightName] = $rank[$rightName] ? 1 : 0;
36 36
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $d = sys_get_param_int('d');
42 42
 if ($d && isset($ranks[$d]))
43 43
 {
44
-  if(count($ranks) == 1)
44
+  if (count($ranks) == 1)
45 45
   {
46 46
     messageBox($lang['ali_adm_lastRank'], $lang['ali_adm_rights_title']);
47 47
   }
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 
54 54
 if (count($ranks))
55 55
 {
56
-  foreach($ranks as $rankID => $rank)
56
+  foreach ($ranks as $rankID => $rank)
57 57
   {
58 58
     $rank_data = array(
59 59
       'ID'   => $rankID,
60 60
       'NAME' => $rank['name'],
61 61
     );
62 62
 
63
-    for($i = 1; $i < count($rank); $i++)
63
+    for ($i = 1; $i < count($rank); $i++)
64 64
     {
65
-      $rank_data['R' . $i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : '') ;
65
+      $rank_data['R' . $i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : '');
66 66
       $rank_data['N' . $i] = $ally_rights[$i];
67 67
     }
68 68
 
Please login to merge, or discard this patch.