Completed
Push — trunk ( 9bb608...09520e )
by SuperNova.WS
04:21
created
flying_fleets.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@  discard block
 block discarded – undo
2 2
 
3 3
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(!empty($_POST['return']) && is_array($_POST['return'])) {
6
-  foreach($_POST['return'] as $fleet_id) {
7
-    if($fleet_id = idval($fleet_id)) {
5
+if (!empty($_POST['return']) && is_array($_POST['return'])) {
6
+  foreach ($_POST['return'] as $fleet_id) {
7
+    if ($fleet_id = idval($fleet_id)) {
8 8
       sn_db_transaction_start();
9 9
       $FleetRow = db_fleet_get($fleet_id);
10 10
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 lng_include('overview');
24 24
 lng_include('fleet');
25 25
 
26
-if(!$planetrow) {
26
+if (!$planetrow) {
27 27
   messageBox($lang['fl_noplanetrow'], $lang['fl_error']);
28 28
 }
29 29
 
@@ -31,13 +31,13 @@  discard block
 block discarded – undo
31 31
 
32 32
 $i = 0;
33 33
 $fleet_list = fleet_list_by_owner_id($user['id']);
34
-foreach($fleet_list as $fleet_id => $fleet_row) {
34
+foreach ($fleet_list as $fleet_id => $fleet_row) {
35 35
   $i++;
36 36
   $fleet_data = tpl_parse_fleet_db($fleet_row, $i, $user);
37 37
 
38 38
   $template->assign_block_vars('fleets', $fleet_data['fleet']);
39 39
 
40
-  foreach($fleet_data['ships'] as $ship_data) {
40
+  foreach ($fleet_data['ships'] as $ship_data) {
41 41
     $template->assign_block_vars('fleets.ships', $ship_data);
42 42
   }
43 43
 }
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin.inc 2 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  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
   messageBox($lang['Denied_access'], $lang['ally_admin']);
9 9
 }
10 10
 
11 11
 $template = gettemplate('ali_admin', $template);
12 12
 
13 13
 $text_list = array(
14
-  1 => array ('db_field' => 'ally_description', 'text_type' => 'Public_text_of_alliance'),
15
-  2 => array ('db_field' => 'ally_text', 'text_type' => 'Internal_text'),
16
-  3 => array ('db_field' => 'ally_request', 'text_type' => 'Show_of_request_text'),
14
+  1 => array('db_field' => 'ally_description', 'text_type' => 'Public_text_of_alliance'),
15
+  2 => array('db_field' => 'ally_text', 'text_type' => 'Internal_text'),
16
+  3 => array('db_field' => 'ally_request', 'text_type' => 'Show_of_request_text'),
17 17
 );
18 18
 
19 19
 $allyTextID = sys_get_param_int('t', 1);
20
-$allyTextID = ($allyTextID<1 || $allyTextID>3) ? 1 : $allyTextID;
20
+$allyTextID = ($allyTextID < 1 || $allyTextID > 3) ? 1 : $allyTextID;
21 21
 
22
-if(sys_get_param_str('isSaveOptions')) {
22
+if (sys_get_param_str('isSaveOptions')) {
23 23
   require_once('includes/includes/sys_avatar.php');
24 24
 
25 25
   $new_image = $ally['ally_image'];
@@ -31,32 +31,32 @@  discard block
 block discarded – undo
31 31
 //  $template->assign_block_vars('result', $avatar_upload_result);
32 32
 
33 33
   $ally_changeset = array();
34
-  if(($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) {
34
+  if (($new_tag = sys_get_param_str_unsafe('tag', $ally['ally_tag'])) && $new_tag != $ally['ally_tag']) {
35 35
     $new_tag_unsafe = $new_tag;
36 36
     $new_tag = db_escape($new_tag);
37 37
     $isTaggedAllyExists = DBStaticAlly::db_ally_get_by_tag($new_tag);
38
-    if(!empty($isTaggedAllyExists)) {
38
+    if (!empty($isTaggedAllyExists)) {
39 39
       messageBox(sprintf($lang['ally_message_tag_exists'], $new_tag_unsafe), '', 'alliance.php?mode=admin&edit=ally');
40 40
     }
41 41
     $ally_changeset[] = "`ally_tag`='{$new_tag}'";
42 42
     db_user_set_by_id($ally['ally_user_id'], "`username`='[{$new_tag}]'");
43 43
   }
44 44
 
45
-  if(($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) {
45
+  if (($new_name = sys_get_param_str_unsafe('name', $ally['ally_name'])) && $new_name != $ally['ally_name']) {
46 46
     $new_name_unsafe = $new_name;
47 47
     $new_name = db_escape($new_name);
48 48
     $isTaggedAllyExists = DBStaticAlly::db_ally_get_by_name($new_name);
49
-    if(!empty($isTaggedAllyExists)) {
49
+    if (!empty($isTaggedAllyExists)) {
50 50
       messageBox(sprintf($lang['ally_message_name_exists'], $new_name_unsafe), '', 'alliance.php?mode=admin&edit=ally');
51 51
     }
52 52
     $ally_changeset[] = "`ally_name`='{$new_name}'";
53 53
   }
54 54
 
55
-  if(($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) {
55
+  if (($new_owner_rank = sys_get_param_str_unsafe('owner_range', $ally['ally_owner_range'])) && $new_owner_rank != $ally['ally_owner_range']) {
56 56
     $new_owner_rank = db_escape($new_owner_rank);
57 57
     $ally_changeset[] = "`ally_owner_range` = '{$new_owner_rank}'";
58 58
   }
59
-  if(($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) {
59
+  if (($new_web = sys_get_param_str_unsafe('web', $ally['ally_web'])) && $new_web != $ally['ally_web']) {
60 60
     $new_web = db_escape($new_web);
61 61
     $ally_changeset[] = "`ally_web` = '{$new_web}'";
62 62
   }
@@ -65,31 +65,31 @@  discard block
 block discarded – undo
65 65
 //  if(($new_request = sys_get_param_int('request_notallow', $ally['ally_request_notallow'])) && $new_request != $ally['ally_request_notallow']) {
66 66
 //    $ally_changeset[] = "`ally_request_notallow` = '{$new_request}'";
67 67
 //  }
68
-  if($new_image != $ally['ally_image']) {
68
+  if ($new_image != $ally['ally_image']) {
69 69
     $new_image = intval($new_image);
70 70
     $ally_changeset[] = "`ally_image` = '{$new_image}'";
71 71
   }
72 72
 
73
-  if(!empty($ally_changeset)) {
73
+  if (!empty($ally_changeset)) {
74 74
     doquery("UPDATE {{alliance}} SET " . implode(',', $ally_changeset) . " WHERE `id`='{$ally['id']}' LIMIT 1;");
75 75
     sys_redirect('alliance.php?mode=admin&edit=ally');
76 76
   }
77 77
 }
78
-elseif(sys_get_param_str('isSaveText'))
78
+elseif (sys_get_param_str('isSaveText'))
79 79
 {
80 80
   $text = sys_get_param_str_both('text');
81 81
   doquery("UPDATE {{alliance}} SET `{$text_list[$allyTextID]['db_field']}`='{$text['safe']}' WHERE `id`='{$ally['id']}';");
82 82
   $ally[$text_list[$allyTextID]['db_field']] = $text['unsafe'];
83 83
 }
84
-elseif(sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader'))
84
+elseif (sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader'))
85 85
 {
86
-  if(!$isAllyOwner)
86
+  if (!$isAllyOwner)
87 87
   {
88 88
     messageBox($lang['Denied_access'], $lang['ally_admin']);
89 89
   }
90 90
 
91 91
   $newLeader = db_user_by_id($idNewLeader, false, `ally_id`);
92
-  if($newLeader['ally_id'] == $user['ally_id'])
92
+  if ($newLeader['ally_id'] == $user['ally_id'])
93 93
   {
94 94
     sn_db_transaction_start();
95 95
     db_user_set_by_id($user['id'], "`ally_rank_id`='0'");
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
     sys_redirect('alliance.php');
100 100
   }
101 101
 }
102
-elseif(sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband'))
102
+elseif (sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband'))
103 103
 {
104
-  if(!$isAllyOwner)
104
+  if (!$isAllyOwner)
105 105
   {
106 106
     messageBox($lang['Denied_access'], $lang['ally_admin']);
107 107
   }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
   'ally_name' => htmlspecialchars($ally['ally_name']),
125 125
   'ally_tag' => htmlspecialchars($ally['ally_tag']),
126 126
   'ally_web' => htmlspecialchars($ally['ally_web']),
127
-  'ally_request_notallow_0' => (( $ally['ally_request_notallow']) ? ' SELECTED' : ''),
127
+  'ally_request_notallow_0' => (($ally['ally_request_notallow']) ? ' SELECTED' : ''),
128 128
   'ally_request_notallow_1' => ((!$ally['ally_request_notallow']) ? ' SELECTED' : ''),
129 129
   'ally_owner_range' => htmlspecialchars($ally['ally_owner_range']),
130 130
   'hideNotOwner' => $ally['ally_owner'] != $user['id'] ? 'display: hide;' : '',
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 {
134 134
   $userAllyAdmins = db_user_list("`ally_id`= {$ally['id']}", false, '`id`, `username`');
135 135
   unset($tmp);
136
-  foreach($userAllyAdmins as $userAllyAdmin)
136
+  foreach ($userAllyAdmins as $userAllyAdmin)
137 137
   {
138 138
     $tmp .= "<option value={$userAllyAdmin['id']}>{$userAllyAdmin['username']}</option>";
139 139
   }
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
   $template->assign_var('adminMembers', $tmp);
142 142
 }
143 143
 
144
-foreach($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale)
144
+foreach ($sn_ali_admin_internal as $sn_ali_admin_action => $sn_ali_admin_action_locale)
145 145
 {
146
-  if(!$sn_ali_admin_action_locale['title'])
146
+  if (!$sn_ali_admin_action_locale['title'])
147 147
   {
148 148
     continue;
149 149
   }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,14 +74,12 @@  discard block
 block discarded – undo
74 74
     doquery("UPDATE {{alliance}} SET " . implode(',', $ally_changeset) . " WHERE `id`='{$ally['id']}' LIMIT 1;");
75 75
     sys_redirect('alliance.php?mode=admin&edit=ally');
76 76
   }
77
-}
78
-elseif(sys_get_param_str('isSaveText'))
77
+} elseif(sys_get_param_str('isSaveText'))
79 78
 {
80 79
   $text = sys_get_param_str_both('text');
81 80
   doquery("UPDATE {{alliance}} SET `{$text_list[$allyTextID]['db_field']}`='{$text['safe']}' WHERE `id`='{$ally['id']}';");
82 81
   $ally[$text_list[$allyTextID]['db_field']] = $text['unsafe'];
83
-}
84
-elseif(sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader'))
82
+} elseif(sys_get_param_str('isTransfer') && $idNewLeader = sys_get_param_id('idNewLeader'))
85 83
 {
86 84
   if(!$isAllyOwner)
87 85
   {
@@ -98,8 +96,7 @@  discard block
 block discarded – undo
98 96
     sn_db_transaction_commit();
99 97
     sys_redirect('alliance.php');
100 98
   }
101
-}
102
-elseif(sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband'))
99
+} elseif(sys_get_param_str('isDisband') && sys_get_param_str('isConfirmDisband'))
103 100
 {
104 101
   if(!$isAllyOwner)
105 102
   {
Please login to merge, or discard this patch.
includes/alliance/ali_info.inc 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
 }
7 7
 
8 8
 $template = gettemplate('ali_info', true);
9 9
 
10
-if($mode == 'exit')
10
+if ($mode == 'exit')
11 11
 {
12 12
   if ($ally['ally_owner'] == $user['id'])
13 13
   {
@@ -24,25 +24,25 @@  discard block
 block discarded – undo
24 24
     messageBox(sprintf($lang['ali_info_leave_success'], $ally['ally_name']), $lang['sys_alliance']);
25 25
   }
26 26
 }
27
-elseif($mode == 'ainfo')
27
+elseif ($mode == 'ainfo')
28 28
 {
29 29
   $tag = sys_get_param_str('tag');
30 30
   $id_ally = sys_get_param_id('a');
31
-  if($tag)
31
+  if ($tag)
32 32
   {
33 33
     $ally = doquery("SELECT * FROM {{alliance}} WHERE ally_tag='{$tag}' LIMIT 1;", '', true);
34 34
   }
35
-  elseif($id_ally)
35
+  elseif ($id_ally)
36 36
   {
37 37
     $ally = doquery("SELECT * FROM {{alliance}} WHERE id='{$id_ally}' LIMIT 1;", '', true);
38 38
   }
39 39
 
40
-  if(!$ally)
40
+  if (!$ally)
41 41
   {
42 42
     messageBox($lang['ali_sys_notFound'], $lang['Ally_info_1']);
43 43
   }
44 44
 
45
-  if(!$ally['ally_description'])
45
+  if (!$ally['ally_description'])
46 46
   {
47 47
     $ally['ally_description'] = $lang['Ally_nodescription'];
48 48
   }
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
     'EXTERNAL'     => true,
52 52
     'USER_ALLY_ID' => $user['ally_id'],
53 53
   ));
54
-  $page_header          = $lang['sys_alliance'];
54
+  $page_header = $lang['sys_alliance'];
55 55
 }
56 56
 else
57 57
 {
58 58
   $page_header = $lang['your_alliance'];
59 59
 
60
-  if($ally['ally_owner'] == $user['id'])
60
+  if ($ally['ally_owner'] == $user['id'])
61 61
   {
62 62
     $range = $ally['ally_owner_range'] ? $ally['ally_owner_range'] : $lang['Founder'];
63 63
   }
64
-  elseif($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name']))
64
+  elseif ($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name']))
65 65
   {
66 66
     $range = $ranks[$user['ally_rank_id']]['name'];
67 67
   }
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 ));
106 106
 
107 107
 $relations = ali_relations($ally['id']);
108
-foreach($relations as $relation)
108
+foreach ($relations as $relation)
109 109
 {
110
-  if($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id'])
110
+  if ($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id'])
111 111
   {
112 112
     $template->assign_block_vars('relation', array(
113 113
       'NAME'     => $relation['alliance_diplomacy_contr_ally_name'],
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
   }
118 118
 }
119 119
 
120
-function ali_render(){$func_args = func_get_args();return sn_function_call(__FUNCTION__, $func_args);}
120
+function ali_render() {$func_args = func_get_args(); return sn_function_call(__FUNCTION__, $func_args); }
121 121
 ali_render();
122 122
 
123 123
 display($template, "{$lang['alliance']} [{$ally['ally_name']}]");
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,16 +23,14 @@  discard block
 block discarded – undo
23 23
     $lang['Go_out_welldone'] = str_replace("%s", $ally_name, $lang['Go_out_welldone']);
24 24
     messageBox(sprintf($lang['ali_info_leave_success'], $ally['ally_name']), $lang['sys_alliance']);
25 25
   }
26
-}
27
-elseif($mode == 'ainfo')
26
+} elseif($mode == 'ainfo')
28 27
 {
29 28
   $tag = sys_get_param_str('tag');
30 29
   $id_ally = sys_get_param_id('a');
31 30
   if($tag)
32 31
   {
33 32
     $ally = doquery("SELECT * FROM {{alliance}} WHERE ally_tag='{$tag}' LIMIT 1;", '', true);
34
-  }
35
-  elseif($id_ally)
33
+  } elseif($id_ally)
36 34
   {
37 35
     $ally = doquery("SELECT * FROM {{alliance}} WHERE id='{$id_ally}' LIMIT 1;", '', true);
38 36
   }
@@ -52,20 +50,17 @@  discard block
 block discarded – undo
52 50
     'USER_ALLY_ID' => $user['ally_id'],
53 51
   ));
54 52
   $page_header          = $lang['sys_alliance'];
55
-}
56
-else
53
+} else
57 54
 {
58 55
   $page_header = $lang['your_alliance'];
59 56
 
60 57
   if($ally['ally_owner'] == $user['id'])
61 58
   {
62 59
     $range = $ally['ally_owner_range'] ? $ally['ally_owner_range'] : $lang['Founder'];
63
-  }
64
-  elseif($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name']))
60
+  } elseif($user['ally_rank_id'] != 0 && isset($ranks[$user['ally_rank_id']]['name']))
65 61
   {
66 62
     $range = $ranks[$user['ally_rank_id']]['name'];
67
-  }
68
-  else
63
+  } else
69 64
   {
70 65
     $range = $lang['member'];
71 66
   }
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_diplomacy.inc 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use \DBAL\DbQuery;
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
6 6
 {
7 7
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
8 8
 }
@@ -16,28 +16,28 @@  discard block
 block discarded – undo
16 16
 
17 17
 $ally_name_safe = db_escape($user['ally_name']);
18 18
 
19
-if(sys_get_param_str('ali_dip_offer_make'))
19
+if (sys_get_param_str('ali_dip_offer_make'))
20 20
 {
21 21
   $alliance_negotiation_relation = sys_get_param_str('alliance_negotiation_relation');
22
-  if(!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list))
22
+  if (!array_key_exists($alliance_negotiation_relation, $sn_diplomacy_relation_list))
23 23
   {
24 24
     messageBox($lang['ali_dip_err_wrong_offer'], $page_title);
25 25
   }
26 26
 
27 27
   $alliance_negotiation_contr_ally_id = sys_get_param_id('alliance_negotiation_contr_ally_id');
28
-  if($alliance_negotiation_contr_ally_id == $user['ally_id'])
28
+  if ($alliance_negotiation_contr_ally_id == $user['ally_id'])
29 29
   {
30 30
     messageBox($lang['ali_dip_err_same_ally'], $page_title);
31 31
   }
32 32
 
33 33
   $contr_ally_row = doquery("SELECT `ally_name` FROM {{alliance}} WHERE `id` = {$alliance_negotiation_contr_ally_id} LIMIT 1;", '', true);
34
-  if(!$contr_ally_row)
34
+  if (!$contr_ally_row)
35 35
   {
36 36
     messageBox($lang['ali_dip_err_no_ally'], $page_title);
37 37
   }
38 38
 
39 39
   $relation_current_id = ali_relation($user['ally_id'], $alliance_negotiation_contr_ally_id);
40
-  if($alliance_negotiation_relation == $relation_current_id)
40
+  if ($alliance_negotiation_relation == $relation_current_id)
41 41
   {
42 42
     messageBox(sprintf($lang['ali_dip_err_offer_same'], $lang['ali_dip_relations'][$alliance_negotiation_relation]), $page_title);
43 43
   }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
   $relation_new = $sn_diplomacy_relation_list[$alliance_negotiation_relation];
51 51
   $relation_current = $sn_diplomacy_relation_list[$relation_current_id];
52
-  if($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1)
52
+  if ($relation_new['enter_delay'] == -1 || $relation_current['exit_delay'] == -1)
53 53
   {
54 54
     DbQuery::build()
55 55
       ->setTable('alliance_negotiation')
@@ -82,39 +82,39 @@  discard block
 block discarded – undo
82 82
 else
83 83
 {
84 84
   $offer_id = sys_get_param_id('offer_id');
85
-  if($offer_id)
85
+  if ($offer_id)
86 86
   {
87 87
     $offer_answer = sys_get_param_str('answer');
88 88
 
89 89
     $negotiation = doquery("SELECT * FROM {{alliance_negotiation}} WHERE alliance_negotiation_id = {$offer_id} LIMIT 1;", '', true);
90
-    if(!$negotiation)
90
+    if (!$negotiation)
91 91
     {
92 92
       messageBox($lang['ali_dip_err_offer_none'], $page_title);
93 93
     }
94
-    elseif($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id'])
94
+    elseif ($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id'])
95 95
     {
96 96
       // TODO: Add log of hack attempt
97 97
       messageBox($lang['ali_dip_err_offer_alien'], $page_title);
98 98
     }
99
-    elseif($negotiation['alliance_negotiation_ally_id'] == $user['ally_id'])
99
+    elseif ($negotiation['alliance_negotiation_ally_id'] == $user['ally_id'])
100 100
     {
101
-      if($offer_answer == 'accept')
101
+      if ($offer_answer == 'accept')
102 102
       {
103 103
         // TODO: Add log of hack attempt
104 104
         messageBox($lang['ali_dip_err_offer_accept_own'], $page_title);
105 105
       }
106
-      elseif($offer_answer == 'deny')
106
+      elseif ($offer_answer == 'deny')
107 107
       {
108 108
         doquery("DELETE FROM {{alliance_negotiation}} WHERE alliance_negotiation_id = {$offer_id} LIMIT 1;");
109 109
       }
110 110
     }
111 111
     else
112 112
     {
113
-      if($offer_answer == 'accept')
113
+      if ($offer_answer == 'accept')
114 114
       {
115 115
         $accept_offer = true;
116 116
       }
117
-      elseif($offer_answer == 'deny')
117
+      elseif ($offer_answer == 'deny')
118 118
       {
119 119
         DBStaticAlly::db_ally_negotiation_update_status_1($offer_id);
120 120
       }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
   }
123 123
 }
124 124
 
125
-if($accept_offer)
125
+if ($accept_offer)
126 126
 {
127 127
   sn_db_transaction_start();
128 128
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
   sn_db_transaction_commit();
162 162
 }
163 163
 
164
-foreach($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation)
164
+foreach ($sn_diplomacy_relation_list as $diplomacy_relation_id => $diplomacy_relation)
165 165
 {
166 166
   $template->assign_block_vars('relation', array(
167 167
     'ID'   => $diplomacy_relation_id,
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 }
171 171
 
172 172
 $query = doquery("SELECT id, ally_name, ally_tag FROM {{alliance}} WHERE `id` != {$user['ally_id']} ORDER BY ally_name;");
173
-while($alliance = db_fetch($query))
173
+while ($alliance = db_fetch($query))
174 174
 {
175 175
   $template->assign_block_vars('alliance', array(
176 176
     'ID'   => $alliance['id'],
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
   WHERE
190 190
     alliance_negotiation_ally_id = {$user['ally_id']} OR alliance_negotiation_contr_ally_id = {$user['ally_id']};"
191 191
 );
192
-while($offer = db_fetch($query))
192
+while ($offer = db_fetch($query))
193 193
 {
194 194
   $template->assign_block_vars('offer', array(
195 195
     'ID'       => $offer['alliance_negotiation_id'],
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -66,8 +66,7 @@  discard block
 block discarded – undo
66 66
       ->doInsert();
67 67
 
68 68
     $accept_offer = false;
69
-  }
70
-  else
69
+  } else
71 70
   {
72 71
     $accept_offer = true;
73 72
     $negotiation = array(
@@ -78,8 +77,7 @@  discard block
 block discarded – undo
78 77
       'alliance_negotiation_relation' => $alliance_negotiation_relation,
79 78
     );
80 79
   }
81
-}
82
-else
80
+} else
83 81
 {
84 82
   $offer_id = sys_get_param_id('offer_id');
85 83
   if($offer_id)
@@ -90,31 +88,26 @@  discard block
 block discarded – undo
90 88
     if(!$negotiation)
91 89
     {
92 90
       messageBox($lang['ali_dip_err_offer_none'], $page_title);
93
-    }
94
-    elseif($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id'])
91
+    } elseif($negotiation['alliance_negotiation_ally_id'] != $user['ally_id'] && $negotiation['alliance_negotiation_contr_ally_id'] != $user['ally_id'])
95 92
     {
96 93
       // TODO: Add log of hack attempt
97 94
       messageBox($lang['ali_dip_err_offer_alien'], $page_title);
98
-    }
99
-    elseif($negotiation['alliance_negotiation_ally_id'] == $user['ally_id'])
95
+    } elseif($negotiation['alliance_negotiation_ally_id'] == $user['ally_id'])
100 96
     {
101 97
       if($offer_answer == 'accept')
102 98
       {
103 99
         // TODO: Add log of hack attempt
104 100
         messageBox($lang['ali_dip_err_offer_accept_own'], $page_title);
105
-      }
106
-      elseif($offer_answer == 'deny')
101
+      } elseif($offer_answer == 'deny')
107 102
       {
108 103
         doquery("DELETE FROM {{alliance_negotiation}} WHERE alliance_negotiation_id = {$offer_id} LIMIT 1;");
109 104
       }
110
-    }
111
-    else
105
+    } else
112 106
     {
113 107
       if($offer_answer == 'accept')
114 108
       {
115 109
         $accept_offer = true;
116
-      }
117
-      elseif($offer_answer == 'deny')
110
+      } elseif($offer_answer == 'deny')
118 111
       {
119 112
         DBStaticAlly::db_ally_negotiation_update_status_1($offer_id);
120 113
       }
Please login to merge, or discard this patch.
includes/alliance/ali_external_create_ally.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 // Pretty Safe
3 3
 // TODO: Add ally_tag to usertable
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
6 6
 {
7 7
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
8 8
 }
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
 $ally_name_raw = sys_get_param_str_unsafe('name');
13 13
 $ally_name     = db_escape($ally_name_raw);
14 14
 
15
-if($ally_tag)
15
+if ($ally_tag)
16 16
 {
17
-  if(!$ally_name_raw || !$ally_tag_raw)
17
+  if (!$ally_name_raw || !$ally_tag_raw)
18 18
   {
19 19
     messageBox($lang['have_not_name'], $lang['make_alliance']);
20 20
   }
21 21
 
22 22
   $query = doquery("SELECT ally_tag FROM {{alliance}} WHERE `ally_tag` = '{$ally_tag}' or `ally_name` = '{$ally_name}' LIMIT 1;", true);
23
-  if($query)
23
+  if ($query)
24 24
   {
25 25
     messageBox(str_replace('%s', $query['ally_tag'] == $ally_tag_raw ? $ally_tag_raw : $ally_name_raw, $lang['always_exist']), $lang['make_alliance']);
26 26
   }
Please login to merge, or discard this patch.
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
   messageBox($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 = DBStaticPlanet::db_planet_list_sorted ( $user );
85
-if(count($colonies) > 1) {
84
+$colonies = DBStaticPlanet::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/flt_page0.inc 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
 // @version 1.0
6 6
 // @copyright 2008 by Chlorel for XNova
7 7
 
8
-if($fleet_ship_sort = sys_get_param_id('sort_elements')) {
8
+if ($fleet_ship_sort = sys_get_param_id('sort_elements')) {
9 9
   define('IN_AJAX', true);
10
-  if(!empty($lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) {
10
+  if (!empty($lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) {
11 11
     // player_save_option($user, PLAYER_OPTION_FLEET_SHIP_SORT, $fleet_ship_sort);
12 12
     // player_save_option($user, PLAYER_OPTION_FLEET_SHIP_SORT_INVERSE, sys_get_param_id('fleet_ship_sort_inverse', 0));
13 13
     classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT] = $fleet_ship_sort;
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
   die();
17 17
 }
18 18
 
19
-if(SN_IN_FLEET !== true) {
19
+if (SN_IN_FLEET !== true) {
20 20
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
21 21
 }
22 22
 
23 23
 lng_include('overview');
24 24
 
25
-if(!$planetrow) {
25
+if (!$planetrow) {
26 26
   messageBox($lang['fl_noplanetrow'], $lang['fl_error']);
27 27
 }
28 28
 
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 
31 31
 $record_index = 0;
32 32
 $ship_list = array();
33
-foreach(sn_get_groups('fleet') as $n => $unit_id) {
33
+foreach (sn_get_groups('fleet') as $n => $unit_id) {
34 34
   $unit_level = mrc_get_level($user, $planetrow, $unit_id, false, true);
35
-  if($unit_level > 0) {
35
+  if ($unit_level > 0) {
36 36
     $ship_data = get_ship_data($unit_id, $user);
37 37
     $ship_list[$unit_id] = array(
38 38
       '__INDEX'     => $record_index++,
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 
53 53
 $fleet_ship_sort = classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT];
54 54
 $fleet_ship_sort_inverse = classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT_INVERSE];
55
-if($fleet_ship_sort || $fleet_ship_sort_inverse != PLAYER_OPTION_SORT_ORDER_PLAIN) {
56
-  switch($fleet_ship_sort) {
55
+if ($fleet_ship_sort || $fleet_ship_sort_inverse != PLAYER_OPTION_SORT_ORDER_PLAIN) {
56
+  switch ($fleet_ship_sort) {
57 57
     case PLAYER_OPTION_SORT_NAME: $fleet_ship_sort_field = 'NAME'; break;
58 58
     case PLAYER_OPTION_SORT_SPEED: $fleet_ship_sort_field = 'SPEED'; break;
59 59
     case PLAYER_OPTION_SORT_COUNT: $fleet_ship_sort_field = 'AMOUNT'; break;
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
   });
69 69
 }
70 70
 
71
-foreach($ship_list as $ship_data) {
71
+foreach ($ship_list as $ship_data) {
72 72
   $template->assign_block_vars('ships', $ship_data);
73 73
 }
74 74
 
75
-foreach($lang['player_option_fleet_ship_sort'] as $sort_id => $sort_text) {
75
+foreach ($lang['player_option_fleet_ship_sort'] as $sort_id => $sort_text) {
76 76
   $template->assign_block_vars('ship_sort_list', array(
77 77
     'VALUE' => $sort_id,
78 78
     'TEXT' => $sort_text,
Please login to merge, or discard this patch.
_error-404.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,6 +4,6 @@
 block discarded – undo
4 4
 
5 5
 // header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
6 6
 // @header("{$serverProtocol} 200 OK");
7
-echo "File {$redirectFrom} not found on server. Contact administration if you think that this is error";
7
+echo "file {$redirectFrom} not found on server. Contact administration if you think that this is error";
8 8
 die();
9 9
 ?> */
Please login to merge, or discard this patch.
phalanx.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 $sensorLevel = mrc_get_level($user, $planetrow, STRUC_MOON_PHALANX);
20 20
 if (!intval($sensorLevel)) {
21
-  messageBox ($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
21
+  messageBox($lang['phalanx_nosensoravailable'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
22 22
 }
23 23
 
24 24
 if ($planetrow['planet_type'] != PT_MOON) {
25
-  messageBox ($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
25
+  messageBox($lang['phalanx_onlyformoons'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
26 26
 }
27 27
 
28 28
 $scan_galaxy  = sys_get_param_int('galaxy');
29 29
 $scan_system  = sys_get_param_int('system');
30 30
 $scan_planet  = sys_get_param_int('planet');
31
-$scan_planet_type  = 1; // sys_get_param_int('planettype');
31
+$scan_planet_type = 1; // sys_get_param_int('planettype');
32 32
 $id = sys_get_param_id('id');
33 33
 
34 34
 $source_galaxy = $planetrow['galaxy'];
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 $sensorRange = GetPhalanxRange($sensorLevel);
39 39
 
40 40
 $system_distance = abs($source_system - $scan_system);
41
-if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
41
+if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
42 42
 {
43
-  messageBox ($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
43
+  messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
44 44
 }
45 45
 
46 46
 $cost = $sensorLevel * 1000;
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type);
54
-if(!$planet_scanned['id'])
54
+if (!$planet_scanned['id'])
55 55
 {
56 56
   messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
57 57
 }
58 58
 
59
-if($planet_scanned['destruyed'])
59
+if ($planet_scanned['destruyed'])
60 60
 {
61
-  messageBox ($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
61
+  messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
62 62
 }
63 63
 
64 64
 DBStaticPlanet::db_planet_set_by_id($user['current_planet'], "deuterium = deuterium - {$cost}");
Please login to merge, or discard this patch.