Completed
Branch work-fleets (1ceb9c)
by SuperNova.WS
04:37
created
simulator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG'))
5
+if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG'))
6 6
 {
7 7
   define('BE_DEBUG', true);
8 8
 }
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 $sym_defender = $_POST['defender'] ? $_POST['defender'] : array();
15 15
 $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array();
16 16
 
17
-if($replay)
17
+if ($replay)
18 18
 {
19 19
   $unpacked = sn_ube_simulator_decode_replay($replay);
20 20
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
   $sym_attacker = array(1 => $sym_attacker);
28 28
 }
29 29
 
30
-if($_POST['submit'] || $execute)
30
+if ($_POST['submit'] || $execute)
31 31
 {
32 32
   $replay = sn_ube_simulator_encode_replay($sym_defender, 'D');
33 33
   $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A');
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
   $template = gettemplate('simulator', true);
41 41
   $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL);
42 42
 
43
-  foreach($techs_and_officers as $tech_id)
43
+  foreach ($techs_and_officers as $tech_id)
44 44
   {
45
-    if(!$sym_attacker[1][$tech_id])
45
+    if (!$sym_attacker[1][$tech_id])
46 46
     {
47 47
       $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id);
48 48
     }
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
     UNIT_GOVERNORS => array(MRC_FORTIFIER),
57 57
     UNIT_DEFENCE => sn_get_groups('defense_active'),
58 58
   );
59
-  foreach($show_groups as $unit_group_id => $unit_group)
59
+  foreach ($show_groups as $unit_group_id => $unit_group)
60 60
   {
61 61
     $template->assign_block_vars('simulator', array(
62 62
       'GROUP' => $unit_group_id,
63 63
       'NAME' => $lang['tech'][$unit_group_id],
64 64
     ));
65 65
 
66
-    foreach($unit_group as $unit_id)
66
+    foreach ($unit_group as $unit_id)
67 67
     {
68 68
       $tab++;
69 69
 
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_diplomacy.inc 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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
 
7
-if(!$user_can_negotiate) {
7
+if (!$user_can_negotiate) {
8 8
   message($lang['Denied_access'], $lang['ali_dip_title']);
9 9
 }
10 10
 
@@ -15,24 +15,24 @@  discard block
 block discarded – undo
15 15
 
16 16
 
17 17
 
18
-if(sys_get_param_str('ali_dip_offer_make')) {
18
+if (sys_get_param_str('ali_dip_offer_make')) {
19 19
   $alliance_negotiation_relation = sys_get_param_str('alliance_negotiation_relation');
20
-  if(!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list)) {
20
+  if (!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list)) {
21 21
     message($lang['ali_dip_err_wrong_offer'], $page_title);
22 22
   }
23 23
 
24 24
   $alliance_negotiation_contr_ally_id = sys_get_param_id('alliance_negotiation_contr_ally_id');
25
-  if($alliance_negotiation_contr_ally_id == $user['ally_id']) {
25
+  if ($alliance_negotiation_contr_ally_id == $user['ally_id']) {
26 26
     message($lang['ali_dip_err_same_ally'], $page_title);
27 27
   }
28 28
 
29 29
   $contr_ally_row = db_ally_get_by_id($alliance_negotiation_contr_ally_id);
30
-  if(!$contr_ally_row) {
30
+  if (!$contr_ally_row) {
31 31
     message($lang['ali_dip_err_no_ally'], $page_title);
32 32
   }
33 33
 
34 34
   $relation_current_id = ali_relation($user['ally_id'], $alliance_negotiation_contr_ally_id);
35
-  if($alliance_negotiation_relation == $relation_current_id) {
35
+  if ($alliance_negotiation_relation == $relation_current_id) {
36 36
     message(sprintf($lang['ali_dip_err_offer_same'], $lang['ali_dip_relations'][$alliance_negotiation_relation]), $page_title);
37 37
   }
38 38
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
   $relation_new = $sn_diplomacy_relation_list[$alliance_negotiation_relation];
45 45
   $relation_current = $sn_diplomacy_relation_list[$relation_current_id];
46
-  if($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1) {
46
+  if ($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1) {
47 47
     sn_db_perform('{{alliance_negotiation}}',
48 48
       array(
49 49
         'alliance_negotiation_ally_id'         => $user['ally_id'],
@@ -70,33 +70,33 @@  discard block
 block discarded – undo
70 70
   }
71 71
 } else {
72 72
   $offer_id = sys_get_param_id('offer_id');
73
-  if($offer_id) {
73
+  if ($offer_id) {
74 74
     $offer_answer = sys_get_param_str('answer');
75 75
 
76 76
     $negotiation = db_ally_negotiation_get_by_offer_id($offer_id);
77
-    if(!$negotiation) {
77
+    if (!$negotiation) {
78 78
       message($lang['ali_dip_err_offer_none'], $page_title);
79
-    } elseif($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id']) {
79
+    } elseif ($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id']) {
80 80
       // TODO: Add log of hack attempt
81 81
       message($lang['ali_dip_err_offer_alien'], $page_title);
82
-    } elseif($negotiation['alliance_negotiation_ally_id'] == $user['ally_id']) {
83
-      if($offer_answer == 'accept') {
82
+    } elseif ($negotiation['alliance_negotiation_ally_id'] == $user['ally_id']) {
83
+      if ($offer_answer == 'accept') {
84 84
         // TODO: Add log of hack attempt
85 85
         message($lang['ali_dip_err_offer_accept_own'], $page_title);
86
-      } elseif($offer_answer == 'deny') {
86
+      } elseif ($offer_answer == 'deny') {
87 87
         db_ally_negotiation_delete_by_offer_id($offer_id);
88 88
       }
89 89
     } else {
90
-      if($offer_answer == 'accept') {
90
+      if ($offer_answer == 'accept') {
91 91
         $accept_offer = true;
92
-      } elseif($offer_answer == 'deny') {
92
+      } elseif ($offer_answer == 'deny') {
93 93
         db_ally_negotiation_update_status_1($offer_id);
94 94
       }
95 95
     }
96 96
   }
97 97
 }
98 98
 
99
-if($accept_offer) {
99
+if ($accept_offer) {
100 100
   sn_db_transaction_start();
101 101
 
102 102
   // TODO: Make sn_db_perform() multirow
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
   sn_db_transaction_commit();
126 126
 }
127 127
 
128
-foreach($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation) {
128
+foreach ($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation) {
129 129
   $template->assign_block_vars('relation', array(
130 130
     'ID'   => $diplomacy_relation_id,
131 131
     'TEXT' => $lang['ali_dip_relations'][$diplomacy_relation_id],
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 
136 136
 $query = db_ally_list_get_by_not_user_ally($user);
137
-while($alliance = db_fetch($query)) {
137
+while ($alliance = db_fetch($query)) {
138 138
   $template->assign_block_vars('alliance', array(
139 139
     'ID'   => $alliance['id'],
140 140
     'NAME' => js_safe_string($alliance['ally_name']),
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 }
144 144
 
145 145
 $query = db_ally_negotiation_list($user);
146
-while($offer = db_fetch($query)) {
146
+while ($offer = db_fetch($query)) {
147 147
   $template->assign_block_vars('offer', array(
148 148
     'ID'       => $offer['alliance_negotiation_id'],
149 149
     'NAME'     => $offer['ally_name'],
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
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
7 7
 }
8 8
 
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 $ally_name_raw = sys_get_param_str_unsafe('name');
12 12
 $ally_name = db_escape($ally_name_raw);
13 13
 
14
-if($ally_tag) {
15
-  if(!$ally_name_raw || !$ally_tag_raw) {
14
+if ($ally_tag) {
15
+  if (!$ally_name_raw || !$ally_tag_raw) {
16 16
     message($lang['have_not_name'], $lang['make_alliance']);
17 17
   }
18 18
 
19 19
   $query = db_ally_get_by_name_or_tag($ally_tag, $ally_name);
20
-  if($query) {
20
+  if ($query) {
21 21
     message(str_replace('%s', $query['ally_tag'] == $ally_tag_raw ? $ally_tag_raw : $ally_name_raw, $lang['always_exist']), $lang['make_alliance']);
22 22
   }
23 23
 
Please login to merge, or discard this patch.
includes/alliance/ali_info.inc 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  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
 
7 7
 $template = gettemplate('ali_info', true);
8 8
 
9
-if($mode == 'exit') {
10
-  if($ally['ally_owner'] == $user['id']) {
9
+if ($mode == 'exit') {
10
+  if ($ally['ally_owner'] == $user['id']) {
11 11
     message($lang['Owner_cant_go_out'], $lang['Alliance']);
12 12
   }
13 13
 
14
-  if(sys_get_param_int('ali_info_leave_confirm')) {
14
+  if (sys_get_param_int('ali_info_leave_confirm')) {
15 15
     sn_db_transaction_start();
16 16
     db_user_set_by_id($user['id'], "`ally_id` = null, `ally_name` = null, `ally_tag` = null, `ally_register_time` = 0, `ally_rank_id` = 0");
17 17
     db_ally_list_recalc_counts();
@@ -19,20 +19,20 @@  discard block
 block discarded – undo
19 19
     $lang['Go_out_welldone'] = str_replace("%s", $ally_name, $lang['Go_out_welldone']);
20 20
     message(sprintf($lang['ali_info_leave_success'], $ally['ally_name']), $lang['sys_alliance']);
21 21
   }
22
-} elseif($mode == 'ainfo') {
22
+} elseif ($mode == 'ainfo') {
23 23
   $tag = sys_get_param_str('tag');
24 24
   $id_ally = sys_get_param_id('a');
25
-  if($tag) {
25
+  if ($tag) {
26 26
     $ally = db_ally_get_by_tag($tag);
27
-  } elseif($id_ally) {
27
+  } elseif ($id_ally) {
28 28
     $ally = db_ally_get_by_id($id_ally);
29 29
   }
30 30
 
31
-  if(!$ally) {
31
+  if (!$ally) {
32 32
     message($lang['ali_sys_notFound'], $lang['Ally_info_1']);
33 33
   }
34 34
 
35
-  if(!$ally['ally_description']) {
35
+  if (!$ally['ally_description']) {
36 36
     $ally['ally_description'] = $lang['Ally_nodescription'];
37 37
   }
38 38
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 } else {
45 45
   $page_header = $lang['your_alliance'];
46 46
 
47
-  if($ally['ally_owner'] == $user['id']) {
47
+  if ($ally['ally_owner'] == $user['id']) {
48 48
     $range = $ally['ally_owner_range'] ? $ally['ally_owner_range'] : $lang['Founder'];
49
-  } elseif($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) {
49
+  } elseif ($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name'])) {
50 50
     $range = $ranks[$user['ally_rank_id']]['name'];
51 51
   } else {
52 52
     $range = $lang['member'];
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 ));
88 88
 
89 89
 $relations = ali_relations($ally['id']);
90
-foreach($relations as $relation) {
91
-  if($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) {
90
+foreach ($relations as $relation) {
91
+  if ($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id']) {
92 92
     $template->assign_block_vars('relation', array(
93 93
       'NAME'     => $relation['alliance_diplomacy_contr_ally_name'],
94 94
       'RELATION' => $lang['ali_dip_relations'][$relation['alliance_diplomacy_relation']],
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin.inc 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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
 
7
-if(!$user_admin) {
7
+if (!$user_admin) {
8 8
   message($lang['Denied_access'], $lang['ally_admin']);
9 9
 }
10 10
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 $allyTextID = ($allyTextID < 1 || $allyTextID > 3) ? 1 : $allyTextID;
23 23
 
24 24
 
25
-if(sys_get_param_str('isSaveOptions')) {
25
+if (sys_get_param_str('isSaveOptions')) {
26 26
   require_once('includes/includes/sys_avatar.php');
27 27
 
28 28
   $new_image = $ally['ally_image'];
@@ -34,46 +34,46 @@  discard block
 block discarded – undo
34 34
 //  $template->assign_block_vars('result', $avatar_upload_result);
35 35
 
36 36
   $ally_changeset = array();
37
-  if(($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) {
37
+  if (($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) {
38 38
     $new_tag = db_escape($new_tag);
39 39
     $ally_changeset[] = "`ally_tag`='{$new_tag}'";
40 40
     db_user_set_by_id($ally['ally_user_id'], "`username`='[{$new_tag}]'");
41 41
   }
42
-  if(($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) {
42
+  if (($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) {
43 43
     $new_name = db_escape($new_name);
44 44
     $ally_changeset[] = "`ally_name`='{$new_name}'";
45 45
   }
46 46
 
47
-  if(($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) {
47
+  if (($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) {
48 48
     $new_owner_rank = db_escape($new_owner_rank);
49 49
     $ally_changeset[] = "`ally_owner_range` = '{$new_owner_rank}'";
50 50
   }
51
-  if(($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) {
51
+  if (($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) {
52 52
     $new_web = db_escape($new_web);
53 53
     $ally_changeset[] = "`ally_web` = '{$new_web}'";
54 54
   }
55 55
   $new_request = sys_get_param_int('request_notallow', $ally['ally_request_notallow']);
56 56
   $ally_changeset[] = "`ally_request_notallow` = '{$new_request}'";
57
-  if($new_image != $ally['ally_image']) {
57
+  if ($new_image != $ally['ally_image']) {
58 58
     $new_image = intval($new_image);
59 59
     $ally_changeset[] = "`ally_image` = '{$new_image}'";
60 60
   }
61 61
 
62
-  if(!empty($ally_changeset)) {
62
+  if (!empty($ally_changeset)) {
63 63
     db_ally_update_by_changeset($ally_changeset, $ally);
64 64
     sys_redirect('alliance.php?mode=admin&edit=ally');
65 65
   }
66
-} elseif(sys_get_param_str('isSaveText')) {
66
+} elseif (sys_get_param_str('isSaveText')) {
67 67
   $text = sys_get_param_str_both('text');
68 68
   db_ally_update_texts($text_list, $allyTextID, $text, $ally);
69 69
   $ally[$text_list[$allyTextID]['db_field']] = $text['unsafe'];
70
-} elseif(sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader')) {
71
-  if(!$isAllyOwner) {
70
+} elseif (sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader')) {
71
+  if (!$isAllyOwner) {
72 72
     message($lang['Denied_access'], $lang['ally_admin']);
73 73
   }
74 74
 
75 75
   $newLeader = db_user_by_id($idNewLeader, false, `ally_id`);
76
-  if($newLeader['ally_id'] == $user['ally_id']) {
76
+  if ($newLeader['ally_id'] == $user['ally_id']) {
77 77
     sn_db_transaction_start();
78 78
     db_user_set_by_id($user['id'], "`ally_rank_id`='0'");
79 79
     db_ally_update_owner($idNewLeader, $user);
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
     sn_db_transaction_commit();
82 82
     sys_redirect('alliance.php');
83 83
   }
84
-} elseif(sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband')) {
85
-  if(!$isAllyOwner) {
84
+} elseif (sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband')) {
85
+  if (!$isAllyOwner) {
86 86
     message($lang['Denied_access'], $lang['ally_admin']);
87 87
   }
88 88
   sn_db_transaction_start();
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
   $userAllyAdmins = db_user_list("`ally_id`= {$ally['id']}", false, '`id`, `username`');
129 129
   unset($tmp);
130 130
   // while ($userAllyAdmin = db_fetch($userAllyAdmins))
131
-  foreach($userAllyAdmins as $userAllyAdmin) {
131
+  foreach ($userAllyAdmins as $userAllyAdmin) {
132 132
 // pdump($userAllyAdmin);
133 133
     $tmp .= "<option value={$userAllyAdmin['id']}>{$userAllyAdmin['username']}</option>";
134 134
   }
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
   $template->assign_var('adminMembers', $tmp);
137 137
 }
138 138
 
139
-foreach($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale) {
140
-  if(!$sn_ali_admin_action_locale['title']) {
139
+foreach ($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale) {
140
+  if (!$sn_ali_admin_action_locale['title']) {
141 141
     continue;
142 142
   }
143 143
   $template->assign_block_vars('admin_actions', array(
Please login to merge, or discard this patch.
includes/alliance/ali_external_search.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 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
 
7 7
 $template = gettemplate('ali_search', true);
8 8
 
9 9
 $ali_search_text = sys_get_param_str('searchtext');
10
-if($ali_search_text) {
10
+if ($ali_search_text) {
11 11
   $template->assign_var('SEARCH_TEXT', $ali_search_text);
12 12
 
13 13
   $search = db_ally_search_by_name_or_tag($ali_search_text);
14
-  if(db_num_rows($search)) {
15
-    while($ally_row = db_fetch($search)) {
14
+  if (db_num_rows($search)) {
15
+    while ($ally_row = db_fetch($search)) {
16 16
       $template->assign_block_vars('alliances', array(
17 17
         'ID'          => $ally_row['id'],
18 18
         'TAG'         => $ally_row['ally_tag'],
Please login to merge, or discard this patch.
includes/constants.php 1 patch
Spacing   +236 added lines, -236 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Game type constants starts with GAME_
40 40
 define('GAME_SUPERNOVA', 0);
41
-define('GAME_OGAME'    , 1);
42
-define('GAME_BLITZ'    , 2);
41
+define('GAME_OGAME', 1);
42
+define('GAME_BLITZ', 2);
43 43
 
44 44
 // Date & time range constants
45 45
 define('DATE_FOREVER', 2000000000);
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 define('PERIOD_YEAR', PERIOD_DAY * 365);
53 53
 define('PERIOD_FOREVER', PERIOD_YEAR * 100);
54 54
 
55
-define('PERIOD_MINUTE_2' , PERIOD_MINUTE * 2);
56
-define('PERIOD_MINUTE_3' , PERIOD_MINUTE * 3);
57
-define('PERIOD_MINUTE_5' , PERIOD_MINUTE * 5);
55
+define('PERIOD_MINUTE_2', PERIOD_MINUTE * 2);
56
+define('PERIOD_MINUTE_3', PERIOD_MINUTE * 3);
57
+define('PERIOD_MINUTE_5', PERIOD_MINUTE * 5);
58 58
 define('PERIOD_MINUTE_10', PERIOD_MINUTE * 10);
59
-define('PERIOD_DAY_3'    , PERIOD_DAY * 3);
60
-define('PERIOD_WEEK_2'   , PERIOD_WEEK * 2);
61
-define('PERIOD_MONTH_2'  , PERIOD_MONTH * 2);
62
-define('PERIOD_MONTH_3'  , PERIOD_MONTH * 3);
59
+define('PERIOD_DAY_3', PERIOD_DAY * 3);
60
+define('PERIOD_WEEK_2', PERIOD_WEEK * 2);
61
+define('PERIOD_MONTH_2', PERIOD_MONTH * 2);
62
+define('PERIOD_MONTH_3', PERIOD_MONTH * 3);
63 63
 
64 64
 define('FONT_SIZE_PERCENT_MIN', 56.25);
65 65
 define('FONT_SIZE_PERCENT_DEFAULT', 68.75);
@@ -112,100 +112,100 @@  discard block
 block discarded – undo
112 112
 define('SN_SYS_SEC_CHARS_ALLOWED', 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghkmnpqrstuvwxyz0123456789');
113 113
 
114 114
 // Mot qui sont interdit a la saisie !
115
-$ListCensure = array ( '/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
115
+$ListCensure = array('/</', '/>/', '/script/i', '/doquery/i', '/http/i', '/javascript/i');
116 116
 
117 117
 // Confirmation record types
118
-define('CONFIRM_REGISTRATION'  , 1);
118
+define('CONFIRM_REGISTRATION', 1);
119 119
 define('CONFIRM_PASSWORD_RESET', 2);
120
-define('CONFIRM_DELETE'        , 3);
120
+define('CONFIRM_DELETE', 3);
121 121
 
122 122
 define('AFFILIATE_MM_TO_REFERRAL_DM', 2);
123 123
 
124 124
 // Ally diplomacy statuses
125
-define('ALLY_DIPLOMACY_SELF'         , 'self');
126
-define('ALLY_DIPLOMACY_NEUTRAL'      , 'neutral');
127
-define('ALLY_DIPLOMACY_WAR'          , 'war');
128
-define('ALLY_DIPLOMACY_PEACE'        , 'peace');
125
+define('ALLY_DIPLOMACY_SELF', 'self');
126
+define('ALLY_DIPLOMACY_NEUTRAL', 'neutral');
127
+define('ALLY_DIPLOMACY_WAR', 'war');
128
+define('ALLY_DIPLOMACY_PEACE', 'peace');
129 129
 define('ALLY_DIPLOMACY_CONFEDERATION', 'confederation');
130
-define('ALLY_DIPLOMACY_FEDERATION'   , 'federation');
131
-define('ALLY_DIPLOMACY_UNION'        , 'union');
132
-define('ALLY_DIPLOMACY_MASTER'       , 'master');
133
-define('ALLY_DIPLOMACY_SLAVE'        , 'slave');
130
+define('ALLY_DIPLOMACY_FEDERATION', 'federation');
131
+define('ALLY_DIPLOMACY_UNION', 'union');
132
+define('ALLY_DIPLOMACY_MASTER', 'master');
133
+define('ALLY_DIPLOMACY_SLAVE', 'slave');
134 134
 
135 135
 define('ALLY_PROPOSE_SEND', 0);
136 136
 
137 137
 // Quest types
138
-define('QUEST_TYPE_BUILD'   , 1);
138
+define('QUEST_TYPE_BUILD', 1);
139 139
 define('QUEST_TYPE_RESEARCH', 2);
140
-define('QUEST_TYPE_COMBAT'  , 3);
140
+define('QUEST_TYPE_COMBAT', 3);
141 141
 
142
-define('QUEST_STATUS_NOT_STARTED' , 0);
143
-define('QUEST_STATUS_STARTED'     , 1);
144
-define('QUEST_STATUS_COMPLETE'    , 2);
142
+define('QUEST_STATUS_NOT_STARTED', 0);
143
+define('QUEST_STATUS_STARTED', 1);
144
+define('QUEST_STATUS_COMPLETE', 2);
145 145
 
146 146
 // *** Combat-related constants
147 147
 // *** Mission Type constants starts with MT_
148
-define('MT_NONE'     ,  0);
149
-define('MT_ATTACK'   ,  1);
150
-define('MT_AKS'      ,  2);
151
-define('MT_TRANSPORT',  3);
152
-define('MT_RELOCATE' ,  4);
153
-define('MT_HOLD'     ,  5);
154
-define('MT_SPY'      ,  6);
155
-define('MT_COLONIZE' ,  7);
156
-define('MT_RECYCLE'  ,  8);
157
-define('MT_DESTROY'  ,  9);
158
-define('MT_MISSILE'  , 10);
159
-define('MT_EXPLORE'  , 15);
148
+define('MT_NONE', 0);
149
+define('MT_ATTACK', 1);
150
+define('MT_AKS', 2);
151
+define('MT_TRANSPORT', 3);
152
+define('MT_RELOCATE', 4);
153
+define('MT_HOLD', 5);
154
+define('MT_SPY', 6);
155
+define('MT_COLONIZE', 7);
156
+define('MT_RECYCLE', 8);
157
+define('MT_DESTROY', 9);
158
+define('MT_MISSILE', 10);
159
+define('MT_EXPLORE', 15);
160 160
 
161 161
 // *** Planet Target constants starts with PT_
162 162
 define('PT_NONE', 0);
163 163
 define('PT_ALL', 0);
164 164
 define('PT_PLANET', 1);
165 165
 define('PT_DEBRIS', 2);
166
-define('PT_MOON'  , 3);
166
+define('PT_MOON', 3);
167 167
 
168 168
 // *** Unit locations - shows db table where unit belong
169 169
 // Also cache indexes
170
-define('LOC_NONE',    -1);
170
+define('LOC_NONE', -1);
171 171
 define('LOC_UNIVERSE', 0);
172
-define('LOC_PLANET',   1);
173
-define('LOC_DEBRIS',   2); // Translates to `planets` table planet_type = 1, `debris_*` fields
174
-define('LOC_MOON',     3); // Translates to `planets` table planet_type = 3
175
-define('LOC_USER',     4);
176
-define('LOC_FLEET',    5);
177
-define('LOC_ALLY',     6);
178
-define('LOC_UNIT_NUMERIC',     7);
179
-define('LOC_UNIT_LIST',     8);
172
+define('LOC_PLANET', 1);
173
+define('LOC_DEBRIS', 2); // Translates to `planets` table planet_type = 1, `debris_*` fields
174
+define('LOC_MOON', 3); // Translates to `planets` table planet_type = 3
175
+define('LOC_USER', 4);
176
+define('LOC_FLEET', 5);
177
+define('LOC_ALLY', 6);
178
+define('LOC_UNIT_NUMERIC', 7);
179
+define('LOC_UNIT_LIST', 8);
180 180
 
181 181
 // ТОЛЬКО ВНУТРЕНЕЕ!!!
182
-define('LOC_UNIT',    'LOC_UNIT');
183
-define('LOC_QUE',     'LOC_QUE');
184
-define('LOC_LOCATION','LOC_LOCATION');
185
-define('LOC_LOCKS','LOC_LOCKS');
182
+define('LOC_UNIT', 'LOC_UNIT');
183
+define('LOC_QUE', 'LOC_QUE');
184
+define('LOC_LOCATION', 'LOC_LOCATION');
185
+define('LOC_LOCKS', 'LOC_LOCKS');
186 186
 
187 187
 // *** Caching masks
188
-define('CACHE_NOTHING'    ,  0);
189
-define('CACHE_FLEET'      ,  1);
190
-define('CACHE_PLANET'     ,  2);
191
-define('CACHE_USER'       ,  4);
192
-define('CACHE_SOURCE'     ,  8);
188
+define('CACHE_NOTHING', 0);
189
+define('CACHE_FLEET', 1);
190
+define('CACHE_PLANET', 2);
191
+define('CACHE_USER', 4);
192
+define('CACHE_SOURCE', 8);
193 193
 define('CACHE_DESTINATION', 16);
194
-define('CACHE_EVENT'      , 32);
194
+define('CACHE_EVENT', 32);
195 195
 
196
-define('CACHE_USER_SRC'  , CACHE_USER | CACHE_SOURCE);
197
-define('CACHE_USER_DST'  , CACHE_USER | CACHE_DESTINATION);
196
+define('CACHE_USER_SRC', CACHE_USER | CACHE_SOURCE);
197
+define('CACHE_USER_DST', CACHE_USER | CACHE_DESTINATION);
198 198
 define('CACHE_PLANET_SRC', CACHE_PLANET | CACHE_SOURCE);
199 199
 define('CACHE_PLANET_DST', CACHE_PLANET | CACHE_DESTINATION);
200
-define('CACHE_COMBAT'    , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
200
+define('CACHE_COMBAT', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION);
201 201
 
202
-define('CACHE_ALL'       , CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
202
+define('CACHE_ALL', CACHE_FLEET | CACHE_PLANET | CACHE_USER | CACHE_SOURCE | CACHE_DESTINATION | CACHE_EVENT);
203 203
 
204
-define('CACHE_NONE'      , CACHE_NOTHING); // Alias for me
204
+define('CACHE_NONE', CACHE_NOTHING); // Alias for me
205 205
 
206 206
 // *** Event types
207 207
 define('EVENT_FLEET_ARRIVE', 1);
208
-define('EVENT_FLEET_STAY'  , 2);
208
+define('EVENT_FLEET_STAY', 2);
209 209
 define('EVENT_FLEET_RETURN', 3);
210 210
 
211 211
 // *** Constants for changing DM
@@ -258,10 +258,10 @@  discard block
 block discarded – undo
258 258
 
259 259
 
260 260
 // Operation error status HARDCODE!
261
-define('ERR_NONE'               , 0); // No error
262
-define('ERR_WARNING'            , 1); // There is warning - something altering normal operation process
263
-define('ERR_ERROR'              , 2); // There is error - something permits operation from process
264
-define('ERR_HACK'               , 4); // Operation is qualified as hack attempt
261
+define('ERR_NONE', 0); // No error
262
+define('ERR_WARNING', 1); // There is warning - something altering normal operation process
263
+define('ERR_ERROR', 2); // There is error - something permits operation from process
264
+define('ERR_HACK', 4); // Operation is qualified as hack attempt
265 265
 // New GLOBAL operation results
266 266
 //define('RESULT_DEFAULT' , 0); // Default result - all went OK or result really doesn't matter
267 267
 //define('RESULT_WARNING' , 1);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 define('SN_PAYMENT_REQUEST_OK', 0);
282 282
 define('SN_PAYMENT_REQUEST_ERROR_UNIT_AMOUNT', 1);
283 283
 define('SN_PAYMENT_REQUEST_ERROR_PAYLINK_UNSUPPORTED', 2);
284
-define('SN_PAYMENT_REQUEST_IP_WRONG', 3);  // Неправильный IP входящей системы - обычно хак
284
+define('SN_PAYMENT_REQUEST_IP_WRONG', 3); // Неправильный IP входящей системы - обычно хак
285 285
 define('SN_PAYMENT_REQUEST_COMMAND_UNSUPPORTED', 4); // Неподдерживаемая команда - обычно хак
286 286
 define('SN_PAYMENT_REQUEST_SIGNATURE_INVALID', 5); // Неправильная подпись или не сошлась контрольная сумма - обычно хак
287 287
 define('SN_MODULE_DISABLED', 6); // Модуль отключен // УНИВЕРСАЛЬНЫЙ ОТВЕТ!
@@ -554,16 +554,16 @@  discard block
 block discarded – undo
554 554
 //define('F_DEVICE_ID',     'F_DEVICE_ID');
555 555
 //define('F_DEVICE_CYPHER', 'F_DEVICE_CYPHER');
556 556
 
557
-define('F_PROVIDER_ID',   'F_PROVIDER_ID');
557
+define('F_PROVIDER_ID', 'F_PROVIDER_ID');
558 558
 // define('F_PROVIDER_LIST', 'F_PROVIDER_LIST');
559 559
 
560 560
 define('F_IMPERSONATE_STATUS', 'F_IMPERSONATE_STATUS');
561 561
 define('F_IMPERSONATE_OPERATOR', 'F_IMPERSONATE_OPERATOR');
562 562
 
563
-define('F_LOGIN_STATUS',  'F_LOGIN_STATUS');
563
+define('F_LOGIN_STATUS', 'F_LOGIN_STATUS');
564 564
 define('F_LOGIN_MESSAGE', 'F_LOGIN_MESSAGE');
565 565
 
566
-define('F_PLAYER_REGISTER_STATUS',  'F_PLAYER_REGISTER_STATUS');
566
+define('F_PLAYER_REGISTER_STATUS', 'F_PLAYER_REGISTER_STATUS');
567 567
 define('F_PLAYER_REGISTER_MESSAGE', 'F_PLAYER_REGISTER_MESSAGE');
568 568
 
569 569
 define('F_USER_ID', 'F_USER_ID');
@@ -607,78 +607,78 @@  discard block
 block discarded – undo
607 607
 
608 608
 
609 609
 // Option groups
610
-define('OPT_ALL',      0);
611
-define('OPT_MESSAGE',  1);
610
+define('OPT_ALL', 0);
611
+define('OPT_MESSAGE', 1);
612 612
 define('OPT_UNIVERSE', 2);
613 613
 define('OPT_INTERFACE', 3);
614 614
 
615 615
 // Message classes
616
-define('MSG_TYPE_OUTBOX'   ,  -1);
617
-define('MSG_TYPE_SPY'      ,   0);
618
-define('MSG_TYPE_PLAYER'   ,   1);
619
-define('MSG_TYPE_ALLIANCE' ,   2);
620
-define('MSG_TYPE_COMBAT'   ,   3);
621
-define('MSG_TYPE_RECYCLE'  ,   4);
622
-define('MSG_TYPE_TRANSPORT',   5);
623
-define('MSG_TYPE_ADMIN'    ,   6);
624
-define('MSG_TYPE_EXPLORE'  ,  15);
625
-define('MSG_TYPE_QUE'      ,  99);
626
-define('MSG_TYPE_NEW'      , 100);
616
+define('MSG_TYPE_OUTBOX', -1);
617
+define('MSG_TYPE_SPY', 0);
618
+define('MSG_TYPE_PLAYER', 1);
619
+define('MSG_TYPE_ALLIANCE', 2);
620
+define('MSG_TYPE_COMBAT', 3);
621
+define('MSG_TYPE_RECYCLE', 4);
622
+define('MSG_TYPE_TRANSPORT', 5);
623
+define('MSG_TYPE_ADMIN', 6);
624
+define('MSG_TYPE_EXPLORE', 15);
625
+define('MSG_TYPE_QUE', 99);
626
+define('MSG_TYPE_NEW', 100);
627 627
 
628 628
 // Attack verification statuses
629
-define('ATTACK_ALLOWED'           ,  0);
630
-define('ATTACK_NO_TARGET'         ,  1);
631
-define('ATTACK_OWN'               ,  2);
632
-define('ATTACK_WRONG_MISSION'     ,  3);
633
-define('ATTACK_NO_ALLY_DEPOSIT'   ,  4);
634
-define('ATTACK_NO_DEBRIS'         ,  5);
635
-define('ATTACK_VACATION'          ,  6);
636
-define('ATTACK_SAME_IP'           ,  7);
637
-define('ATTACK_BUFFING'           ,  8);
638
-define('ATTACK_ADMIN'             ,  9);
639
-define('ATTACK_NOOB'              , 10);
640
-define('ATTACK_OWN_VACATION'      , 11);
641
-define('ATTACK_NO_SILO'           , 12);
642
-define('ATTACK_NO_MISSILE'        , 13);
643
-define('ATTACK_NO_FLEET'          , 14);
644
-define('ATTACK_NO_SLOTS'          , 15);
645
-define('ATTACK_NO_SHIPS'          , 16);
646
-define('ATTACK_NO_RECYCLERS'      , 17);
647
-define('ATTACK_NO_SPIES'          , 18);
648
-define('ATTACK_NO_COLONIZER'      , 19);
649
-define('ATTACK_MISSILE_TOO_FAR'   , 20);
650
-define('ATTACK_WRONG_STRUCTURE'   , 21);
651
-define('ATTACK_NO_FUEL'           , 22);
652
-define('ATTACK_NO_RESOURCES'      , 23);
653
-define('ATTACK_NO_ACS'            , 24);
654
-define('ATTACK_ACS_MISSTARGET'    , 25);
655
-define('ATTACK_WRONG_SPEED'       , 26);
656
-define('ATTACK_ACS_TOO_LATE'      , 27);
657
-define('ATTACK_BASHING'           , 28);
658
-define('ATTACK_BASHING_WAR_DELAY' , 29);
659
-define('ATTACK_ACS_WRONG_TARGET'  , 30);
660
-define('ATTACK_SAME'              , 31);
629
+define('ATTACK_ALLOWED', 0);
630
+define('ATTACK_NO_TARGET', 1);
631
+define('ATTACK_OWN', 2);
632
+define('ATTACK_WRONG_MISSION', 3);
633
+define('ATTACK_NO_ALLY_DEPOSIT', 4);
634
+define('ATTACK_NO_DEBRIS', 5);
635
+define('ATTACK_VACATION', 6);
636
+define('ATTACK_SAME_IP', 7);
637
+define('ATTACK_BUFFING', 8);
638
+define('ATTACK_ADMIN', 9);
639
+define('ATTACK_NOOB', 10);
640
+define('ATTACK_OWN_VACATION', 11);
641
+define('ATTACK_NO_SILO', 12);
642
+define('ATTACK_NO_MISSILE', 13);
643
+define('ATTACK_NO_FLEET', 14);
644
+define('ATTACK_NO_SLOTS', 15);
645
+define('ATTACK_NO_SHIPS', 16);
646
+define('ATTACK_NO_RECYCLERS', 17);
647
+define('ATTACK_NO_SPIES', 18);
648
+define('ATTACK_NO_COLONIZER', 19);
649
+define('ATTACK_MISSILE_TOO_FAR', 20);
650
+define('ATTACK_WRONG_STRUCTURE', 21);
651
+define('ATTACK_NO_FUEL', 22);
652
+define('ATTACK_NO_RESOURCES', 23);
653
+define('ATTACK_NO_ACS', 24);
654
+define('ATTACK_ACS_MISSTARGET', 25);
655
+define('ATTACK_WRONG_SPEED', 26);
656
+define('ATTACK_ACS_TOO_LATE', 27);
657
+define('ATTACK_BASHING', 28);
658
+define('ATTACK_BASHING_WAR_DELAY', 29);
659
+define('ATTACK_ACS_WRONG_TARGET', 30);
660
+define('ATTACK_SAME', 31);
661 661
 define('ATTACK_RESOURCE_FORBIDDEN', 32);
662
-define('ATTACK_TRANSPORT_EMPTY'   , 33);
663
-define('ATTACK_SPIES_LONLY'       , 34);
664
-define('ATTACK_TOO_FAR'           , 35);
665
-define('ATTACK_OVERLOADED'        , 36);
666
-define('ATTACK_MISSION_ABSENT'    , 37);
667
-define('ATTACK_WRONG_UNIT'        , 38);
668
-define('ATTACK_ZERO_SPEED'        , 39);
669
-define('ATTACK_SHIP_COUNT_WRONG'  , 40);
662
+define('ATTACK_TRANSPORT_EMPTY', 33);
663
+define('ATTACK_SPIES_LONLY', 34);
664
+define('ATTACK_TOO_FAR', 35);
665
+define('ATTACK_OVERLOADED', 36);
666
+define('ATTACK_MISSION_ABSENT', 37);
667
+define('ATTACK_WRONG_UNIT', 38);
668
+define('ATTACK_ZERO_SPEED', 39);
669
+define('ATTACK_SHIP_COUNT_WRONG', 40);
670 670
 define('ATTACK_RESOURCE_COUNT_WRONG', 41);
671 671
 define('ATTACK_MORATORIUM', 42);
672 672
 define('ATTACK_CHILD_PROTECTION', 43);
673 673
 
674 674
 
675 675
 // *** Races - Homeworlds
676
-define('RACE_NONE'    , 0);
677
-define('RACE_EARTH'   , 1);
678
-define('RACE_MOON'    , 2);
679
-define('RACE_MERCURY' , 3);
680
-define('RACE_VENUS'   , 4);
681
-define('RACE_MARS'    , 5);
676
+define('RACE_NONE', 0);
677
+define('RACE_EARTH', 1);
678
+define('RACE_MOON', 2);
679
+define('RACE_MERCURY', 3);
680
+define('RACE_VENUS', 4);
681
+define('RACE_MARS', 5);
682 682
 define('RACE_ASTEROID', 6);
683 683
 // define('MARKET_INFO'         , 7);
684 684
 
@@ -686,114 +686,114 @@  discard block
 block discarded – undo
686 686
 
687 687
 // *** Market variables
688 688
 // === Market blocks
689
-define('MARKET_ENTRY'        , 0);
690
-define('MARKET_RESOURCES'    , 1);
691
-define('MARKET_SCRAPPER'     , 2);
692
-define('MARKET_STOCKMAN'     , 3);
693
-define('MARKET_EXCHANGE'     , 4);
694
-define('MARKET_BANKER'       , 5);
695
-define('MARKET_PAWNSHOP'     , 6);
696
-define('MARKET_INFO'         , 7);
689
+define('MARKET_ENTRY', 0);
690
+define('MARKET_RESOURCES', 1);
691
+define('MARKET_SCRAPPER', 2);
692
+define('MARKET_STOCKMAN', 3);
693
+define('MARKET_EXCHANGE', 4);
694
+define('MARKET_BANKER', 5);
695
+define('MARKET_PAWNSHOP', 6);
696
+define('MARKET_INFO', 7);
697 697
 
698 698
 // === Market error statuses
699
-define('MARKET_NOTHING'              ,  0);
700
-define('MARKET_DEAL'                 ,  1);
701
-define('MARKET_DEAL_TRADE'           ,  2);
702
-define('MARKET_NO_DM'                ,  3);
703
-define('MARKET_NO_RESOURCES'         ,  4);
704
-define('MARKET_ZERO_DEAL'            ,  5);
705
-define('MARKET_NO_SHIPS'             ,  6);
706
-define('MARKET_NOT_A_SHIP'           ,  7);
707
-define('MARKET_NO_STOCK'             ,  8);
708
-define('MARKET_ZERO_RES_STOCK'       ,  9);
709
-define('MARKET_NEGATIVE_SHIPS'       , 10);
710
-
711
-define('MARKET_INFO_PLAYER'          , 12);
712
-define('MARKET_INFO_WRONG'           , 11);
699
+define('MARKET_NOTHING', 0);
700
+define('MARKET_DEAL', 1);
701
+define('MARKET_DEAL_TRADE', 2);
702
+define('MARKET_NO_DM', 3);
703
+define('MARKET_NO_RESOURCES', 4);
704
+define('MARKET_ZERO_DEAL', 5);
705
+define('MARKET_NO_SHIPS', 6);
706
+define('MARKET_NOT_A_SHIP', 7);
707
+define('MARKET_NO_STOCK', 8);
708
+define('MARKET_ZERO_RES_STOCK', 9);
709
+define('MARKET_NEGATIVE_SHIPS', 10);
710
+
711
+define('MARKET_INFO_PLAYER', 12);
712
+define('MARKET_INFO_WRONG', 11);
713 713
 define('MARKET_INFO_PLAYER_NOT_FOUND', 13);
714
-define('MARKET_INFO_PLAYER_WRONG'    , 14);
715
-define('MARKET_INFO_PLAYER_SAME'     , 15);
714
+define('MARKET_INFO_PLAYER_WRONG', 14);
715
+define('MARKET_INFO_PLAYER_SAME', 15);
716 716
 
717 717
 
718 718
 
719 719
 
720 720
 // *** Mercenary/talent bonus types
721
-define('BONUS_NONE'    ,            0);  // No bonus
722
-define('BONUS_PERCENT' ,            1);  // Percent on base value
723
-define('BONUS_ADD'     ,            2);  // Add
724
-define('BONUS_ABILITY' ,            3);  // Some ability
725
-define('BONUS_MULTIPLY',            4);  // Multiply by value
726
-define('BONUS_PERCENT_CUMULATIVE' , 5);  // Cumulative percent on base value
727
-define('BONUS_PERCENT_DEGRADED' ,   6);  // Bonus amount degraded with increase as pow(bonus, level) (?)
728
-define('BONUS_SPEED',               7);  // Speed bonus
721
+define('BONUS_NONE', 0); // No bonus
722
+define('BONUS_PERCENT', 1); // Percent on base value
723
+define('BONUS_ADD', 2); // Add
724
+define('BONUS_ABILITY', 3); // Some ability
725
+define('BONUS_MULTIPLY', 4); // Multiply by value
726
+define('BONUS_PERCENT_CUMULATIVE', 5); // Cumulative percent on base value
727
+define('BONUS_PERCENT_DEGRADED', 6); // Bonus amount degraded with increase as pow(bonus, level) (?)
728
+define('BONUS_SPEED', 7); // Speed bonus
729 729
 
730 730
 // *** Action constant (build should be replaced with ACTION)
731
-define('BUILD_CREATE' ,  1);
731
+define('BUILD_CREATE', 1);
732 732
 define('BUILD_DESTROY', -1);
733 733
 define('BUILD_AUTOCONVERT', 2);
734 734
 
735
-define('ACTION_SELL'       , -1);
736
-define('ACTION_NOTHING'    ,  0);
737
-define('ACTION_BUY'        ,  1);
738
-define('ACTION_USE'        ,  2);
739
-define('ACTION_DELETE'     ,  3);
735
+define('ACTION_SELL', -1);
736
+define('ACTION_NOTHING', 0);
737
+define('ACTION_BUY', 1);
738
+define('ACTION_USE', 2);
739
+define('ACTION_DELETE', 3);
740 740
 
741 741
 // *** Check unit availability codes
742
-define('BUILD_ALLOWED'         , 0); // HARDCODED! DO NOT CHANGE!
742
+define('BUILD_ALLOWED', 0); // HARDCODED! DO NOT CHANGE!
743 743
 define('BUILD_REQUIRE_NOT_MEET', 1);
744
-define('BUILD_AMOUNT_WRONG'    , 2);
745
-define('BUILD_QUE_WRONG'       , 3);
746
-define('BUILD_QUE_UNIT_WRONG'  , 4);
747
-define('BUILD_INDESTRUCTABLE'  , 5);
748
-define('BUILD_NO_RESOURCES'    , 6);
749
-define('BUILD_NO_UNITS'        , 7);
750
-define('BUILD_UNIT_BUSY'       , 8);
751
-define('BUILD_QUE_FULL'        , 9);
752
-define('BUILD_SILO_FULL'       ,10);
753
-define('BUILD_MAX_REACHED'     ,11);
754
-define('BUILD_SECTORS_NONE'    ,12);
744
+define('BUILD_AMOUNT_WRONG', 2);
745
+define('BUILD_QUE_WRONG', 3);
746
+define('BUILD_QUE_UNIT_WRONG', 4);
747
+define('BUILD_INDESTRUCTABLE', 5);
748
+define('BUILD_NO_RESOURCES', 6);
749
+define('BUILD_NO_UNITS', 7);
750
+define('BUILD_UNIT_BUSY', 8);
751
+define('BUILD_QUE_FULL', 9);
752
+define('BUILD_SILO_FULL', 10);
753
+define('BUILD_MAX_REACHED', 11);
754
+define('BUILD_SECTORS_NONE', 12);
755 755
 define('BUILD_AUTOCONVERT_AVAILABLE', 13);
756 756
 
757 757
 
758 758
 // *** Que types
759 759
 define('QUE_STRUCTURES', 1);
760
-define('QUE_HANGAR'    , 4);
761
-define('QUE_RESEARCH'  , 7);
762
-define('QUE_MERCENARY' , 600); // UNIT_MERCENARIES
760
+define('QUE_HANGAR', 4);
761
+define('QUE_RESEARCH', 7);
762
+define('QUE_MERCENARY', 600); // UNIT_MERCENARIES
763 763
 // *** Subque types
764
-define('SUBQUE_PLANET'  , 1);
765
-define('SUBQUE_MOON'    , 3);
766
-define('SUBQUE_FLEET'   , 4);
767
-define('SUBQUE_DEFENSE' , 6);
764
+define('SUBQUE_PLANET', 1);
765
+define('SUBQUE_MOON', 3);
766
+define('SUBQUE_FLEET', 4);
767
+define('SUBQUE_DEFENSE', 6);
768 768
 define('SUBQUE_RESEARCH', 7);
769 769
 
770 770
 // *** Que items
771
-define('QI_UNIT_ID'   , 0);
772
-define('QI_AMOUNT'    , 1);
773
-define('QI_TIME'      , 2);
774
-define('QI_MODE'      , 3);
775
-define('QI_QUE_ID'    , 4);
776
-define('QI_QUE_TYPE'  , 4);
777
-define('QI_PLANET_ID' , 5);
771
+define('QI_UNIT_ID', 0);
772
+define('QI_AMOUNT', 1);
773
+define('QI_TIME', 2);
774
+define('QI_MODE', 3);
775
+define('QI_QUE_ID', 4);
776
+define('QI_QUE_TYPE', 4);
777
+define('QI_PLANET_ID', 5);
778 778
 
779 779
 
780 780
 // *** Units
781 781
 
782 782
 // *** Sort options
783
-define('SORT_ASCENDING' , 0);
783
+define('SORT_ASCENDING', 0);
784 784
 define('SORT_DESCENDING', 1);
785 785
 
786
-define('SORT_ID'             , 0);
787
-define('SORT_LOCATION'       , 1);
788
-define('SORT_NAME'           , 2);
789
-define('SORT_SIZE'           , 3);
790
-define('SORT_EMAIL'          , 4);
791
-define('SORT_IP'             , 5);
786
+define('SORT_ID', 0);
787
+define('SORT_LOCATION', 1);
788
+define('SORT_NAME', 2);
789
+define('SORT_SIZE', 3);
790
+define('SORT_EMAIL', 4);
791
+define('SORT_IP', 5);
792 792
 define('SORT_TIME_REGISTERED', 6);
793 793
 define('SORT_TIME_LAST_VISIT', 7);
794
-define('SORT_TIME_BAN_UNTIL' , 8);
795
-define('SORT_REFERRAL_COUNT' , 9);
796
-define('SORT_REFERRAL_DM'    , 10);
794
+define('SORT_TIME_BAN_UNTIL', 8);
795
+define('SORT_REFERRAL_COUNT', 9);
796
+define('SORT_REFERRAL_DM', 10);
797 797
 
798 798
 
799 799
 define('HULL_SIZE_TINY', 1);
@@ -936,10 +936,10 @@  discard block
 block discarded – undo
936 936
 
937 937
 // === Artifacts
938 938
 define('UNIT_ARTIFACTS', 1000);
939
-define('ART_LHC', 1001);      // Additional moon chance
940
-define('ART_RCD_SMALL', 1002);   // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
941
-define('ART_RCD_MEDIUM', 1003);  // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
942
-define('ART_RCD_LARGE', 1004);   // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
939
+define('ART_LHC', 1001); // Additional moon chance
940
+define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
941
+define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
942
+define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
943 943
 define('ART_HEURISTIC_CHIP', 1005); // Speed up research
944 944
 define('ART_NANO_BUILDER', 1006); // Speed up building
945 945
 define('ART_NANO_CONSTRUCTOR', 1007); // RESERVED Speed up hangar constructions
@@ -1010,18 +1010,18 @@  discard block
 block discarded – undo
1010 1010
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE1', 2201); // Блиц-сервер, участник 0-го раунда, 1-е место
1011 1011
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE2', 2202); // Блиц-сервер, участник 0-го раунда, 2-е место
1012 1012
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE3', 2203); // Блиц-сервер, участник 0-го раунда, 3-е место
1013
-define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1013
+define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1014 1014
 
1015 1015
 define('UNIT_AWARD_MEMORY', 2300); // Памятные знаки за существование и участие - например "4 года в игре". "Был онлайн в новогоднюю ночь 2013". итд
1016
-define('UNIT_AWARD_MEMORY_IMMORTAL', 2301);  // Бессмертный
1017
-define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1016
+define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный
1017
+define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1018 1018
 define('UNIT_AWARD_MEMORY_BLITZ_R0', 2303); // Блиц-сервер, участник 0-го раунда
1019 1019
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SIMPLE', 2304); // День Рождения СН
1020 1020
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_BRONZE', 2305); // День Рождения СН
1021 1021
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SILVER', 2306); // День Рождения СН
1022 1022
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_GOLD', 2307); // День Рождения СН
1023 1023
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_PLATINUM', 2308); // День Рождения СН
1024
-define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1024
+define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1025 1025
 
1026 1026
 define('UNIT_AWARD_PENNANT', 2400); // Переходящий вымпел - индикация статуса на сервере: "Топ-1", "Топ", "Сабтоп", "Самый большой флот" итд
1027 1027
 define('UNIT_AWARD_BADGE', 2600); // Бейджики/значки за ачивки - например, "Построил 1000 кораблей"
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
 
1119 1119
 define('UNIT_NEXT', 4000); // !!! Next unit start on 4000 !!!
1120 1120
 
1121
-define('GROUP_PART',         800000);
1121
+define('GROUP_PART', 800000);
1122 1122
 // Зарезервировано для запчастей: 800.001 - 899.999
1123 1123
 // define('GROUP_PART_HULL',    801000); // Корпуса - 1000 штук
1124 1124
 // define('GROUP_PART_ARMOR',   802000); // Броня - 1000 штук
@@ -1373,32 +1373,32 @@  discard block
 block discarded – undo
1373 1373
 
1374 1374
 
1375 1375
 // define('NICK_ID',               -1);
1376
-define('NICK_HTML',              0);
1377
-
1378
-define('NICK_FIRST',             1);
1379
-define('NICK_RACE',           1000);
1380
-define('NICK_GENDER',         2000);
1381
-define('NICK_AWARD',          3000);
1382
-define('NICK_VACATION',       3500);
1383
-define('NICK_BIRTHSDAY',      4000);
1384
-define('NICK_PREMIUM',        5000);
1385
-define('NICK_AUTH_LEVEL',     6000);
1386
-
1387
-define('NICK_HIGHLIGHT',      6300);
1388
-define('NICK_CLASS',          6450);
1389
-
1390
-define('NICK_NICK_CLASS',     6600);
1391
-define('NICK_NICK',           7000);
1376
+define('NICK_HTML', 0);
1377
+
1378
+define('NICK_FIRST', 1);
1379
+define('NICK_RACE', 1000);
1380
+define('NICK_GENDER', 2000);
1381
+define('NICK_AWARD', 3000);
1382
+define('NICK_VACATION', 3500);
1383
+define('NICK_BIRTHSDAY', 4000);
1384
+define('NICK_PREMIUM', 5000);
1385
+define('NICK_AUTH_LEVEL', 6000);
1386
+
1387
+define('NICK_HIGHLIGHT', 6300);
1388
+define('NICK_CLASS', 6450);
1389
+
1390
+define('NICK_NICK_CLASS', 6600);
1391
+define('NICK_NICK', 7000);
1392 1392
 define('NICK_NICK_CLASS_END', 7300);
1393 1393
 
1394
-define('NICK_ALLY_CLASS',     7600);
1395
-define('NICK_ALLY',           8000);
1394
+define('NICK_ALLY_CLASS', 7600);
1395
+define('NICK_ALLY', 8000);
1396 1396
 define('NICK_ALLY_CLASS_END', 8300);
1397 1397
 
1398
-define('NICK_CLASS_END',      8450);
1399
-define('NICK_HIGHLIGHT_END',  8600);
1398
+define('NICK_CLASS_END', 8450);
1399
+define('NICK_HIGHLIGHT_END', 8600);
1400 1400
 
1401
-define('NICK_LAST',           9999);
1401
+define('NICK_LAST', 9999);
1402 1402
 
1403 1403
 // Настройки игрока
1404 1404
 define('PLAYER_OPTION_MENU_SORT', 1);
@@ -1491,8 +1491,8 @@  discard block
 block discarded – undo
1491 1491
 define('LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10', 1);
1492 1492
 
1493 1493
 define('BLITZ_REGISTER_DISABLED', 0);
1494
-define('BLITZ_REGISTER_OPEN'    , 1);
1495
-define('BLITZ_REGISTER_CLOSED'  , 2);
1494
+define('BLITZ_REGISTER_OPEN', 1);
1495
+define('BLITZ_REGISTER_CLOSED', 2);
1496 1496
 define('BLITZ_REGISTER_SHOW_LOGIN', 3);
1497 1497
 define('BLITZ_REGISTER_DISCLOSURE_NAMES', 4);
1498 1498
 
Please login to merge, or discard this patch.
includes/functions/_news.php 1 patch
Spacing   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  discard block
 block discarded – undo
11 11
   $announce_list = db_news_list_get_by_query($template, $query_where, $query_limit);
12 12
 
13 13
   $users = array();
14
-  while($announce = db_fetch($announce_list)) {
15
-    if($announce['user_id'] && !isset($users[$announce['user_id']])) {
14
+  while ($announce = db_fetch($announce_list)) {
15
+    if ($announce['user_id'] && !isset($users[$announce['user_id']])) {
16 16
       $users[$announce['user_id']] = db_user_by_id($announce['user_id']);
17 17
     }
18 18
 
19 19
     $survey_vote = array('survey_vote_id' => 1);
20 20
     $survey_complete = strtotime($announce['survey_until']) < SN_TIME_NOW;
21 21
 
22
-    if($announce['survey_id'] && !empty($user['id'])) {
22
+    if ($announce['survey_id'] && !empty($user['id'])) {
23 23
       $survey_vote = !$survey_complete ? db_survey_get_vote($announce, $user) : array();
24 24
     }
25 25
 
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
       'ANNOUNCE'        => cht_message_parse($announce['strAnnounce'], false, intval($announce['authlevel'])),
32 32
       'DETAIL_URL'      => $announce['detail_url'],
33 33
       'USER_NAME'       =>
34
-        isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)) :
35
-          js_safe_string($announce['user_name']),
34
+        isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)) : js_safe_string($announce['user_name']),
36 35
       'NEW'             => $announce['unix_time'] + $config->game_news_actual >= SN_TIME_NOW,
37 36
       'FUTURE'          => $announce['unix_time'] > SN_TIME_NOW,
38 37
       'SURVEY_ID'       => $announce['survey_id'],
@@ -42,25 +41,25 @@  discard block
 block discarded – undo
42 41
       'SURVEY_UNTIL'    => $announce['survey_until'],
43 42
     ));
44 43
 
45
-    foreach($announce_exploded as $announce_paragraph) {
44
+    foreach ($announce_exploded as $announce_paragraph) {
46 45
       $template->assign_block_vars('announces.paragraph', array(
47 46
         'TEXT' => $announce_paragraph,
48 47
       ));
49 48
     }
50 49
 
51
-    if($announce['survey_id']) {
50
+    if ($announce['survey_id']) {
52 51
       $survey_query = db_survey_get_answer_texts($announce);
53 52
       $survey_vote_result = array();
54 53
       $total_votes = 0;
55
-      while($row = db_fetch($survey_query)) {
54
+      while ($row = db_fetch($survey_query)) {
56 55
         $survey_vote_result[] = $row;
57 56
         $total_votes += $row['VOTES'];
58 57
       }
59 58
 
60
-      if(empty($survey_vote) && !$survey_complete) {
59
+      if (empty($survey_vote) && !$survey_complete) {
61 60
         // Can vote
62 61
         $survey_query = db_survey_answers_get_list_by_parent($announce);
63
-        while($row = db_fetch($survey_query)) {
62
+        while ($row = db_fetch($survey_query)) {
64 63
           $template->assign_block_vars('announces.survey_answers', array(
65 64
             'ID'   => $row['survey_answer_id'],
66 65
             'TEXT' => $row['survey_answer_text'],
@@ -68,7 +67,7 @@  discard block
 block discarded – undo
68 67
         }
69 68
       } else {
70 69
         // Show result
71
-        foreach($survey_vote_result as &$vote_result) {
70
+        foreach ($survey_vote_result as &$vote_result) {
72 71
           $vote_percent = $total_votes ? $vote_result['VOTES'] / $total_votes * 100 : 0;
73 72
           $vote_result['PERCENT'] = $vote_percent;
74 73
           $vote_result['PERCENT_TEXT'] = round($vote_percent, 1);
@@ -85,7 +84,7 @@  discard block
 block discarded – undo
85 84
 }
86 85
 
87 86
 function nws_mark_read(&$user) {
88
-  if(isset($user['id'])) {
87
+  if (isset($user['id'])) {
89 88
     db_user_set_by_id($user['id'], '`news_lastread` = ' . SN_TIME_NOW);
90 89
     $user['news_lastread'] = SN_TIME_NOW;
91 90
   }
@@ -94,17 +93,17 @@  discard block
 block discarded – undo
94 93
 }
95 94
 
96 95
 function survey_vote(&$user) {
97
-  if(empty($user['id'])) {
96
+  if (empty($user['id'])) {
98 97
     return true;
99 98
   }
100 99
 
101 100
   sn_db_transaction_start();
102 101
   $survey_id = sys_get_param_id('survey_id');
103 102
   $is_voted = db_survey_vote_get($user, $survey_id);
104
-  if(empty($is_voted)) {
103
+  if (empty($is_voted)) {
105 104
     $survey_vote_id = sys_get_param_id('survey_vote');
106 105
     $is_answer_exists = db_survey_answer_get($survey_id, $survey_vote_id);
107
-    if(!empty($is_answer_exists)) {
106
+    if (!empty($is_answer_exists)) {
108 107
       $user_name_safe = db_escape($user['username']);
109 108
       db_survey_vote_insert($user, $survey_id, $survey_vote_id, $user_name_safe);
110 109
     }
Please login to merge, or discard this patch.
includes/functions/sys_maintenance.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
     ),
25 25
   );
26 26
 
27
-  foreach($queries as &$query) {
28
-    if(!empty($query['query'])) {
27
+  foreach ($queries as &$query) {
28
+    if (!empty($query['query'])) {
29 29
       $query['result'] = doquery($query['query']);
30
-    } elseif(!empty($query['callable']) && is_callable($query['callable'])) {
30
+    } elseif (!empty($query['callable']) && is_callable($query['callable'])) {
31 31
       call_user_func($query['callable']);
32 32
     }
33 33
     $query['error'] = classSupernova::$db->db_error();
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
   $today_array = array($today_array['seconds'], $today_array['minutes'], $today_array['hours'], $today_array['mday'], $today_array['mon'], $today_array['year']);
72 72
 //  pdump($prev_run_array);
73 73
   $scheduleList = explode(',', $scheduleList);
74
-  array_walk($scheduleList, function (&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) {
74
+  array_walk($scheduleList, function(&$schedule) use ($prev_run_array, $today_array, $date_part_names_reverse, &$possible_schedules) {
75 75
     // pdump($schedule);
76 76
     $schedule = array('schedule_array' => array_reverse(explode(':', trim($schedule))));
77 77
 
@@ -83,21 +83,21 @@  discard block
 block discarded – undo
83 83
     */
84 84
     // pdump($schedule);
85 85
 
86
-    foreach($prev_run_array as $index => $date_part) {
86
+    foreach ($prev_run_array as $index => $date_part) {
87 87
       $schedule['array']['recorded'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $date_part;
88 88
       $schedule['array']['now'][$index] = isset($schedule['schedule_array'][$index]) ? intval($schedule['schedule_array'][$index]) : $today_array[$index];
89 89
     }
90
-    if($schedule['array']['recorded'] == $schedule['array']['now']) {
90
+    if ($schedule['array']['recorded'] == $schedule['array']['now']) {
91 91
       unset($schedule['array']['now']);
92 92
     }
93 93
 
94
-    foreach($schedule['array'] as $name => $array) {
94
+    foreach ($schedule['array'] as $name => $array) {
95 95
       $schedule['string'][$name] = "{$array[5]}-{$array[4]}-{$array[3]} {$array[2]}:{$array[1]}:{$array[0]}";
96 96
       $schedule['string'][$name . '_next'] = $schedule['string'][$name] . ' +1 ' . $interval;
97 97
       $schedule['string'][$name . '_prev'] = $schedule['string'][$name] . ' -1 ' . $interval;
98 98
     }
99 99
 
100
-    foreach($schedule['string'] as $string) {
100
+    foreach ($schedule['string'] as $string) {
101 101
       $timestamp = strtotime($string);
102 102
       $schedule['timestamp'][$timestamp] = $possible_schedules[$timestamp] = date(FMT_DATE_TIME_SQL, strtotime($string));
103 103
     }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
   $prev_run = 0;
131 131
   $next_run = 0;
132
-  foreach($possible_schedules as $timestamp => $string_date) {
132
+  foreach ($possible_schedules as $timestamp => $string_date) {
133 133
     $prev_run = SN_TIME_NOW >= $timestamp ? $timestamp : $prev_run;
134 134
     $next_run = SN_TIME_NOW < $timestamp && !$next_run ? $timestamp : $next_run;
135 135
 //    pdump($schedule, '$schedule ' . date(FMT_DATE_TIME_SQL, $schedule));
Please login to merge, or discard this patch.