Completed
Push — trunk ( 34029c...0f5c9b )
by SuperNova.WS
03:54
created
includes/pages/chat.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@  discard block
 block discarded – undo
4 4
  *
5 5
  */
6 6
 
7
-function sn_chat_model()
8
-{
7
+function sn_chat_model() {
9 8
   global $config, $user, $template_result, $lang;
10 9
 
11 10
   $config->array_set('users', $user['id'], 'chat_last_activity', SN_TIME_MICRO);
@@ -44,15 +43,13 @@  discard block
 block discarded – undo
44 43
 
45 44
   $template_result['PAGE_HEADER'] = $page_title;
46 45
 }
47
-function sn_chat_view($template = null)
48
-{
46
+function sn_chat_view($template = null) {
49 47
   $template = gettemplate('chat_body', $template);
50 48
 
51 49
   return $template;
52 50
 }
53 51
 
54
-function sn_chat_add_model()
55
-{
52
+function sn_chat_add_model() {
56 53
   global $config, $user;
57 54
 
58 55
   define('IN_AJAX', true);
@@ -76,8 +73,7 @@  discard block
 block discarded – undo
76 73
 
77 74
   die();
78 75
 }
79
-function sn_chat_msg_view($template = null)
80
-{
76
+function sn_chat_msg_view($template = null) {
81 77
   global $config, $user, $lang;
82 78
 
83 79
   define('IN_AJAX', true);
@@ -99,8 +95,7 @@  discard block
 block discarded – undo
99 95
       'TIME' => date(FMT_DATE_TIME, htmlentities(SN_CLIENT_TIME_LOCAL, ENT_QUOTES, 'utf-8')),
100 96
       'DISABLE' => true,
101 97
     );
102
-  }
103
-  else
98
+  } else
104 99
   {
105 100
     $alliance = sys_get_param_str('ally') && $user['ally_id'] ? $user['ally_id'] : 0;
106 101
 
@@ -121,8 +116,7 @@  discard block
 block discarded – undo
121 116
       }
122 117
 
123 118
       $page = min($page_count, max(0, sys_get_param_int('sheet')));
124
-    }
125
-    else
119
+    } else
126 120
     {
127 121
       $last_message = sys_get_param_id('last_message');
128 122
       $where_add = $last_message ? "AND `messageid` > {$last_message}" : '';
@@ -171,8 +165,7 @@  discard block
 block discarded – undo
171 165
   {
172 166
     $pageTitle = "{$lang['chat_history']} - {$lang[$alliance ? 'chat_ally' : 'chat_common']}";
173 167
     display($template, $pageTitle);
174
-  }
175
-  else
168
+  } else
176 169
   {
177 170
     $result['last_message'] = $last_message;
178 171
     $result['html'] = templateRenderToHtml($template);
Please login to merge, or discard this patch.
classes/phpbb_hook.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 /**
23 23
 * phpBB Hook Class
24 24
 */
25
-class phpbb_hook
26
-{
25
+class phpbb_hook {
27 26
 	/**
28 27
 	* Registered hooks
29 28
 	*/
@@ -44,8 +43,7 @@  discard block
 block discarded – undo
44 43
 	*
45 44
 	* @param array $valid_hooks array containing the hookable functions/methods
46 45
 	*/
47
-	function phpbb_hook($valid_hooks)
48
-	{
46
+	function phpbb_hook($valid_hooks) {
49 47
 		foreach ($valid_hooks as $_null => $method)
50 48
 		{
51 49
 			$this->add_hook($method);
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
 	* @param mixed $hook The replacement function/method to be called. Passing function name or array with object/class definition
66 64
 	* @param string $mode Specify the priority/chain mode. 'normal' -> hook gets appended to the chain. 'standalone' -> only the specified hook gets called - later hooks are not able to overwrite this (E_NOTICE is triggered then). 'first' -> hook is called as the first one within the chain. 'last' -> hook is called as the last one within the chain.
67 65
 	*/
68
-	function register($definition, $hook, $mode = 'normal')
69
-	{
66
+	function register($definition, $hook, $mode = 'normal') {
70 67
 		$class = (!is_array($definition)) ? '__global' : $definition[0];
71 68
 		$function = (!is_array($definition)) ? $definition : $definition[1];
72 69
 
@@ -79,8 +76,7 @@  discard block
 block discarded – undo
79 76
 					if (!isset($this->hooks[$class][$function]['standalone']))
80 77
 					{
81 78
 						$this->hooks[$class][$function] = array('standalone' => $hook);
82
-					}
83
-					else
79
+					} else
84 80
 					{
85 81
 						trigger_error('Hook not able to be called standalone, previous hook already standalone.', E_NOTICE);
86 82
 					}
@@ -106,8 +102,7 @@  discard block
 block discarded – undo
106 102
 	* @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
107 103
 	* @return bool False if no hook got executed, true otherwise
108 104
 	*/
109
-	function call_hook($definition)
110
-	{
105
+	function call_hook($definition) {
111 106
 		$class = (!is_array($definition)) ? '__global' : $definition[0];
112 107
 		$function = (!is_array($definition)) ? $definition : $definition[1];
113 108
 
@@ -128,8 +123,7 @@  discard block
 block discarded – undo
128 123
 			if (isset($this->hooks[$class][$function]['standalone']))
129 124
 			{
130 125
 				$this->hook_result[$class][$function] = call_user_func_array($this->hooks[$class][$function]['standalone'], $arguments);
131
-			}
132
-			else
126
+			} else
133 127
 			{
134 128
 				foreach (array('first', 'normal', 'last') as $mode)
135 129
 				{
@@ -159,8 +153,7 @@  discard block
 block discarded – undo
159 153
 	* @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
160 154
 	* @return mixed False if nothing returned if there is no result, else array('result' => ... )
161 155
 	*/
162
-	function previous_hook_result($definition)
163
-	{
156
+	function previous_hook_result($definition) {
164 157
 		$class = (!is_array($definition)) ? '__global' : $definition[0];
165 158
 		$function = (!is_array($definition)) ? $definition : $definition[1];
166 159
 
@@ -178,8 +171,7 @@  discard block
 block discarded – undo
178 171
 	* @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
179 172
 	* @return bool True if results are there, false if not
180 173
 	*/
181
-	function hook_return($definition)
182
-	{
174
+	function hook_return($definition) {
183 175
 		$class = (!is_array($definition)) ? '__global' : $definition[0];
184 176
 		$function = (!is_array($definition)) ? $definition : $definition[1];
185 177
 
@@ -197,8 +189,7 @@  discard block
 block discarded – undo
197 189
 	* @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
198 190
 	* @return mixed The result
199 191
 	*/
200
-	function hook_return_result($definition)
201
-	{
192
+	function hook_return_result($definition) {
202 193
 		$class = (!is_array($definition)) ? '__global' : $definition[0];
203 194
 		$function = (!is_array($definition)) ? $definition : $definition[1];
204 195
 
@@ -217,8 +208,7 @@  discard block
 block discarded – undo
217 208
 	*
218 209
 	* @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
219 210
 	*/
220
-	function add_hook($definition)
221
-	{
211
+	function add_hook($definition) {
222 212
 		if (!is_array($definition))
223 213
 		{
224 214
 			$definition = array('__global', $definition);
@@ -232,8 +222,7 @@  discard block
 block discarded – undo
232 222
 	*
233 223
 	* @param mixed $definition Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
234 224
 	*/
235
-	function remove_hook($definition)
236
-	{
225
+	function remove_hook($definition) {
237 226
 		$class = (!is_array($definition)) ? '__global' : $definition[0];
238 227
 		$function = (!is_array($definition)) ? $definition : $definition[1];
239 228
 
Please login to merge, or discard this patch.
admin/includes/admin_planet_edit.inc.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,8 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 function admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list){return sn_function_call('admin_planet_edit_mode', array(&$template, &$admin_planet_edit_mode_list));}
4
-function sn_admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list)
5
-{
4
+function sn_admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list) {
6 5
   global $lang;
7 6
 
8 7
   $admin_planet_edit_mode_list = array_merge(isset($admin_planet_edit_mode_list) ? $admin_planet_edit_mode_list : array(), array(
@@ -25,8 +24,7 @@  discard block
 block discarded – undo
25 24
  * @param $edit_planet_row
26 25
  * @param $mode
27 26
  */
28
-function sn_admin_planet_edit_template(&$template, $edit_planet_row, $mode)
29
-{
27
+function sn_admin_planet_edit_template(&$template, $edit_planet_row, $mode) {
30 28
   global $lang;
31 29
 
32 30
   $unit_list = sn_get_groups($mode);
@@ -48,15 +46,13 @@  discard block
 block discarded – undo
48 46
 }
49 47
 
50 48
 function admin_planet_edit_query_string($unit_id, $unit_amount, $mode){return sn_function_call('admin_planet_edit_query_string', array($unit_id, $unit_amount, $mode));}
51
-function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode)
52
-{
49
+function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode) {
53 50
   if($unit_amount && in_array($unit_id, sn_get_groups($mode)))
54 51
   {
55 52
     $unit_amount = round($unit_amount);
56 53
     $unit_name = get_unit_param($unit_id, P_NAME);
57 54
     $result = "{$unit_name} = GREATEST(0, {$unit_name} + ({$unit_amount}))";
58
-  }
59
-  else
55
+  } else
60 56
   {
61 57
     $result = '';
62 58
   }
Please login to merge, or discard this patch.
classes/template.php 1 patch
Braces   +29 added lines, -58 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 * Base Template class.
23 23
 * @package phpBB3
24 24
 */
25
-class template
26
-{
25
+class template {
27 26
   /** variable that holds all the data we'll be substituting into
28 27
   * the compiled templates. Takes form:
29 28
   * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value
@@ -82,8 +81,7 @@  discard block
 block discarded – undo
82 81
   * Set template location
83 82
   * @access public
84 83
   */
85
-  function set_template()
86
-  {
84
+  function set_template() {
87 85
     global $user;
88 86
 
89 87
     if (file_exists($this->rootPhysical. 'styles/' . $user->theme['template_path'] . '/template'))
@@ -108,8 +106,7 @@  discard block
 block discarded – undo
108 106
       {
109 107
         $this->inherit_root = $this->rootPhysical . 'styles/' . $user->theme['template_inherit_path'] . '/template';
110 108
       }
111
-    }
112
-    else
109
+    } else
113 110
     {
114 111
       trigger_error('Template path could not be found: styles/' . $user->theme['template_path'] . '/template', E_USER_ERROR);
115 112
     }
@@ -123,8 +120,7 @@  discard block
 block discarded – undo
123 120
   * Set custom template location (able to use directory outside of phpBB)
124 121
   * @access public
125 122
   */
126
-  function set_custom_template($template_path, $template_name, $fallback_template_path = false)
127
-  {
123
+  function set_custom_template($template_path, $template_name, $fallback_template_path = false) {
128 124
     global $user;
129 125
 
130 126
     // Make sure $template_path has no ending slash
@@ -145,8 +141,7 @@  discard block
 block discarded – undo
145 141
 
146 142
       $this->inherit_root = $fallback_template_path;
147 143
       $this->orig_tpl_inherits_id = true;
148
-    }
149
-    else
144
+    } else
150 145
     {
151 146
       $this->orig_tpl_inherits_id = false;
152 147
     }
@@ -165,8 +160,7 @@  discard block
 block discarded – undo
165 160
   * should be a hash of handle => filename pairs.
166 161
   * @access public
167 162
   */
168
-  function set_filenames($filename_array)
169
-  {
163
+  function set_filenames($filename_array) {
170 164
     if (!is_array($filename_array))
171 165
     {
172 166
       return false;
@@ -194,8 +188,7 @@  discard block
 block discarded – undo
194 188
   * Destroy template data set
195 189
   * @access public
196 190
   */
197
-  function destroy()
198
-  {
191
+  function destroy() {
199 192
     $this->_tpldata = array('.' => array(0 => array()));
200 193
     $this->_rootref = &$this->_tpldata['.'][0];
201 194
   }
@@ -204,8 +197,7 @@  discard block
 block discarded – undo
204 197
   * Reset/empty complete block
205 198
   * @access public
206 199
   */
207
-  function destroy_block_vars($blockname)
208
-  {
200
+  function destroy_block_vars($blockname) {
209 201
     if (strpos($blockname, '.') !== false)
210 202
     {
211 203
       // Nested block.
@@ -220,8 +212,7 @@  discard block
 block discarded – undo
220 212
       }
221 213
 
222 214
       unset($str[$blocks[$blockcount]]);
223
-    }
224
-    else
215
+    } else
225 216
     {
226 217
       // Top-level block.
227 218
       unset($this->_tpldata[$blockname]);
@@ -234,8 +225,7 @@  discard block
 block discarded – undo
234 225
   * Display handle
235 226
   * @access public
236 227
   */
237
-  function display($handle, $include_once = true)
238
-  {
228
+  function display($handle, $include_once = true) {
239 229
     /**
240 230
      * @var phpbb_hook $phpbb_hook
241 231
      */
@@ -264,8 +254,7 @@  discard block
 block discarded – undo
264 254
     if ($filename = $this->_tpl_load($handle))
265 255
     {
266 256
       ($include_once) ? include_once($filename) : include($filename);
267
-    }
268
-    else
257
+    } else
269 258
     {
270 259
       $this->evaluate($this->compiled_code[$handle]);
271 260
     }
@@ -277,8 +266,7 @@  discard block
 block discarded – undo
277 266
   * Display the handle and assign the output to a template variable or return the compiled result.
278 267
   * @access public
279 268
   */
280
-  function assign_display($handle, $template_var = '', $return_content = true, $include_once = false)
281
-  {
269
+  function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) {
282 270
     ob_start();
283 271
     $this->display($handle, $include_once);
284 272
     $contents = ob_get_clean();
@@ -297,8 +285,7 @@  discard block
 block discarded – undo
297 285
   * Load a compiled template if possible, if not, recompile it
298 286
   * @access private
299 287
   */
300
-  function _tpl_load(&$handle)
301
-  {
288
+  function _tpl_load(&$handle) {
302 289
     global $user, $config;
303 290
 
304 291
     if (!isset($this->filename[$handle]))
@@ -319,8 +306,7 @@  discard block
 block discarded – undo
319 306
     if (!file_exists($filename) || @filesize($filename) === 0)
320 307
     {
321 308
       $recompile = true;
322
-    }
323
-    else if ($config->load_tplcompile)
309
+    } else if ($config->load_tplcompile)
324 310
     {
325 311
       // No way around it: we need to check inheritance here
326 312
       if ($user->theme['template_inherits_id'] && !file_exists($this->files[$handle]))
@@ -403,15 +389,13 @@  discard block
 block discarded – undo
403 389
               $this->files[$row['template_filename']] = $file;
404 390
               $this->files_inherit[$row['template_filename']] = $file;
405 391
               $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id'];
406
-            }
407
-            else if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
392
+            } else if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
408 393
             {
409 394
               // Ok, we have a situation. There is a file in the subtemplate, but nothing in the DB. We have to fix that.
410 395
               $force_reload = true;
411 396
               $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id'];
412 397
             }
413
-          }
414
-          else
398
+          } else
415 399
           {
416 400
             $this->files_template[$row['template_filename']] = $user->theme['template_id'];
417 401
           }
@@ -421,8 +405,7 @@  discard block
 block discarded – undo
421 405
             if ($row['template_filename'] == $this->filename[$handle])
422 406
             {
423 407
               $compile->_tpl_load_file($handle, true);
424
-            }
425
-            else
408
+            } else
426 409
             {
427 410
               $this->files[$row['template_filename']] = $file;
428 411
               $this->filename[$row['template_filename']] = $row['template_filename'];
@@ -437,8 +420,7 @@  discard block
 block discarded – undo
437 420
           {
438 421
             $this->compiled_code[$handle] = $compile->compile(trim($row['template_data']));
439 422
             $compile->compile_write($handle, $this->compiled_code[$handle]);
440
-          }
441
-          else
423
+          } else
442 424
           {
443 425
             // Only bother compiling if it doesn't already exist
444 426
             if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . DOT_PHP_EX))
@@ -449,8 +431,7 @@  discard block
 block discarded – undo
449 431
             }
450 432
           }
451 433
         }
452
-      }
453
-      else
434
+      } else
454 435
       {
455 436
         $file = $this->root . '/' . $row['template_filename'];
456 437
 
@@ -477,8 +458,7 @@  discard block
 block discarded – undo
477 458
   * Assign key variable pairs from an array
478 459
   * @access public
479 460
   */
480
-  function assign_vars($vararray)
481
-  {
461
+  function assign_vars($vararray) {
482 462
     foreach ($vararray as $key => $val)
483 463
     {
484 464
       $this->_rootref[$key] = $val;
@@ -491,8 +471,7 @@  discard block
 block discarded – undo
491 471
   * Assign a single variable to a single key
492 472
   * @access public
493 473
   */
494
-  function assign_var($varname, $varval)
495
-  {
474
+  function assign_var($varname, $varval) {
496 475
     $this->_rootref[$varname] = $varval;
497 476
 
498 477
     return true;
@@ -502,8 +481,7 @@  discard block
 block discarded – undo
502 481
   * Assign key variable pairs from an array to a specified block
503 482
   * @access public
504 483
   */
505
-  function assign_block_vars($blockname, $vararray)
506
-  {
484
+  function assign_block_vars($blockname, $vararray) {
507 485
     if (strpos($blockname, '.') !== false)
508 486
     {
509 487
       // Nested block.
@@ -538,8 +516,7 @@  discard block
 block discarded – undo
538 516
       // We're adding a new iteration to this block with the given
539 517
       // variable assignments.
540 518
       $str[$blocks[$blockcount]][] = $vararray;
541
-    }
542
-    else
519
+    } else
543 520
     {
544 521
       // Top-level block.
545 522
       $s_row_count = (isset($this->_tpldata[$blockname])) ? sizeof($this->_tpldata[$blockname]) : 0;
@@ -593,8 +570,7 @@  discard block
 block discarded – undo
593 570
   * @return bool false on error, true on success
594 571
   * @access public
595 572
   */
596
-  function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert')
597
-  {
573
+  function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert') {
598 574
     if (strpos($blockname, '.') !== false)
599 575
     {
600 576
       // Nested blocks are not supported
@@ -639,8 +615,7 @@  discard block
 block discarded – undo
639 615
         $key = sizeof($this->_tpldata[$blockname]);
640 616
         unset($this->_tpldata[$blockname][($key - 1)]['S_LAST_ROW']);
641 617
         $vararray['S_LAST_ROW'] = true;
642
-      }
643
-      else if ($key === 0)
618
+      } else if ($key === 0)
644 619
       {
645 620
         unset($this->_tpldata[$blockname][0]['S_FIRST_ROW']);
646 621
         $vararray['S_FIRST_ROW'] = true;
@@ -679,8 +654,7 @@  discard block
 block discarded – undo
679 654
   * Include a separate template
680 655
   * @access private
681 656
   */
682
-  function _tpl_include($filename, $include = true)
683
-  {
657
+  function _tpl_include($filename, $include = true) {
684 658
     // This is used to access global vars
685 659
     global $lang, $config, $user;
686 660
 
@@ -710,8 +684,7 @@  discard block
 block discarded – undo
710 684
   * Include a php-file
711 685
   * @access private
712 686
   */
713
-  function _php_include($filename)
714
-  {
687
+  function _php_include($filename) {
715 688
     $file = $this->rootPhysical . $filename;
716 689
 
717 690
     if (!file_exists($file))
@@ -727,8 +700,7 @@  discard block
 block discarded – undo
727 700
   * Assign key variable pairs from an array with block support
728 701
   * @access public
729 702
   */
730
-  function assign_recursive($values, $name = '')
731
-  {
703
+  function assign_recursive($values, $name = '') {
732 704
     if(isset($values['.']))
733 705
     {
734 706
       $values_extra = $values['.'];
@@ -738,8 +710,7 @@  discard block
 block discarded – undo
738 710
     if(!$name)
739 711
     {
740 712
       $this->assign_vars($values);
741
-    }
742
-    else
713
+    } else
743 714
     {
744 715
       $this->assign_block_vars($name, $values);
745 716
     }
Please login to merge, or discard this patch.
resources.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@
 block discarded – undo
30 30
  * @param $resource_id
31 31
  * @param ResourceCalculations $capsObj
32 32
  */
33
-function int_calc_storage_bar($resource_id, $capsObj)
34
-{
33
+function int_calc_storage_bar($resource_id, $capsObj) {
35 34
   global $lang, $template, $planetrow, $user;
36 35
 
37 36
   $totalProduction      = $capsObj->getProduction($resource_id);
Please login to merge, or discard this patch.
includes/functions/msg_send_simple_message.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
    1.5 - copyright (c) 2010-2011 by Gorlum for http://supernova.ws
16 16
          [+] SuperMassMailing - authlevel=3 player can send messages to whole server ('*' as $owners)
17 17
  */
18
-function msg_ali_send($message, $subject, $ally_rank_id = 0, $ally_id = 0)
19
-{
18
+function msg_ali_send($message, $subject, $ally_rank_id = 0, $ally_id = 0) {
20 19
   global $user;
21 20
 
22 21
   $ally_id = $ally_id ? $ally_id : $user['ally_id'];
@@ -49,8 +48,7 @@  discard block
 block discarded – undo
49 48
  * @param bool $force
50 49
  * @param bool $json
51 50
  */
52
-function msg_send_simple_message($owners, $sender, $timestamp, $message_type, $from, $subject, $text, $escaped = STRING_NEED_ESCAPING, $force = false, $json = false)
53
-{
51
+function msg_send_simple_message($owners, $sender, $timestamp, $message_type, $from, $subject, $text, $escaped = STRING_NEED_ESCAPING, $force = false, $json = false) {
54 52
   global $config, $user, $sn_message_class_list;
55 53
 
56 54
   if(!$owners)
@@ -91,8 +89,7 @@  discard block
 block discarded – undo
91 89
     // TODO Добавить $sender - рассылка может быть и от кого-то
92 90
     db_message_insert_all($message_type, $from, $subject, $text);
93 91
     $owners = [];
94
-  }
95
-  else
92
+  } else
96 93
   {
97 94
     $insert_values = [];
98 95
     $insert_template = "('%u'," . str_replace('%', '%%', " '{$sender}', '{$timestamp}', '{$message_type}', '{$from}', '{$subject}', '{$text}', '" . intval($json) . "')");
@@ -102,8 +99,7 @@  discard block
 block discarded – undo
102 99
       if($user['id'] != $owner)
103 100
       {
104 101
         $owner_row = db_user_by_id($owner);
105
-      }
106
-      else
102
+      } else
107 103
       {
108 104
         $owner_row = $user;
109 105
       }
Please login to merge, or discard this patch.
classes/debug.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,11 +139,13 @@
 block discarded – undo
139 139
       $error_backtrace['locks'] = _SnCacheInternal::$locks;
140 140
       $error_backtrace['cSN_data'] = _SnCacheInternal::$data;
141 141
       foreach($error_backtrace['cSN_data'] as &$location) {
142
-        foreach($location as $location_id => &$location_data) //          $location_data = $location_id;
142
+        foreach($location as $location_id => &$location_data) {
143
+          //          $location_data = $location_id;
143 144
         {
144 145
           $location_data = isset($location_data['username']) ? $location_data['username'] :
145 146
             (isset($location_data['name']) ? $location_data['name'] : $location_id);
146 147
         }
148
+        }
147 149
       }
148 150
     }
149 151
 
Please login to merge, or discard this patch.
buddy.php 1 patch
Braces   +12 added lines, -11 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
             sprintf($lang['buddy_msg_accept_text'], $user['username']));
57 57
           sn_db_transaction_commit();
58 58
           throw new exception('buddy_err_accept_none', ERR_NONE);
59
-        }
60
-        else
59
+        } else
61 60
         {
62 61
           throw new exception('buddy_err_accept_internal', ERR_ERROR);
63 62
         }
@@ -69,9 +68,11 @@  discard block
 block discarded – undo
69 68
           throw new exception('buddy_err_delete_alien', ERR_ERROR);
70 69
         }
71 70
 
72
-        if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) // Existing friendship
71
+        if($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_ACTIVE) {
72
+          // Existing friendship
73 73
         {
74 74
           $ex_friend_id = $buddy_row['BUDDY_SENDER_ID'] == $user['id'] ? $buddy_row['BUDDY_OWNER_ID'] : $buddy_row['BUDDY_SENDER_ID'];
75
+        }
75 76
 
76 77
           msg_send_simple_message($ex_friend_id, $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], $lang['buddy_msg_unfriend_title'],
77 78
             sprintf($lang['buddy_msg_unfriend_text'], $user['username']));
@@ -79,17 +80,19 @@  discard block
 block discarded – undo
79 80
           doquery("DELETE FROM {{buddy}} WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
80 81
           sn_db_transaction_commit();
81 82
           throw new exception('buddy_err_unfriend_none', ERR_NONE);
82
-        }
83
-        elseif($buddy_row['BUDDY_SENDER_ID'] == $user['id']) // Player's outcoming request - either denied or waiting
83
+        } elseif($buddy_row['BUDDY_SENDER_ID'] == $user['id']) {
84
+          // Player's outcoming request - either denied or waiting
84 85
         {
85 86
           doquery("DELETE FROM {{buddy}} WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
87
+        }
86 88
           sn_db_transaction_commit();
87 89
           throw new exception('buddy_err_delete_own', ERR_NONE);
88
-        }
89
-        elseif($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) // Deny incoming request
90
+        } elseif($buddy_row['BUDDY_STATUS'] == BUDDY_REQUEST_WAITING) {
91
+          // Deny incoming request
90 92
         {
91 93
           msg_send_simple_message($buddy_row['BUDDY_SENDER_ID'], $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, $user['username'], $lang['buddy_msg_deny_title'],
92 94
             sprintf($lang['buddy_msg_deny_text'], $user['username']));
95
+        }
93 96
 
94 97
           doquery("UPDATE {{buddy}} SET `BUDDY_STATUS` = " . BUDDY_REQUEST_DENIED . " WHERE `BUDDY_ID` = {$buddy_id} LIMIT 1;");
95 98
           sn_db_transaction_commit();
@@ -104,8 +107,7 @@  discard block
 block discarded – undo
104 107
   if($new_friend_id = sys_get_param_id('request_user_id'))
105 108
   {
106 109
     $new_friend_row = db_user_by_id($new_friend_id, true, '`id`, `username`');
107
-  }
108
-  elseif($new_friend_name = sys_get_param_str_unsafe('request_user_name'))
110
+  } elseif($new_friend_name = sys_get_param_str_unsafe('request_user_name'))
109 111
   {
110 112
     $new_friend_row = db_user_by_username($new_friend_name);
111 113
     $new_friend_name = db_escape($new_friend_name);
@@ -138,8 +140,7 @@  discard block
 block discarded – undo
138 140
     sn_db_transaction_commit();
139 141
     throw new exception('buddy_err_adding_none', ERR_NONE);
140 142
   }
141
-}
142
-catch(exception $e)
143
+} catch(exception $e)
143 144
 {
144 145
   $result[] = array(
145 146
     'STATUS'  => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR,
Please login to merge, or discard this patch.
includes/db/db_queries.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
 require_once('db_queries_fleet.php');
7 7
 
8 8
 
9
-function db_planet_list_admin_list($table_parent_columns, $planet_active, $active_time, $planet_type)
10
-{
9
+function db_planet_list_admin_list($table_parent_columns, $planet_active, $active_time, $planet_type) {
11 10
   return doquery(
12 11
     "SELECT p.*, u.username" . ($table_parent_columns ? ', p1.name AS parent_name' : '') .
13 12
     " FROM {{planets}} AS p
@@ -16,8 +15,7 @@  discard block
 block discarded – undo
16 15
     " WHERE " . ($planet_active ? "p.last_update >= {$active_time}" : "p.planet_type = {$planet_type}"));
17 16
 }
18 17
 
19
-function db_planet_list_search($searchtext)
20
-{
18
+function db_planet_list_search($searchtext) {
21 19
   return doquery(
22 20
     "SELECT
23 21
       p.galaxy, p.system, p.planet, p.planet_type, p.name as planet_name,
@@ -37,8 +35,7 @@  discard block
 block discarded – undo
37 35
 
38 36
 
39 37
 
40
-function db_user_list_search($searchtext)
41
-{
38
+function db_user_list_search($searchtext) {
42 39
   return doquery(
43 40
     "SELECT
44 41
       pn.player_name, u.id as uid, u.username, u.ally_id, u.id_planet, u.total_points, u.total_rank,
@@ -56,8 +53,7 @@  discard block
 block discarded – undo
56 53
   );
57 54
 }
58 55
 
59
-function db_buddy_list_by_user($user_id)
60
-{
56
+function db_buddy_list_by_user($user_id) {
61 57
 //  return ($user_id = intval($user_id)) ? doquery(
62 58
   return ($user_id = idval($user_id)) ? doquery(
63 59
     "SELECT
@@ -87,8 +83,7 @@  discard block
 block discarded – undo
87 83
 
88 84
 
89 85
 
90
-function db_unit_records_sum($unit_id, $user_skip_list_unit)
91
-{
86
+function db_unit_records_sum($unit_id, $user_skip_list_unit) {
92 87
   return doquery (
93 88
     "SELECT unit_player_id, username, sum(unit_level) as unit_level
94 89
           FROM {{unit}} JOIN {{users}} AS u ON u.id = unit_player_id
@@ -99,8 +94,7 @@  discard block
 block discarded – undo
99 94
     , true);
100 95
 }
101 96
 
102
-function db_unit_records_plain($unit_id, $user_skip_list_unit)
103
-{
97
+function db_unit_records_plain($unit_id, $user_skip_list_unit) {
104 98
   return doquery (
105 99
     "SELECT unit_player_id, username, unit_level
106 100
           FROM {{unit}} JOIN {{users}} AS u ON u.id = unit_player_id
@@ -184,15 +178,13 @@  discard block
 block discarded – undo
184 178
 }
185 179
 
186 180
 
187
-function db_stat_list_delete_ally_player()
188
-{
181
+function db_stat_list_delete_ally_player() {
189 182
   return doquery('DELETE s FROM `{{statpoints}}` AS s JOIN `{{users}}` AS u ON u.id = s.id_owner WHERE s.id_ally IS NULL AND u.user_as_ally IS NOT NULL');
190 183
 }
191 184
 
192 185
 
193 186
 
194
-function db_chat_player_list_online($chat_refresh_rate, $ally_add)
195
-{
187
+function db_chat_player_list_online($chat_refresh_rate, $ally_add) {
196 188
   $sql_date = SN_TIME_NOW - $chat_refresh_rate * 2;
197 189
 
198 190
   return doquery(
@@ -206,13 +198,11 @@  discard block
 block discarded – undo
206 198
     ORDER BY authlevel DESC, `username`");
207 199
 }
208 200
 
209
-function db_referrals_list_by_id($user_id)
210
-{
201
+function db_referrals_list_by_id($user_id) {
211 202
   return doquery("SELECT r.*, u.username, u.register_time FROM {{referrals}} AS r LEFT JOIN {{users}} AS u ON u.id = r.id WHERE id_partner = {$user_id}");
212 203
 }
213 204
 
214
-function db_message_list_admin_by_type($int_type_selected, $StartRec)
215
-{
205
+function db_message_list_admin_by_type($int_type_selected, $StartRec) {
216 206
   return doquery("SELECT
217 207
   message_id as `ID`,
218 208
   message_from as `FROM`,
@@ -231,8 +221,7 @@  discard block
 block discarded – undo
231 221
 }
232 222
 
233 223
 
234
-function db_message_insert_all($message_type, $from, $subject, $text)
235
-{
224
+function db_message_insert_all($message_type, $from, $subject, $text) {
236 225
   return doquery($QryInsertMessage = 'INSERT INTO {{messages}} (`message_owner`, `message_sender`, `message_time`, `message_type`, `message_from`, `message_subject`, `message_text`) ' .
237 226
     "SELECT `id`, 0, unix_timestamp(now()), {$message_type}, '{$from}', '{$subject}', '{$text}' FROM {{users}}");
238 227
 }
Please login to merge, or discard this patch.