Completed
Branch work-fleets (1ceb9c)
by SuperNova.WS
04:37
created
includes/vars.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
   SNC_VER_ERROR_MISSMATCH_KEY_ID => 'error',
98 98
 );
99 99
 
100
-$tableList = array( 'aks', 'alliance', 'alliance_requests', 'announce', 'annonce', 'banned', 'buddy', 'chat', 'config', 'counter',
100
+$tableList = array('aks', 'alliance', 'alliance_requests', 'announce', 'annonce', 'banned', 'buddy', 'chat', 'config', 'counter',
101 101
   'errors', 'fleets', 'fleet_log', 'galaxy', 'iraks', 'logs', 'log_dark_matter', 'messages', 'notes', 'planets', 'quest',
102 102
   'quest_status', 'referrals', 'rw', 'statpoints', 'users'
103 103
 );
@@ -188,14 +188,14 @@  discard block
 block discarded – undo
188 188
 $user_option_list = array();
189 189
 
190 190
 $user_option_list[OPT_MESSAGE] = array();
191
-foreach($sn_message_class_list as $message_class_id => $message_class_data)
191
+foreach ($sn_message_class_list as $message_class_id => $message_class_data)
192 192
 {
193
-  if($message_class_data['switchable'])
193
+  if ($message_class_data['switchable'])
194 194
   {
195 195
     $user_option_list[OPT_MESSAGE]["opt_{$message_class_data['name']}"] = 1;
196 196
   }
197 197
 
198
-  if($message_class_data['email'])
198
+  if ($message_class_data['email'])
199 199
   {
200 200
     $user_option_list[OPT_MESSAGE]["opt_email_{$message_class_data['name']}"] = 0;
201 201
   }
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_HYDROGEN,
779 779
         UNIT_PLANET_DENSITY_RARITY => 30, // 1, // 40.00, // * 1/121 0,82645
780 780
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT,
781
-        UNIT_RESOURCES => array(RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10, ),
781
+        UNIT_RESOURCES => array(RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10,),
782 782
         UNIT_PLANET_DENSITY_MAX_SECTORS => 150,
783 783
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
784 784
       ),
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_METHANE,
788 788
         UNIT_PLANET_DENSITY_RARITY =>  130, // 6, // 6.67, // * 6,0	4,95868
789 789
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD,
790
-        UNIT_RESOURCES => array(RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60, ),
790
+        UNIT_RESOURCES => array(RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60,),
791 791
         UNIT_PLANET_DENSITY_MAX_SECTORS => 200,
792 792
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
793 793
       ),
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_ICE_WATER,
797 797
         UNIT_PLANET_DENSITY_RARITY =>  450, //20, // 2.00, // * 20,0	16,52893
798 798
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE,
799
-        UNIT_RESOURCES => array(RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20, ),
799
+        UNIT_RESOURCES => array(RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20,),
800 800
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
801 801
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
802 802
       ),
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_RAW,
807 807
         UNIT_PLANET_DENSITY_RARITY => 20, // 1, // 40.00, // *1,0	0,82645
808 808
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT,
809
-        UNIT_RESOURCES => array(RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50, ),
809
+        UNIT_RESOURCES => array(RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50,),
810 810
         UNIT_PLANET_DENSITY_MAX_SECTORS => 150,
811 811
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
812 812
       ),
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_SILICATE,
816 816
         UNIT_PLANET_DENSITY_RARITY => 140, // 5.71, // * 7,0	5,78512
817 817
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD,
818
-        UNIT_RESOURCES => array(RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85, ),
818
+        UNIT_RESOURCES => array(RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85,),
819 819
         UNIT_PLANET_DENSITY_MAX_SECTORS => 200,
820 820
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
821 821
       ),
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_CRYSTAL_STONE,
825 825
         UNIT_PLANET_DENSITY_RARITY => 500, // 1.90, // * 21,0	17,35537
826 826
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE,
827
-        UNIT_RESOURCES => array(RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95, ),
827
+        UNIT_RESOURCES => array(RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95,),
828 828
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
829 829
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
830 830
       ),
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_STANDARD,
835 835
         UNIT_PLANET_DENSITY_RARITY => 1000, // 1.0, // * 40,0	33,05785
836 836
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_NORMAL,
837
-        UNIT_RESOURCES => array(RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00, ),
837
+        UNIT_RESOURCES => array(RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00,),
838 838
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
839 839
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
840 840
       ),
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_ORE,
845 845
         UNIT_PLANET_DENSITY_RARITY => 550, // 2.11, // * 19,0	15,70248
846 846
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_AVERAGE,
847
-        UNIT_RESOURCES => array(RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80, ),
847
+        UNIT_RESOURCES => array(RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80,),
848 848
         UNIT_PLANET_DENSITY_MAX_SECTORS => 999,
849 849
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
850 850
       ),
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_PERIDOT,
854 854
         UNIT_PLANET_DENSITY_RARITY => 120, // 8.00, // * 5,0	4,13223
855 855
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_GOOD,
856
-        UNIT_RESOURCES => array(RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55, ),
856
+        UNIT_RESOURCES => array(RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55,),
857 857
         UNIT_PLANET_DENSITY_MAX_SECTORS => 200,
858 858
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
859 859
       ),
@@ -862,7 +862,7 @@  discard block
 block discarded – undo
862 862
         UNIT_PLANET_DENSITY_INDEX => PLANET_DENSITY_METAL_RAW,
863 863
         UNIT_PLANET_DENSITY_RARITY => 25, // 40.00, // * 1,0	0,82645
864 864
         UNIT_PLANET_DENSITY_RICHNESS => PLANET_DENSITY_RICHNESS_PERFECT,
865
-        UNIT_RESOURCES => array(RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25, ),
865
+        UNIT_RESOURCES => array(RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25,),
866 866
         UNIT_PLANET_DENSITY_MAX_SECTORS => 150,
867 867
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
868 868
       ),
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
     ),
993 993
 
994 994
     // Tech list
995
-    'tech'      => array (
995
+    'tech'      => array(
996 996
       TECH_ARMOR => TECH_ARMOR, TECH_WEAPON => TECH_WEAPON, TECH_SHIELD => TECH_SHIELD,
997 997
       TECH_SPY => TECH_SPY, TECH_COMPUTER => TECH_COMPUTER,
998 998
       TECH_ENERGY => TECH_ENERGY, TECH_LASER => TECH_LASER, TECH_ION => TECH_ION, TECH_PLASMA => TECH_PLASMA, TECH_HYPERSPACE => TECH_HYPERSPACE,
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
     ),
1004 1004
 
1005 1005
     // Mercenaries
1006
-    'mercenaries' => array (
1006
+    'mercenaries' => array(
1007 1007
       MRC_STOCKMAN => MRC_STOCKMAN, MRC_SPY => MRC_SPY, MRC_ACADEMIC => MRC_ACADEMIC,
1008 1008
       MRC_ADMIRAL => MRC_ADMIRAL, MRC_COORDINATOR => MRC_COORDINATOR, MRC_NAVIGATOR => MRC_NAVIGATOR,
1009 1009
     ),
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
       SHIP_RECYCLER => SHIP_RECYCLER, SHIP_COLONIZER => SHIP_COLONIZER, SHIP_SPY => SHIP_SPY, SHIP_SATTELITE_SOLAR => SHIP_SATTELITE_SOLAR
1030 1030
      ),
1031 1031
     // Defensive building list
1032
-    'defense'   => array (UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL,
1032
+    'defense'   => array(UNIT_DEF_TURRET_MISSILE => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL,
1033 1033
                           UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS,
1034 1034
                           UNIT_DEF_TURRET_ION => UNIT_DEF_TURRET_ION, UNIT_DEF_TURRET_PLASMA => UNIT_DEF_TURRET_PLASMA,
1035 1035
 
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
     ),
1040 1040
 
1041 1041
     // Missiles list
1042
-    'missile'   => array (UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET, ),
1042
+    'missile'   => array(UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET,),
1043 1043
 
1044 1044
     // Combat units list
1045 1045
     'combat'    => array(
@@ -1079,9 +1079,9 @@  discard block
 block discarded – undo
1079 1079
     ),
1080 1080
 
1081 1081
     // Resource list
1082
-    'resources' => array ( 0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'),
1082
+    'resources' => array(0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'),
1083 1083
     // Resources all
1084
-    'resources_all' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER, ),
1084
+    'resources_all' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER,),
1085 1085
     // Resources can be produced on planet
1086 1086
     'resources_planet' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY),
1087 1087
     // Resources can be looted from planet
@@ -1100,13 +1100,13 @@  discard block
 block discarded – undo
1100 1100
     ),
1101 1101
 
1102 1102
     // Resources that can be tradeable in market trader AND be a quest_rewards
1103
-    'quest_rewards' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER, ),
1103
+    'quest_rewards' => array(RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER,),
1104 1104
 
1105 1105
 //      // Ques list
1106 1106
 //      'ques' => array(QUE_STRUCTURES, QUE_HANGAR, QUE_RESEARCH),
1107 1107
 
1108
-    'STAT_COMMON' => array(STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE, ),
1109
-    'STAT_PLAYER' => array(STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID, ),
1108
+    'STAT_COMMON' => array(STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE,),
1109
+    'STAT_PLAYER' => array(STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID,),
1110 1110
   ),
1111 1111
 
1112 1112
   'pages' => array(
Please login to merge, or discard this patch.
includes/db/db_queries_unit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     'GROUP BY `unit_snid`'
27 27
   );
28 28
   $result = array();
29
-  while($row = db_fetch($query)) {
29
+  while ($row = db_fetch($query)) {
30 30
     $result[$row['unit_snid']] = $row;
31 31
   }
32 32
 
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
@@ -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
 }
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 $new_rank_name = sys_get_param_str('newRankName');
15 15
 if ($new_rank_name)
16 16
 {
17
-  foreach($ally_rights as $fieldName)
17
+  foreach ($ally_rights as $fieldName)
18 18
   {
19 19
     $newRank[$fieldName] = 0;
20 20
   }
@@ -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
     message($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.
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
     header('Location: 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
   }
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
 $ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$id_ally}'", true);
44 44
 
45
-if(!$ally)
45
+if (!$ally)
46 46
 {
47 47
   message($lang['ali_sys_notFound'], $lang['ali_req_title']);
48 48
 }
49 49
 
50
-if($ally['ally_request_notallow'])
50
+if ($ally['ally_request_notallow'])
51 51
 {
52 52
   message($lang['ali_req_not_allowed'], $lang['ali_req_title']);
53 53
 }
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_request.inc 1 patch
Spacing   +3 added lines, -3 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
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
5 5
 }
6 6
 
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 }
10 10
 
11 11
 $d = sys_get_param_id('d');
12
-if($d) {
12
+if ($d) {
13 13
   doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '{$lang['ali_req_deny_reason']}' WHERE `id_user`= {$d} LIMIT 1;");
14 14
 }
15 15
 
16 16
 $id_user = sys_get_param_id('id_user');
17
-if($id_user) {
17
+if ($id_user) {
18 18
   $ally_name_safe = db_escape($ally['ally_name']);
19 19
   $ally_tag_safe = db_escape($ally['ally_tag']);
20 20
   db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = " . SN_TIME_NOW . ", `ally_rank_id` = 0");
Please login to merge, or discard this patch.
includes/includes/flt_page5.inc 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 *
13 13
 **/
14 14
 
15
-if(SN_IN_FLEET !== true) {
15
+if (SN_IN_FLEET !== true) {
16 16
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
17 17
 }
18 18
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
   $planet_list = array();
27 27
 
28
-  if(is_array($resources_taken))
28
+  if (is_array($resources_taken))
29 29
   {
30 30
     $query = implode(',', array_keys($resources_taken));
31 31
     $query = " AND `destruyed` = 0 AND `id` IN ({$query})";
@@ -33,16 +33,16 @@  discard block
 block discarded – undo
33 33
     $query = '';
34 34
   }
35 35
 
36
-  foreach(sn_get_groups('flt_transports') as $transport_id) {
36
+  foreach (sn_get_groups('flt_transports') as $transport_id) {
37 37
     $transports[$transport_id] = get_unit_param($transport_id, P_CAPACITY);
38 38
   }
39 39
   arsort($transports);
40 40
 
41 41
   $planets_db_list = db_planet_list_sorted($user, $planetrow['id'], '*', $query);
42 42
   !is_array($planets_db_list) ? $planets_db_list = array() : false;
43
-  foreach($planets_db_list as $planet_db_data) {
43
+  foreach ($planets_db_list as $planet_db_data) {
44 44
   // begin planet loop
45
-    if(!$query) {
45
+    if (!$query) {
46 46
       $resources_taken[$planet_db_data['id']] = 1;
47 47
     }
48 48
     sn_db_transaction_start();
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     $planet_id = $planet_db_data['id'];
55 55
 
56 56
     $planet_resources = 0;
57
-    foreach(sn_get_groups('resources_loot') as $resource_id) {
58
-      if($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) {
57
+    foreach (sn_get_groups('resources_loot') as $resource_id) {
58
+      if ($resources_taken[$planet_id] == 1 || $resources_taken[$planet_id][$resource_id]) {
59 59
         $planet_resources += floor(mrc_get_level($user, $planet_db_data, $resource_id, true, true)); // $planet_db_data[get_unit_param($resource_id, P_NAME)]);
60 60
       }
61 61
     }
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
     $fleet_capacity = 0;
87 87
     $ship_loadout = array();
88 88
     $fleet = array();
89
-    foreach($transports as $ship_id => $ship_capacity) {
90
-      if($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) {
89
+    foreach ($transports as $ship_id => $ship_capacity) {
90
+      if ($ship_count = mrc_get_level($user, $planet_db_data, $ship_id, true, true)) {
91 91
         $ship_loadout[$ship_id]['capacity'] = $ship_count * $ship_capacity;
92 92
         $ship_loadout[$ship_id]['taken'] = 0;
93 93
         $fleet_capacity += $ship_loadout[$ship_id]['capacity'];
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
     $will_take = min($planet_resources, $fleet_capacity);
100 100
 
101
-    foreach($ship_loadout as $ship_id => &$planet_ship) {
101
+    foreach ($ship_loadout as $ship_id => &$planet_ship) {
102 102
       $can_take = min($will_take, $planet_ship['capacity']);
103
-      if($can_take <= 0) {
103
+      if ($can_take <= 0) {
104 104
         continue;
105 105
       }
106 106
       $planet_ship['capacity'] -= $can_take;
@@ -108,23 +108,23 @@  discard block
 block discarded – undo
108 108
       $fleet[$ship_id] = ceil($planet_ship['taken'] / $transports[$ship_id]);
109 109
 
110 110
       $will_take -= $can_take;
111
-      if($will_take <= 0) {
111
+      if ($will_take <= 0) {
112 112
         break;
113 113
       }
114 114
     }
115 115
 
116
-    if(!empty($fleet)) {
116
+    if (!empty($fleet)) {
117 117
       $travel_data = flt_travel_data($user, $planetrow, $planet_db_data, $fleet, 10);
118 118
       $planet_data['FLEET_SPEED'] = $travel_data['fleet_speed'];
119 119
       $planet_data['DISTANCE']    = $travel_data['distance'];
120 120
       $planet_data['DURATION']    = $travel_data['duration'];
121 121
       $planet_data['CONSUMPTION'] = $travel_data['consumption'];
122 122
 
123
-      if(floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) {
123
+      if (floor(mrc_get_level($user, $planet_db_data, RES_DEUTERIUM, true)) >= $planet_data['CONSUMPTION']) {
124 124
         $will_take = min($planet_resources, $fleet_capacity) - $planet_data['CONSUMPTION'];
125 125
 
126
-        foreach(sn_get_groups('resources_loot') as $resource_id) {
127
-          if($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) {
126
+        foreach (sn_get_groups('resources_loot') as $resource_id) {
127
+          if ($resources_taken[$planet_id] != 1 && !$resources_taken[$planet_id][$resource_id]) {
128 128
             continue;
129 129
           }
130 130
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
           $fleet[$resource_id] = min($will_take, $resource_amount);
134 134
           $will_take -= $resource_amount;
135 135
 
136
-          if($will_take <= 0) {
136
+          if ($will_take <= 0) {
137 137
             break;
138 138
           }
139 139
         }
@@ -157,19 +157,19 @@  discard block
 block discarded – undo
157 157
 
158 158
 $resources_taken = sys_get_param('resources');
159 159
 
160
-if(!empty($resources_taken))  { // begin processing parameters
160
+if (!empty($resources_taken)) { // begin processing parameters
161 161
   $planet_list = flt_build_gathering($resources_taken);
162 162
 
163
-  foreach($planet_list as $planet_id => $planet_data) {
164
-    if($planet_data['RESULT'] == ATTACK_ALLOWED) {
163
+  foreach ($planet_list as $planet_id => $planet_data) {
164
+    if ($planet_data['RESULT'] == ATTACK_ALLOWED) {
165 165
       $planet_data['RESULT'] = flt_t_send_fleet($user, $planet_data['PLANET_DB_DATA'], $planetrow, $planet_data['FLEET'], MT_TRANSPORT);
166 166
     }
167 167
 
168 168
     $planet_data['MESSAGE'] = $lang['fl_attack_error'][$planet_data['RESULT']];
169 169
 
170 170
     $template->assign_block_vars('results', $planet_data);
171
-    if(!empty($planet_data['FLEET']) && $planet_data['RESULT'] == ATTACK_ALLOWED) {
172
-      foreach($planet_data['FLEET'] as $unit_id => $amount) {
171
+    if (!empty($planet_data['FLEET']) && $planet_data['RESULT'] == ATTACK_ALLOWED) {
172
+      foreach ($planet_data['FLEET'] as $unit_id => $amount) {
173 173
         $template->assign_block_vars('results.units', array(
174 174
           'ID'     => $unit_id,
175 175
           'NAME'   => $lang['tech'][$unit_id],
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 // Building list of own planets & moons
184 184
 $planet_list = flt_build_gathering();
185
-foreach($planet_list as $planet_data) {
185
+foreach ($planet_list as $planet_data) {
186 186
   $planet_data['DURATION'] = $planet_data['DURATION'] ? pretty_time($planet_data['DURATION']) : $lang['flt_no_fuel'];
187 187
   $template->assign_block_vars('colonies', $planet_data);
188 188
 }
Please login to merge, or discard this patch.
includes/includes/market_trader.inc 1 patch
Spacing   +14 added lines, -14 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_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) {
3
+if ((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) {
4 4
   $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403);
5 5
 }
6 6
 
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
   // $dm_db_name = pname_resource_name(RES_DARK_MATTER);
29 29
   $exchangeTo = in_array($exchangeTo = sys_get_param_int('exchangeTo'), sn_get_groups('resources_trader')) ? $exchangeTo : 0;
30
-  if($exchangeTo && is_array($tradeList = $_POST['spend'])) {
30
+  if ($exchangeTo && is_array($tradeList = $_POST['spend'])) {
31 31
     $value = 0;
32 32
     $qry = array();
33 33
 
34 34
     sn_db_transaction_start();
35
-    if($planetrow['id_owner']) {
35
+    if ($planetrow['id_owner']) {
36 36
       $global_data = sys_o_get_updated($user, $planetrow, SN_TIME_NOW);
37 37
       $planetrow = $global_data['planet'];
38 38
     }
@@ -41,27 +41,27 @@  discard block
 block discarded – undo
41 41
       $user = db_user_by_id($user['id'], true);
42 42
     }
43 43
 
44
-    foreach(sn_get_groups('resources_trader') as $resource_id) {
44
+    foreach (sn_get_groups('resources_trader') as $resource_id) {
45 45
       $amount = floatval($tradeList[$resource_id]);
46
-      if($amount < 0) {
46
+      if ($amount < 0) {
47 47
         $debug->error('Trying to supply negative resource amount on Black Market Page', 'Hack Attempt', 305);
48 48
       }
49 49
 
50
-      if($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) {
50
+      if ($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) {
51 51
         continue;
52 52
       }
53 53
 
54 54
       $resource_db_name = pname_resource_name($resource_id);
55
-      if($exchangeTo == RES_DARK_MATTER) {
55
+      if ($exchangeTo == RES_DARK_MATTER) {
56 56
         $sign = '+';
57 57
         $amount = floor($tradeList[RES_DARK_MATTER] / 3 * $rates[RES_DARK_MATTER] / $rates[$resource_id]);
58 58
         $value += $amount;
59 59
       } else {
60 60
         $value += floor($amount * $rates[$resource_id] / $rates[$exchangeTo]);
61
-        if($resource_id == RES_DARK_MATTER) {
61
+        if ($resource_id == RES_DARK_MATTER) {
62 62
           $amount = 0;
63 63
         } else {
64
-          if(mrc_get_level($user, $planetrow, $resource_id, true) < $amount) {
64
+          if (mrc_get_level($user, $planetrow, $resource_id, true) < $amount) {
65 65
             $intError = MARKET_NO_RESOURCES;
66 66
             break;
67 67
           }
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
         }
71 71
       }
72 72
 
73
-      if($amount) {
73
+      if ($amount) {
74 74
         $qry[] = "`{$resource_db_name}` = `{$resource_db_name}` {$sign} {$amount}";
75 75
       }
76 76
     }
77 77
 
78
-    if($exchangeTo != RES_DARK_MATTER) {
78
+    if ($exchangeTo != RES_DARK_MATTER) {
79 79
       $amount = floor($value);
80 80
       $exchange_to_db_name = pname_resource_name($exchangeTo);
81 81
       $qry[] = "`{$exchange_to_db_name}` = `{$exchange_to_db_name}` + {$amount}";
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     $intError = $value <= 0 ? MARKET_ZERO_DEAL : $intError;
87 87
     $intError = mrc_get_level($user, null, RES_DARK_MATTER) < $operation_cost ? MARKET_NO_DM : $intError;
88 88
 
89
-    if($intError == MARKET_DEAL) {
89
+    if ($intError == MARKET_DEAL) {
90 90
       $qry = implode(', ', $qry);
91 91
       $table = $planetrow['id_owner'] ? 'planets' : 'users';
92 92
 
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
     'EXCHANGE_TO_RESOURCE_ID' => $exchangeTo,
112 112
   ));
113 113
 
114
-  foreach(sn_get_groups('resources_trader') as $resource_id) {
115
-    if($resource_id == RES_DARK_MATTER) {
114
+  foreach (sn_get_groups('resources_trader') as $resource_id) {
115
+    if ($resource_id == RES_DARK_MATTER) {
116 116
       $amount = floor(mrc_get_level($user, null, RES_DARK_MATTER) - $config->rpg_cost_trader);
117 117
     } else {
118 118
       $amount = floor(mrc_get_level($user, $planetrow, $resource_id));
Please login to merge, or discard this patch.
includes/includes/flt_page1.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@  discard block
 block discarded – undo
4 4
 // @version 1.0
5 5
 // @copyright 2008 by Chlorel for XNova
6 6
 
7
-if(SN_IN_FLEET !== true) {
7
+if (SN_IN_FLEET !== true) {
8 8
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
9 9
 }
10 10
 
11 11
 $template = gettemplate('fleet1', true);
12 12
 
13 13
 $ships = sys_get_param('ships', array());
14
-if(!is_array($ships)) {
14
+if (!is_array($ships)) {
15 15
   $ships = array();
16 16
 }
17 17
 
18
-foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
18
+foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
19 19
   $template->assign_block_vars('possible_planet_type_id', array(
20 20
     'ID' => $possible_planet_type_id,
21 21
     'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id],
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
   'START_NAME'         => $planetrow['name'],
29 29
 );
30 30
 
31
-if(!empty($TargetPlanet)) {
31
+if (!empty($TargetPlanet)) {
32 32
   $template_route += array(
33 33
     'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']],
34 34
     'END_COORDS'       => uni_render_coordinates($TargetPlanet),
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 $template->assign_block_vars('fleets', $template_route);
40 40
 
41 41
 $sn_groups_fleet = sn_get_groups('fleet');
42
-foreach($ships as $ship_id => $ship_count) {
43
-  if(in_array($ship_id, $sn_groups_fleet) && $ship_count) {
42
+foreach ($ships as $ship_id => $ship_count) {
43
+  if (in_array($ship_id, $sn_groups_fleet) && $ship_count) {
44 44
     $ship_info = get_unit_param($ship_id);
45
-    if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
45
+    if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
46 46
       $page .= $lang['fl_noenought'];
47 47
     } else {
48 48
       $fleet['fleetarray'][$ship_id]  = $ship_count;
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
   }
62 62
 }
63 63
 
64
-if(empty($fleet['fleetarray'])) {
64
+if (empty($fleet['fleetarray'])) {
65 65
   message($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5);
66 66
 }
67 67
 
68 68
 // Building list of shortcuts
69 69
 $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;");
70
-while($shortcut = db_fetch($query)) {
70
+while ($shortcut = db_fetch($query)) {
71 71
   $template->assign_block_vars('shortcut', array(
72 72
     'NAME'       => $shortcut['title'],
73 73
     'GALAXY'     => $shortcut['galaxy'],
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 }
82 82
 
83 83
 // Building list of own planets & moons
84
-$colonies = db_planet_list_sorted ( $user );
85
-if(count($colonies) > 1) {
84
+$colonies = db_planet_list_sorted($user);
85
+if (count($colonies) > 1) {
86 86
   // while($row = db_fetch($colonies))
87
-  foreach($colonies as $row) {
87
+  foreach ($colonies as $row) {
88 88
     $template->assign_block_vars('colonies', array(
89 89
       'NAME'       => $row['name'],
90 90
       'GALAXY'     => $row['galaxy'],
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 //ACS Start
100 100
 //Need to look for acs attacks.
101 101
 $aks_madnessred = doquery('SELECT * FROM {{aks}};');
102
-while($row = db_fetch($aks_madnessred)) {
102
+while ($row = db_fetch($aks_madnessred)) {
103 103
   $members = explode(',', $row['eingeladen']);
104
-  foreach($members as $a => $b) {
104
+  foreach ($members as $a => $b) {
105 105
     if ($b == $user['id']) {
106 106
       $template->assign_block_vars('acss', array(
107 107
         'ID'         => $row['id'],
Please login to merge, or discard this patch.
includes/includes/ube_zi_helpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
   print($round);
28 28
   print('<table border=1>');
29 29
   print('<tr align="left">');
30
-  foreach($header as $key => $value)
30
+  foreach ($header as $key => $value)
31 31
   {
32
-    if(is_array($value))
32
+    if (is_array($value))
33 33
     {
34 34
       continue;
35 35
     }
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
   );
62 62
 
63 63
   print('<tr align="right">');
64
-  foreach($debug_unit_crossfire_result as $key => $value)
64
+  foreach ($debug_unit_crossfire_result as $key => $value)
65 65
   {
66
-    if(is_array($value))
66
+    if (is_array($value))
67 67
     {
68 68
       continue;
69 69
     }
Please login to merge, or discard this patch.