Completed
Push — trunk ( 433e05...76e427 )
by SuperNova.WS
06:21
created
admin/adm_flying_fleets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 //while($CurrentFleet = db_fetch($FlyingFleets))
24 24
 
25 25
 $all_flying_fleets = DbFleetStatic::db_fleet_list('', DB_SELECT_PLAIN);
26
-foreach($all_flying_fleets as $fleet_id => $CurrentFleet) {
26
+foreach ($all_flying_fleets as $fleet_id => $CurrentFleet) {
27 27
   $FleetOwner = db_user_by_id($CurrentFleet['fleet_owner']);
28 28
   $TargetOwner = db_user_by_id($CurrentFleet['fleet_target_owner']);
29 29
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
   $fleet_data['fleet']['STAY_TIME_INT'] = $CurrentFleet['fleet_end_stay'];
35 35
 
36 36
   $template->assign_block_vars('fleets', $fleet_data['fleet']);
37
-  foreach($fleet_data['ships'] as $ship_data) {
37
+  foreach ($fleet_data['ships'] as $ship_data) {
38 38
     $template->assign_block_vars('fleets.ships', $ship_data);
39 39
   }
40 40
 }
Please login to merge, or discard this patch.
fleet.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 $planet = sys_get_param_int('planet', $planetrow['planet']);
45 45
 
46 46
 $target_mission = sys_get_param_int('target_mission');
47
-if($target_mission == MT_COLONIZE || $target_mission == MT_EXPLORE) {
47
+if ($target_mission == MT_COLONIZE || $target_mission == MT_EXPLORE) {
48 48
   $planet_type = PT_PLANET;
49
-} elseif($target_mission == MT_RECYCLE) {
49
+} elseif ($target_mission == MT_RECYCLE) {
50 50
   $planet_type = PT_DEBRIS;
51
-} elseif($target_mission == MT_DESTROY) {
51
+} elseif ($target_mission == MT_DESTROY) {
52 52
   $planet_type = PT_MOON;
53 53
 } else {
54 54
   $planet_type = sys_get_param_int('planet_type');
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
 //$FlyingFleets = doquery("SELECT COUNT(fleet_id) as Number FROM {{fleets}} WHERE `fleet_owner`='{$user['id']}'", true);
65 65
 //$FlyingFleets = $FlyingFleets['Number'];
66 66
 $FlyingFleets = DbFleetStatic::fleet_count_flying($user['id']);
67
-if($MaxFleets <= $FlyingFleets && $fleet_page && $fleet_page != 4) {
67
+if ($MaxFleets <= $FlyingFleets && $fleet_page && $fleet_page != 4) {
68 68
   messageBox($lang['fl_noslotfree'], $lang['fl_error'], "fleet." . PHP_EX, 5);
69 69
 }
70 70
 
71 71
 $MaxExpeditions = get_player_max_expeditons($user);
72
-if($MaxExpeditions) {
72
+if ($MaxExpeditions) {
73 73
 //  $FlyingExpeditions  = doquery("SELECT COUNT(fleet_owner) AS `expedi` FROM {{fleets}} WHERE `fleet_owner` = {$user['id']} AND `fleet_mission` = '" . MT_EXPLORE . "';", '', true);
74 74
 //  $FlyingExpeditions  = $FlyingExpeditions['expedi'];
75
-  $FlyingExpeditions  = DbFleetStatic::fleet_count_flying($user['id'], MT_EXPLORE);
75
+  $FlyingExpeditions = DbFleetStatic::fleet_count_flying($user['id'], MT_EXPLORE);
76 76
 } else {
77 77
   $FlyingExpeditions = 0;
78 78
 }
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
     $fleetarray     = json_decode(base64_decode(str_rot13(sys_get_param('usedfleet'))), true);
86 86
     $fleetarray = is_array($fleetarray) ? $fleetarray : array();
87 87
 
88
-    foreach($fleetarray as $ship_id => &$ship_amount) {
89
-      if(!in_array($ship_id, sn_get_groups('fleet')) || (string)floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
88
+    foreach ($fleetarray as $ship_id => &$ship_amount) {
89
+      if (!in_array($ship_id, sn_get_groups('fleet')) || (string) floatval($ship_amount) != $ship_amount || $ship_amount < 1) {
90 90
         $debug->warning('Supplying wrong ship in ship list on fleet page', 'Hack attempt', 302, array('base_dump' => true));
91 91
         die();
92 92
       }
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
           $target_mission = MT_COLONIZE;
118 118
           $planet_type = PT_PLANET;
119 119
         } else {
120
-          messageBox ("<font color=\"red\"><b>". $lang['fl_no_planet_type'] ."</b></font>", $lang['fl_error']);
120
+          messageBox("<font color=\"red\"><b>" . $lang['fl_no_planet_type'] . "</b></font>", $lang['fl_error']);
121 121
         }
122 122
       } else {
123 123
         $recyclers = 0;
124
-        foreach(sn_get_groups('flt_recyclers') as $recycler_id) {
124
+        foreach (sn_get_groups('flt_recyclers') as $recycler_id) {
125 125
           $recyclers += $fleetarray[$recycler_id];
126 126
         }
127 127
         if ($recyclers > 0 && $planet_type == PT_DEBRIS) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
                 $missiontype[MT_HOLD] = $lang['type_mission'][MT_HOLD];
148 148
 
149
-                if($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
149
+                if ($planet_type == PT_MOON && $fleetarray[SHIP_HUGE_DEATH_STAR]) {
150 150
                   $missiontype[MT_DESTROY] = $lang['type_mission'][MT_DESTROY];
151 151
                 }
152 152
               }
@@ -206,14 +206,14 @@  discard block
 block discarded – undo
206 206
 );
207 207
 
208 208
 $is_transport_missions = false;
209
-if($missiontype) {
209
+if ($missiontype) {
210 210
   $sn_group_missions = sn_get_groups('missions');
211
-  foreach($missiontype as $mission_data_id => $mission_data) {
211
+  foreach ($missiontype as $mission_data_id => $mission_data) {
212 212
     $is_transport_missions = $is_transport_missions || (isset($sn_group_missions[$mission_data_id]['transport']) && $sn_group_missions[$mission_data_id]['transport']);
213 213
   }
214 214
 }
215 215
 
216
-switch($fleet_page) {
216
+switch ($fleet_page) {
217 217
   case 1:
218 218
     require('includes/includes/flt_page1.inc');
219 219
   break;
Please login to merge, or discard this patch.
includes/includes/flt_mission_transport.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
   $source_planet      = &$mission_data['src_planet'];
17 17
   $destination_planet = &$mission_data['dst_planet'];
18 18
 
19
-  if(!isset($destination_planet['id']) || !$destination_planet['id_owner'])
19
+  if (!isset($destination_planet['id']) || !$destination_planet['id_owner'])
20 20
   {
21 21
     // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
22 22
     DbFleetStatic::fleet_send_back($fleet_row);
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
     $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''),
30 30
     $fleet_row['fleet_resource_metal'], $lang['Metal'],
31 31
     $fleet_row['fleet_resource_crystal'], $lang['Crystal'],
32
-    $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] );
32
+    $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']);
33 33
   msg_send_simple_message($fleet_row['fleet_target_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
34 34
 
35
-  if($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner'])
35
+  if ($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner'])
36 36
   {
37 37
     msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
38 38
   }
Please login to merge, or discard this patch.
includes/includes/flt_mission_recycle.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
   $fleet_row          = &$mission_data['fleet'];
16 16
   $destination_planet = &$mission_data['dst_planet'];
17 17
 
18
-  if(!$fleet_row)
18
+  if (!$fleet_row)
19 19
   {
20 20
     return CACHE_NOTHING;
21 21
   }
22 22
 
23
-  if(!isset($destination_planet['id']))
23
+  if (!isset($destination_planet['id']))
24 24
   {
25 25
     // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
26 26
     DbFleetStatic::fleet_send_back($mission_data['fleet']);
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
   $RecyclerCapacity    = 0;
33 33
   $OtherFleetCapacity  = 0;
34 34
   $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']);
35
-  foreach($fleet_array as $unit_id => $unit_count)
35
+  foreach ($fleet_array as $unit_id => $unit_count)
36 36
   {
37
-    if(in_array($unit_id, sn_get_groups('fleet')))
37
+    if (in_array($unit_id, sn_get_groups('fleet')))
38 38
     {
39 39
       $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit_count;
40
-      if(in_array($unit_id, sn_get_groups('flt_recyclers')))
40
+      if (in_array($unit_id, sn_get_groups('flt_recyclers')))
41 41
       {
42 42
         $RecyclerCapacity += $capacity;
43 43
       }
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
   }
50 50
 
51 51
   $IncomingFleetGoods = $fleet_row["fleet_resource_metal"] + $fleet_row["fleet_resource_crystal"] + $fleet_row["fleet_resource_deuterium"];
52
-  if($IncomingFleetGoods > $OtherFleetCapacity)
52
+  if ($IncomingFleetGoods > $OtherFleetCapacity)
53 53
   {
54 54
     $RecyclerCapacity -= ($IncomingFleetGoods - $OtherFleetCapacity);
55 55
   }
56 56
 
57
-  if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity)
57
+  if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity)
58 58
   {
59 59
     $RecycledGoods["metal"]   = $destination_planet["debris_metal"];
60 60
     $RecycledGoods["crystal"] = $destination_planet["debris_crystal"];
61 61
   }
62 62
   else
63 63
   {
64
-    if (($destination_planet["debris_metal"]   > $RecyclerCapacity / 2) AND
64
+    if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND
65 65
       ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2))
66 66
       {
67 67
       $RecycledGoods["metal"]   = $RecyclerCapacity / 2;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
       }
96 96
     }
97 97
   }
98
-  $NewCargo['Metal']     = $fleet_row["fleet_resource_metal"]   + $RecycledGoods["metal"];
98
+  $NewCargo['Metal']     = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"];
99 99
   $NewCargo['Crystal']   = $fleet_row["fleet_resource_crystal"] + $RecycledGoods["crystal"];
100 100
   $NewCargo['Deuterium'] = $fleet_row["fleet_resource_deuterium"];
101 101
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     HelperString::numberFloorAndFormat($RecycledGoods["metal"]), $lang['Metal'],
109 109
     HelperString::numberFloorAndFormat($RecycledGoods["crystal"]), $lang['Crystal']
110 110
   );
111
-  msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message);
111
+  msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message);
112 112
 
113 113
 //  $QryUpdateFleet  = "UPDATE {{fleets}} SET `fleet_mess` = 1,`fleet_resource_metal` = '{$NewCargo['Metal']}',`fleet_resource_crystal` = '{$NewCargo['Crystal']}',`fleet_resource_deuterium` = '{$NewCargo['Deuterium']}' ";
114 114
 //  $QryUpdateFleet .= "WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;";
Please login to merge, or discard this patch.
includes/includes/flt_mission_destroy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 function flt_mission_destroy($mission_data) {
11 11
   $fleet_row = $mission_data['fleet'];
12 12
   $destination_planet = $mission_data['dst_planet'];
13
-  if(!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) {
13
+  if (!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) {
14 14
     DbFleetStatic::fleet_send_back($fleet_row);
15 15
 
16 16
     return CACHE_FLEET;
Please login to merge, or discard this patch.
includes/includes/flt_mission_hold.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 function flt_mission_hold(&$mission_data)
6 6
 {
7
-  if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW)
7
+  if ($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW)
8 8
   {
9 9
     DbFleetStatic::fleet_send_back($mission_data['fleet']);
10 10
     // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;");
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use Fleet\DbFleetStatic;
4 4
 
5
-function flt_mission_hold(&$mission_data)
6
-{
5
+function flt_mission_hold(&$mission_data) {
7 6
   if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW)
8 7
   {
9 8
     DbFleetStatic::fleet_send_back($mission_data['fleet']);
Please login to merge, or discard this patch.
includes/includes/flt_mission_relocate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
   $fleet_row          = &$mission_data['fleet'];
16 16
   $destination_planet = &$mission_data['dst_planet'];
17 17
 
18
-  if(!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner'])
18
+  if (!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner'])
19 19
   {
20 20
     // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
21 21
     DbFleetStatic::fleet_send_back($mission_data['fleet']);
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
       $mission_data['src_planet']['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''),
29 29
     $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) .
30 30
   '<br />' . $lang['sys_relocate_mess_user'];
31
-  foreach(sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count)
31
+  foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count)
32 32
   {
33 33
     $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />';
34 34
   }
Please login to merge, or discard this patch.
includes/includes/flt_page4.inc 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@  discard block
 block discarded – undo
3 3
 use Fleet\DbFleetStatic;
4 4
 use Planet\DBStaticPlanet;
5 5
 
6
-if(SN_IN_FLEET !== true) {
6
+if (SN_IN_FLEET !== true) {
7 7
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
8 8
 }
9 9
 
10 10
 $fleetid = sys_get_param_id('fleetid');
11 11
 
12
-if(!is_numeric($fleetid) || empty($fleetid)) {
12
+if (!is_numeric($fleetid) || empty($fleetid)) {
13 13
   sys_redirect("fleet.php");
14 14
 }
15 15
 
16 16
 $fleet = DbFleetStatic::db_fleet_get($fleetid);
17
-if(!$fleet) {
17
+if (!$fleet) {
18 18
   messageBox($lang['fl_fleet_not_exists'], $lang['fl_error']);
19 19
 }
20 20
 //$query = doquery("SELECT * FROM `{{fleets}}` WHERE fleet_id = '{$fleetid}'");
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
   messageBox($lang['fl_isback'], $lang['fl_error']);
29 29
 }
30 30
 
31
-if($fleet['fleet_owner'] != $user['id']) {
32
-  $debug->warning($lang['fl_aks_hack_wrong_fleet'],'Wrong Fleet Owner',301);
31
+if ($fleet['fleet_owner'] != $user['id']) {
32
+  $debug->warning($lang['fl_aks_hack_wrong_fleet'], 'Wrong Fleet Owner', 301);
33 33
   messageBox($lang['fl_aks_hack_wrong_fleet'], $lang['fl_error']);
34 34
 }
35 35
 
@@ -39,19 +39,19 @@  discard block
 block discarded – undo
39 39
 
40 40
 !$aks && !$userToAdd_unsafe ? $userToAdd_unsafe = $user['username'] : false;
41 41
 
42
-if($userToAdd_unsafe) {
42
+if ($userToAdd_unsafe) {
43 43
   $userToAdd = db_escape($userToAdd_unsafe);
44 44
   $userToAddID = db_user_by_username($userToAdd_unsafe, true);
45 45
   $userToAddID = $userToAddID['id'];
46 46
 
47
-  if($fleet['fleet_target_owner'] == $userToAddID) {
47
+  if ($fleet['fleet_target_owner'] == $userToAddID) {
48 48
     messageBox($lang['flt_aks_player_same'], $lang['fl_error']);
49 49
   }
50 50
 
51
-  if($userToAddID) {
52
-    if(!$aks) {
51
+  if ($userToAddID) {
52
+    if (!$aks) {
53 53
       // No AСS exists - making one
54
-      if(!$fleet['fleet_group']) {
54
+      if (!$fleet['fleet_group']) {
55 55
         doquery("INSERT INTO {{aks}} SET
56 56
           `name` = '" . db_escape($lang['flt_acs_prefix'] . $fleetid) . "',
57 57
           `teilnehmer` = '" . $user['id'] . "',
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
           `planet` = '" . $fleet['fleet_end_planet'] . "',
63 63
           `planet_type` = '" . $fleet['fleet_end_type'] . "',
64 64
           `eingeladen` = '" . $user['id'] . "',
65
-          `fleet_end_time` = '" . $fleet['fleet_end_time']. "'");
65
+          `fleet_end_time` = '" . $fleet['fleet_end_time'] . "'");
66 66
 
67 67
         $aks = doquery("SELECT * FROM {{aks}} WHERE `flotten` = {$fleetid} LIMIT 1;", true);
68 68
 
@@ -80,26 +80,26 @@  discard block
 block discarded – undo
80 80
 
81 81
     $isUserExists = false;
82 82
     $invited_ar = explode(",", $aks['eingeladen']);
83
-    foreach($invited_ar as $inv) {
83
+    foreach ($invited_ar as $inv) {
84 84
       if ($userToAddID == $inv) {
85 85
         $isUserExists = true;
86 86
       }
87 87
     }
88 88
 
89
-    if(count($invited_ar) >= 5) {
89
+    if (count($invited_ar) >= 5) {
90 90
       messageBox($lang['flt_aks_error_too_much_players'], $lang['fl_error']);
91 91
     }
92 92
 
93
-    if($isUserExists) {
93
+    if ($isUserExists) {
94 94
       $userToAdd_unsafe != $user['username'] ? $add_user_message_mr = sprintf($lang['fl_aks_player_invited_already'], $userToAdd) : false;
95 95
     } else {
96 96
       $add_user_message_mr = sprintf($lang['fl_aks_player_invited'], $userToAdd);
97 97
       doquery("UPDATE `{{aks}}` SET `eingeladen` = concat(`eingeladen`, ',{$userToAddID}') WHERE `flotten` = {$fleetid};")
98
-        or die(sprintf($lang['fl_aks_adding_error'],db_error()));
98
+        or die(sprintf($lang['fl_aks_adding_error'], db_error()));
99 99
       $aks['eingeladen'] .= ',' . $userToAddID;
100 100
     }
101
-    msg_send_simple_message ( $userToAddID, $user['id'], SN_TIME_NOW, MSG_TYPE_COMBAT, $user['username'],
102
-      $lang['fl_aks_invite_message_header'], sprintf( $lang['fl_aks_invite_message'], $user['username']));
101
+    msg_send_simple_message($userToAddID, $user['id'], SN_TIME_NOW, MSG_TYPE_COMBAT, $user['username'],
102
+      $lang['fl_aks_invite_message_header'], sprintf($lang['fl_aks_invite_message'], $user['username']));
103 103
   } else {
104 104
     $add_user_message_mr = sprintf($lang['fl_aks_player_error'], $userToAdd);
105 105
   }
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
   'MISSION_NAME' => $lang['type_mission'][MT_AKS],
114 114
 ));
115 115
 
116
-if($aks['eingeladen'] && is_array($members = SN::db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
117
-  foreach($members as $row) {
116
+if ($aks['eingeladen'] && is_array($members = SN::db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
117
+  foreach ($members as $row) {
118 118
     $template->assign_block_vars('invited', array(
119 119
       'NAME' => $row['username'],
120 120
     ));
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 $i++;
125 125
 $fleet_row = DbFleetStatic::db_fleet_get($fleetid);
126 126
 
127
-if(is_array($fleet_row) && !empty($fleet_row)) {
127
+if (is_array($fleet_row) && !empty($fleet_row)) {
128 128
 $planet_start = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_start_planet_id']);
129 129
 $fleet_row['fleet_start_name'] = !empty($planet_start['name']) ? $planet_start['name'] : '';
130 130
 $planet_end = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_end_planet_id']);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 $fleet_data = tpl_parse_fleet_db($fleet_row, $i, $user);
134 134
 $template->assign_block_vars('fleets', $fleet_data['fleet']);
135
-foreach($fleet_data['ships'] as $ship_data) {
135
+foreach ($fleet_data['ships'] as $ship_data) {
136 136
   $template->assign_block_vars('fleets.ships', $ship_data);
137 137
 }
138 138
 }
Please login to merge, or discard this patch.
includes/db/db_queries.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@  discard block
 block discarded – undo
5 5
 require_once('db_queries_users.php');
6 6
 
7 7
 
8
-function db_planet_list_admin_list($table_parent_columns, $planet_active, $active_time, $planet_type)
9
-{
8
+function db_planet_list_admin_list($table_parent_columns, $planet_active, $active_time, $planet_type) {
10 9
   return doquery(
11 10
     "SELECT p.*, u.username" . ($table_parent_columns ? ', p1.name AS parent_name' : '') .
12 11
     " FROM {{planets}} AS p
@@ -15,8 +14,7 @@  discard block
 block discarded – undo
15 14
     " WHERE " . ($planet_active ? "p.last_update >= {$active_time}" : "p.planet_type = {$planet_type}"));
16 15
 }
17 16
 
18
-function db_planet_list_search($searchtext)
19
-{
17
+function db_planet_list_search($searchtext) {
20 18
   return doquery(
21 19
     "SELECT
22 20
       p.galaxy, p.system, p.planet, p.planet_type, p.name as planet_name,
@@ -36,8 +34,7 @@  discard block
 block discarded – undo
36 34
 
37 35
 
38 36
 
39
-function db_user_list_search($searchtext)
40
-{
37
+function db_user_list_search($searchtext) {
41 38
   return doquery(
42 39
     "SELECT
43 40
       pn.player_name, u.id as uid, u.username, u.ally_id, u.id_planet, u.total_points, u.total_rank,
@@ -55,8 +52,7 @@  discard block
 block discarded – undo
55 52
   );
56 53
 }
57 54
 
58
-function db_buddy_list_by_user($user_id)
59
-{
55
+function db_buddy_list_by_user($user_id) {
60 56
 //  return ($user_id = intval($user_id)) ? doquery(
61 57
   return ($user_id = idval($user_id)) ? doquery(
62 58
     "SELECT
@@ -86,8 +82,7 @@  discard block
 block discarded – undo
86 82
 
87 83
 
88 84
 
89
-function db_unit_records_sum($unit_id, $user_skip_list_unit)
90
-{
85
+function db_unit_records_sum($unit_id, $user_skip_list_unit) {
91 86
   return doquery (
92 87
     "SELECT unit_player_id, username, sum(unit_level) as unit_level
93 88
           FROM {{unit}} JOIN {{users}} AS u ON u.id = unit_player_id
@@ -98,8 +93,7 @@  discard block
 block discarded – undo
98 93
     , true);
99 94
 }
100 95
 
101
-function db_unit_records_plain($unit_id, $user_skip_list_unit)
102
-{
96
+function db_unit_records_plain($unit_id, $user_skip_list_unit) {
103 97
   return doquery (
104 98
     "SELECT unit_player_id, username, unit_level
105 99
           FROM {{unit}} JOIN {{users}} AS u ON u.id = unit_player_id
@@ -183,15 +177,13 @@  discard block
 block discarded – undo
183 177
 }
184 178
 
185 179
 
186
-function db_stat_list_delete_ally_player()
187
-{
180
+function db_stat_list_delete_ally_player() {
188 181
   return doquery('DELETE s FROM `{{statpoints}}` AS s JOIN `{{users}}` AS u ON u.id = s.id_owner WHERE s.id_ally IS NULL AND u.user_as_ally IS NOT NULL');
189 182
 }
190 183
 
191 184
 
192 185
 
193
-function db_chat_player_list_online($chat_refresh_rate, $ally_add)
194
-{
186
+function db_chat_player_list_online($chat_refresh_rate, $ally_add) {
195 187
   $sql_date = SN_TIME_NOW - $chat_refresh_rate * 2;
196 188
 
197 189
   return doquery(
@@ -205,13 +197,11 @@  discard block
 block discarded – undo
205 197
     ORDER BY authlevel DESC, `username`");
206 198
 }
207 199
 
208
-function db_referrals_list_by_id($user_id)
209
-{
200
+function db_referrals_list_by_id($user_id) {
210 201
   return doquery("SELECT r.*, u.username, u.register_time FROM {{referrals}} AS r LEFT JOIN {{users}} AS u ON u.id = r.id WHERE id_partner = {$user_id}");
211 202
 }
212 203
 
213
-function db_message_list_admin_by_type($int_type_selected, $StartRec)
214
-{
204
+function db_message_list_admin_by_type($int_type_selected, $StartRec) {
215 205
   return doquery("SELECT
216 206
   message_id as `ID`,
217 207
   message_from as `FROM`,
@@ -230,8 +220,7 @@  discard block
 block discarded – undo
230 220
 }
231 221
 
232 222
 
233
-function db_message_insert_all($message_type, $from, $subject, $text)
234
-{
223
+function db_message_insert_all($message_type, $from, $subject, $text) {
235 224
   return doquery($QryInsertMessage = 'INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
236 225
     "SELECT `id`, 0, unix_timestamp(now()), {$message_type}, '{$from}', '{$subject}', '{$text}' FROM {{users}}");
237 226
 }
Please login to merge, or discard this patch.