Completed
Push — work-fleets ( d58328...7b3f52 )
by SuperNova.WS
05:45
created
includes/functions/sys_bbcode.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -103,23 +103,23 @@
 block discarded – undo
103 103
 
104 104
   !empty(classSupernova::$config->url_faq) ? $msg = str_replace('faq://', classSupernova::$config->url_faq, $msg) : false;
105 105
 
106
-  foreach(classSupernova::$design['bbcodes'] as $auth_level => $replaces) {
107
-    if($auth_level > $author_auth) {
106
+  foreach (classSupernova::$design['bbcodes'] as $auth_level => $replaces) {
107
+    if ($auth_level > $author_auth) {
108 108
       continue;
109 109
     }
110 110
 
111
-    foreach($replaces as $key => $html) {
111
+    foreach ($replaces as $key => $html) {
112 112
       $msg = preg_replace(''.$key.'', $html, $msg);
113 113
     }
114 114
   }
115 115
 
116
-  foreach(classSupernova::$design['smiles'] as $auth_level => $replaces) {
117
-    if($auth_level > $author_auth) {
116
+  foreach (classSupernova::$design['smiles'] as $auth_level => $replaces) {
117
+    if ($auth_level > $author_auth) {
118 118
       continue;
119 119
     }
120 120
 
121
-    foreach($replaces as $key => $imgName) {
122
-      $msg = preg_replace("#" . addcslashes($key, '()[]{}') . "#isU","<img src=\"design/images/smileys/".$imgName.".gif\" align=\"absmiddle\" title=\"".$key."\" alt=\"".$key."\">",$msg);
121
+    foreach ($replaces as $key => $imgName) {
122
+      $msg = preg_replace("#".addcslashes($key, '()[]{}')."#isU", "<img src=\"design/images/smileys/".$imgName.".gif\" align=\"absmiddle\" title=\"".$key."\" alt=\"".$key."\">", $msg);
123 123
     }
124 124
   }
125 125
 
Please login to merge, or discard this patch.
includes/pages/chat.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
   $user_auth_level = isset($user['authlevel']) ? $user['authlevel'] : AUTH_LEVEL_ANONYMOUS;
37 37
 
38 38
   $mode = sys_get_param_int('mode');
39
-  switch($mode) {
39
+  switch ($mode) {
40 40
     case CHAT_MODE_ALLY:
41 41
       $template_result['ALLY'] = intval($user['ally_id']);
42 42
       $page_title = classLocale::$lang['chat_ally'];
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
   }
50 50
 
51 51
   $template_result['.']['smiles'] = array();
52
-  foreach(classSupernova::$design['smiles'] as $auth_level => $replaces) {
53
-    if($auth_level > $user_auth_level) {
52
+  foreach (classSupernova::$design['smiles'] as $auth_level => $replaces) {
53
+    if ($auth_level > $user_auth_level) {
54 54
       continue;
55 55
     }
56 56
 
57
-    foreach($replaces as $bbcode => $filename) {
57
+    foreach ($replaces as $bbcode => $filename) {
58 58
       $template_result['.']['smiles'][] = array(
59 59
         'BBCODE'   => $bbcode,
60 60
         'FILENAME' => $filename,
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
   define('IN_AJAX', true);
78 78
   $skip_fleet_update = true;
79 79
 
80
-  if(classSupernova::$config->_MODE != CACHER_NO_CACHE && classSupernova::$config->chat_timeout && SN_TIME_MICRO - classSupernova::$config->array_get('users', $user['id'], 'chat_last_activity') > classSupernova::$config->chat_timeout) {
80
+  if (classSupernova::$config->_MODE != CACHER_NO_CACHE && classSupernova::$config->chat_timeout && SN_TIME_MICRO - classSupernova::$config->array_get('users', $user['id'], 'chat_last_activity') > classSupernova::$config->chat_timeout) {
81 81
     die();
82 82
   }
83 83
 
84
-  if(($message = sys_get_param_str('message')) && $user['username']) {
84
+  if (($message = sys_get_param_str('message')) && $user['username']) {
85 85
     $ally_id = sys_get_param('ally') && $user['ally_id'] ? $user['ally_id'] : 0;
86 86
     $nick = db_escape(player_nick_compact(player_nick_render_current_to_array($user, array('color' => true, 'icons' => true, 'ally' => !$ally_id))));
87 87
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
   $skip_fleet_update = true;
104 104
 
105 105
   $history = sys_get_param_str('history');
106
-  if(!$history) {
106
+  if (!$history) {
107 107
     classSupernova::$config->array_set('users', $user['id'], 'chat_last_refresh', SN_TIME_MICRO);
108 108
   }
109 109
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
   $last_message = '';
112 112
   $alliance = 0;
113 113
   $template_result['.']['chat'] = array();
114
-  if(!$history && classSupernova::$config->_MODE != CACHER_NO_CACHE && classSupernova::$config->chat_timeout && SN_TIME_MICRO - classSupernova::$config->array_get('users', $user['id'], 'chat_last_activity') > classSupernova::$config->chat_timeout) {
114
+  if (!$history && classSupernova::$config->_MODE != CACHER_NO_CACHE && classSupernova::$config->chat_timeout && SN_TIME_MICRO - classSupernova::$config->array_get('users', $user['id'], 'chat_last_activity') > classSupernova::$config->chat_timeout) {
115 115
     $result['disable'] = true;
116 116
     $template_result['.']['chat'][] = array(
117 117
       'TIME'    => date(FMT_DATE_TIME, htmlentities(SN_CLIENT_TIME_LOCAL, ENT_QUOTES, 'utf-8')),
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 
125 125
     $where_add = '';
126 126
     $last_message = 0;
127
-    if($history) {
127
+    if ($history) {
128 128
       $rows = DBStaticChat::db_chat_message_count_by_ally($alliance);
129 129
       $page_count = ceil($rows['CNT'] / $page_limit);
130 130
 
131
-      for($i = 0; $i < $page_count; $i++) {
131
+      for ($i = 0; $i < $page_count; $i++) {
132 132
         $template_result['.']['page'][] = array(
133 133
           'NUMBER' => $i
134 134
         );
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 
143 143
     $start_row = $page * $page_limit;
144 144
     $query = DBStaticChat::db_chat_message_get_page($alliance, $where_add, $start_row, $page_limit);
145
-    while($chat_row = db_fetch($query)) {
145
+    while ($chat_row = db_fetch($query)) {
146 146
       // Little magik here - to retain HTML codes from DB and stripping HTML codes from nick
147 147
       $chat_row['user'] = player_nick_render_to_html($chat_row['user']);
148 148
       $nick_stripped = htmlentities(strip_tags($chat_row['user']), ENT_QUOTES, 'utf-8');
149 149
       $nick = str_replace(strip_tags($chat_row['user']), $nick_stripped, $chat_row['user']);
150
-      if(!$history) {
150
+      if (!$history) {
151 151
         $nick = "<span style=\"cursor: pointer;\" onclick=\"addSmiley('({$nick_stripped})');\">{$nick}</span>";
152 152
       }
153 153
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
   $template = gettemplate('chat_messages', $template);
173 173
   $template->assign_recursive($template_result);
174 174
 
175
-  if($history) {
175
+  if ($history) {
176 176
     display($template, "{$classLocale['chat_history']} - {$classLocale[$alliance ? 'chat_ally' : 'chat_common']}", true, '', false, true);
177 177
   } else {
178 178
     $result['last_message'] = $last_message;
Please login to merge, or discard this patch.