Completed
Branch trunk (230097)
by SuperNova.WS
32:07
created
includes/vars_menu.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('INSIDE')) {
3
+if (!defined('INSIDE')) {
4 4
   die('Hack attempt!');
5 5
 }
6 6
 
Please login to merge, or discard this patch.
includes/db/db_queries_users.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     "SELECT `id` AS `ID`, `username` AS `NAME`, `ally_name` AS `ALLY`, `total_points` AS `STAT_POINTS`,
84 84
       `onlinetime` AS `ACTIVITY`
85 85
     FROM {{users}}
86
-    WHERE `onlinetime` >= ". (SN_TIME_NOW - $config->game_users_online_timeout) ." ORDER BY user_as_ally, `". $TypeSort ."` ASC;");
86
+    WHERE `onlinetime` >= ". (SN_TIME_NOW - $config->game_users_online_timeout) . " ORDER BY user_as_ally, `" . $TypeSort . "` ASC;");
87 87
 }
88 88
 
89 89
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
   return doquery("SELECT u.*, COUNT(r.id) AS referral_count, SUM(r.dark_matter) AS referral_dm FROM {{users}} as u
99 99
     LEFT JOIN {{referrals}} as r on r.id_partner = u.id
100 100
     WHERE" .
101
-    ($online ? " `onlinetime` >= ". (SN_TIME_NOW - $config->game_users_online_timeout) : ' user_as_ally IS NULL') .
101
+    ($online ? " `onlinetime` >= " . (SN_TIME_NOW - $config->game_users_online_timeout) : ' user_as_ally IS NULL') .
102 102
     " GROUP BY u.id
103 103
     ORDER BY user_as_ally, {$sort} ASC");
104 104
 }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
   !is_array($user_id_list) ? $user_id_list = array($user_id_list) : false;
115 115
 
116 116
   $user_list = array();
117
-  foreach($user_id_list as $user_id_unsafe) {
117
+  foreach ($user_id_list as $user_id_unsafe) {
118 118
     $user = db_user_by_id($user_id_unsafe);
119 119
     !empty($user) ? $user_list[$user_id_unsafe] = $user : false;
120 120
   }
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_mail.inc 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
4 4
 {
5 5
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
6 6
 }
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 
18 18
 $lang['r_list'] = "<option value=\"-1\">{$lang['All_players']}</option>";
19 19
 if ($ranks) {
20
-  foreach($ranks as $id => $array) {
21
-    $lang['r_list'] .= "<option value=\"" . $id  . "\">" . $array['name'] . "</option>";
20
+  foreach ($ranks as $id => $array) {
21
+    $lang['r_list'] .= "<option value=\"" . $id . "\">" . $array['name'] . "</option>";
22 22
   }
23 23
 }
24 24
 
Please login to merge, or discard this patch.
includes/alliance/ali_external_search.inc 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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
 }
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_rights.inc 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
4 4
 {
5 5
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
6 6
 }
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 $new_rank_name = sys_get_param_str('newRankName');
15 15
 if ($new_rank_name)
16 16
 {
17
-  foreach($ally_rights as $fieldName)
17
+  foreach ($ally_rights as $fieldName)
18 18
   {
19 19
     $newRank[$fieldName] = 0;
20 20
   }
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 {
29 29
   unset($ranks);
30 30
 
31
-  foreach($rankListInput as $rankID => $rank)
31
+  foreach ($rankListInput as $rankID => $rank)
32 32
   {
33
-    foreach($ally_rights as $rightName)
33
+    foreach ($ally_rights as $rightName)
34 34
     {
35 35
       $ranks[$rankID][$rightName] = $rank[$rightName] ? 1 : 0;
36 36
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $d = sys_get_param_int('d');
42 42
 if ($d && isset($ranks[$d]))
43 43
 {
44
-  if(count($ranks) == 1)
44
+  if (count($ranks) == 1)
45 45
   {
46 46
     message($lang['ali_adm_lastRank'], $lang['ali_adm_rights_title']);
47 47
   }
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 
54 54
 if (count($ranks))
55 55
 {
56
-  foreach($ranks as $rankID => $rank)
56
+  foreach ($ranks as $rankID => $rank)
57 57
   {
58 58
     $rank_data = array(
59 59
       'ID'   => $rankID,
60 60
       'NAME' => $rank['name'],
61 61
     );
62 62
 
63
-    for($i = 1; $i < count($rank); $i++)
63
+    for ($i = 1; $i < count($rank); $i++)
64 64
     {
65
-      $rank_data['R' . $i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : '') ;
65
+      $rank_data['R' . $i] = (($rank[$ally_rights[$i]] == 1) ? ' checked' : '');
66 66
       $rank_data['N' . $i] = $ally_rights[$i];
67 67
     }
68 68
 
Please login to merge, or discard this patch.
includes/alliance/ali_info.inc 1 patch
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
     message(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
     message($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,7 +105,7 @@  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 110
   /*
111 111
   if($relation['alliance_diplomacy_contr_ally_id'] == $user['ally_id'])
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     $relation['alliance_diplomacy_contr_ally_name'] = $contr_ally['ally_name'];
115 115
   }
116 116
   */
117
-  if($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id'])
117
+  if ($relation['alliance_diplomacy_contr_ally_id'] && $relation['alliance_diplomacy_ally_id'])
118 118
   {
119 119
     $template->assign_block_vars('relation', array(
120 120
       'NAME'     => $relation['alliance_diplomacy_contr_ally_name'],
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
 $template = parsetemplate($template, $lang);
128 128
 
129
-function ali_render(){$func_args = func_get_args();return sn_function_call(__FUNCTION__, $func_args);}
129
+function ali_render() {$func_args = func_get_args(); return sn_function_call(__FUNCTION__, $func_args); }
130 130
 ali_render();
131 131
 
132 132
 display($template, "{$lang['your_alliance']} [{$ally['ally_name']}]");
Please login to merge, or discard this patch.
includes/alliance/ali_internal_members.inc 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
4 4
 {
5 5
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
6 6
 }
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
 */
11 11
 // Changing rank for single user
12 12
 $id_user = sys_get_param_id('id_user');
13
-if(isset($_GET['id_rank']))
13
+if (isset($_GET['id_rank']))
14 14
 {
15 15
   $id_rank = sys_get_param_int('id_rank');
16 16
 }
17
-if($id_user && isset($id_rank) && $user_admin){
17
+if ($id_user && isset($id_rank) && $user_admin) {
18 18
   db_user_set_by_id($id_user, "`ally_rank_id` = {$id_rank}");
19 19
 }
20 20
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 $sort1 = sys_get_param_int('sort1');
45
-if($sort1>5 || $sort1<0) $sort1 = 0;
45
+if ($sort1 > 5 || $sort1 < 0) $sort1 = 0;
46 46
 $sort1s = array(
47 47
   0 => '`ally_rank_id` %1$s;',
48 48
   1 => '`username` %1$s;',
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
   'id, username, galaxy, system, planet, onlinetime, ally_rank_id, ally_register_time, total_points');
59 59
 
60 60
 // while ($userRow = db_fetch($userList))
61
-foreach($userList as $userRow)
61
+foreach ($userList as $userRow)
62 62
 {
63 63
   $i++;
64 64
   if (!isset($ranks[$userRow['ally_rank_id']]))
@@ -68,17 +68,17 @@  discard block
 block discarded – undo
68 68
 
69 69
   if ($ally['ally_owner'] == $userRow['id'])
70 70
   {
71
-    $ally_range = ($ally['ally_owner_range'])?$ally['ally_owner_range']:$lang['Founder'];
71
+    $ally_range = ($ally['ally_owner_range']) ? $ally['ally_owner_range'] : $lang['Founder'];
72 72
   }
73 73
   else
74 74
   {
75
-    if($user_admin)
75
+    if ($user_admin)
76 76
     {
77 77
       $ally_range = '<select onchange="window.location=\'alliance.php?mode=admin&edit=members&id_user=' . $userRow['id'] . '&id_rank=\' + this.value">';
78 78
 
79
-      foreach($ranks as $rankID => $rankArray){
79
+      foreach ($ranks as $rankID => $rankArray) {
80 80
         $ally_range .= '<option value="' . $rankID . '"';
81
-        if($rankID == $userRow['ally_rank_id'])
81
+        if ($rankID == $userRow['ally_rank_id'])
82 82
           $ally_range .= " selected";
83 83
         $ally_range .= '>' . $rankArray['name'];
84 84
         $ally_range .= '</option>';
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
   }
93 93
 
94 94
   $last_active = time() - $userRow["onlinetime"];
95
-  if($user_admin)
95
+  if ($user_admin)
96 96
   {
97
-    if ( $last_active < 60 )
97
+    if ($last_active < 60)
98 98
     {
99 99
       $tmp = "lime>{$lang['On']}";
100 100
     }
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
     }
106 106
     elseif ($last_active < 60 * 60 * 24)
107 107
     {
108
-      $last_active = round( $last_active / (60 * 60));
108
+      $last_active = round($last_active / (60 * 60));
109 109
       $tmp = "green>{$last_active} {$lang['sys_hrs_short']}";
110 110
     }
111 111
     else
112 112
     {
113
-      $last_active = round( $last_active / (60 * 60 * 24));
113
+      $last_active = round($last_active / (60 * 60 * 24));
114 114
       if ($last_active < 7)
115 115
       {
116 116
         $tmp = "yellow";
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
   }
129 129
   else
130 130
   {
131
-    if($user_onlinestatus)
131
+    if ($user_onlinestatus)
132 132
     {
133
-      if ( $last_active < 60 * 5 )
133
+      if ($last_active < 60 * 5)
134 134
       {
135 135
         $tmp = "lime>{$lang['On']}";
136 136
       }
Please login to merge, or discard this patch.
includes/alliance/ali_external_request.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
4 4
 {
5 5
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
6 6
 }
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     header('Location: alliance.php');
21 21
   }
22 22
 
23
-  if($user_request['request_denied'])
23
+  if ($user_request['request_denied'])
24 24
   {
25 25
     $lang['request_text'] = sprintf($lang['ali_req_deny_msg'], $ally['ally_tag'], $user_request['request_text']);
26 26
   }
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
 $ally = doquery("SELECT * FROM {{alliance}} WHERE `id` ='{$id_ally}'", true);
44 44
 
45
-if(!$ally)
45
+if (!$ally)
46 46
 {
47 47
   message($lang['ali_sys_notFound'], $lang['ali_req_title']);
48 48
 }
49 49
 
50
-if($ally['ally_request_notallow'])
50
+if ($ally['ally_request_notallow'])
51 51
 {
52 52
   message($lang['ali_req_not_allowed'], $lang['ali_req_title']);
53 53
 }
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_request.inc 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
3
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
4 4
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
5 5
 }
6 6
 
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
 }
10 10
 
11 11
 $d = sys_get_param_id('d');
12
-if($d) {
12
+if ($d) {
13 13
   doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '{$lang['ali_req_deny_reason']}' WHERE `id_user`= {$d} LIMIT 1;");
14 14
 }
15 15
 
16 16
 $id_user = sys_get_param_id('id_user');
17
-if($id_user) {
17
+if ($id_user) {
18 18
   $ally_name_safe = db_escape($ally['ally_name']);
19 19
   $ally_tag_safe = db_escape($ally['ally_tag']);
20 20
   db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = " . SN_TIME_NOW . ", `ally_rank_id` = 0");
Please login to merge, or discard this patch.