@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | } else { |
38 | 38 | // TODO: This is left for backward compatibility. Appropriate code should be rewrote! |
39 | - $func_name = isset(classSupernova::$functions[$func_name]) && is_callable(classSupernova::$functions[$func_name]) ? classSupernova::$functions[$func_name] : ('sn_' . $func_name); |
|
39 | + $func_name = isset(classSupernova::$functions[$func_name]) && is_callable(classSupernova::$functions[$func_name]) ? classSupernova::$functions[$func_name] : ('sn_'.$func_name); |
|
40 | 40 | if (is_callable($func_name)) { |
41 | 41 | $result = call_user_func_array($func_name, $func_arg); |
42 | 42 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | function get_exchange_rate($currency_symbol) { |
113 | 113 | $currency_symbol = strtolower($currency_symbol); |
114 | - $config_field = 'payment_currency_exchange_' . $currency_symbol; |
|
114 | + $config_field = 'payment_currency_exchange_'.$currency_symbol; |
|
115 | 115 | |
116 | 116 | // Заворачиваем получение стоимости ММ через перекрываемую процедуру |
117 | 117 | $exchange_rate = floatval($currency_symbol == 'mm_' ? get_mm_cost() : classSupernova::$config->$config_field); |
@@ -623,8 +623,8 @@ discard block |
||
623 | 623 | $from = trim($from ? $from : classSupernova::$config->game_adminEmail); |
624 | 624 | |
625 | 625 | $head = ''; |
626 | - $head .= "Content-Type: text/" . ($html ? 'html' : 'plain') . "; charset=utf-8 \r\n"; |
|
627 | - $head .= "Date: " . date('r') . " \r\n"; |
|
626 | + $head .= "Content-Type: text/".($html ? 'html' : 'plain')."; charset=utf-8 \r\n"; |
|
627 | + $head .= "Date: ".date('r')." \r\n"; |
|
628 | 628 | $classConfig = classSupernova::$config; |
629 | 629 | $head .= "Return-Path: {$classConfig->game_adminEmail} \r\n"; |
630 | 630 | $head .= "From: {$from} \r\n"; |
@@ -637,10 +637,10 @@ discard block |
||
637 | 637 | $body = str_replace("\n", "\r\n", $body); |
638 | 638 | |
639 | 639 | if ($html) { |
640 | - $body = '<html><head><base href="' . SN_ROOT_VIRTUAL . '"></head><body>' . nl2br($body) . '</body></html>'; |
|
640 | + $body = '<html><head><base href="'.SN_ROOT_VIRTUAL.'"></head><body>'.nl2br($body).'</body></html>'; |
|
641 | 641 | } |
642 | 642 | |
643 | - $title = '=?UTF-8?B?' . base64_encode($title) . '?='; |
|
643 | + $title = '=?UTF-8?B?'.base64_encode($title).'?='; |
|
644 | 644 | |
645 | 645 | return @mail($email_unsafe, $title, $body, $head); |
646 | 646 | } |
@@ -656,14 +656,14 @@ discard block |
||
656 | 656 | $classLocale = classLocale::$lang; |
657 | 657 | |
658 | 658 | return |
659 | - ($full || $time ? "{$time} {$classLocale['sys_day']} " : '') . |
|
660 | - ($full || $hours ? "{$hours} {$classLocale['sys_hrs']} " : '') . |
|
661 | - ($full || $minutes ? "{$minutes} {$classLocale['sys_min']} " : '') . |
|
659 | + ($full || $time ? "{$time} {$classLocale['sys_day']} " : ''). |
|
660 | + ($full || $hours ? "{$hours} {$classLocale['sys_hrs']} " : ''). |
|
661 | + ($full || $minutes ? "{$minutes} {$classLocale['sys_min']} " : ''). |
|
662 | 662 | ($full || !$time || $seconds ? "{$seconds} {$classLocale['sys_sec']}" : ''); |
663 | 663 | } |
664 | 664 | |
665 | 665 | function sys_time_human_system($time) { |
666 | - return $time ? date(FMT_DATE_TIME_SQL, $time) . " ({$time}), " . sys_time_human(SN_TIME_NOW - $time) : '{NEVER}'; |
|
666 | + return $time ? date(FMT_DATE_TIME_SQL, $time)." ({$time}), ".sys_time_human(SN_TIME_NOW - $time) : '{NEVER}'; |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | function sys_redirect($url) { |
@@ -756,13 +756,13 @@ discard block |
||
756 | 756 | // usw.. |
757 | 757 | ); |
758 | 758 | |
759 | - $rexep = "#" . strtr(preg_quote($format), $masks) . "#"; |
|
759 | + $rexep = "#".strtr(preg_quote($format), $masks)."#"; |
|
760 | 760 | if (preg_match($rexep, $date, $out)) { |
761 | 761 | $ret = array( |
762 | - "tm_sec" => (int)$out['S'], |
|
763 | - "tm_min" => (int)$out['M'], |
|
764 | - "tm_hour" => (int)$out['H'], |
|
765 | - "tm_mday" => (int)$out['d'], |
|
762 | + "tm_sec" => (int) $out['S'], |
|
763 | + "tm_min" => (int) $out['M'], |
|
764 | + "tm_hour" => (int) $out['H'], |
|
765 | + "tm_mday" => (int) $out['d'], |
|
766 | 766 | "tm_mon" => $out['m'] ? $out['m'] - 1 : 0, |
767 | 767 | "tm_year" => $out['Y'] > 1900 ? $out['Y'] - 1900 : 0, |
768 | 768 | ); |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | $functions[$function_name] = array(); |
833 | 833 | } elseif (!isset($functions[$function_name])) { |
834 | 834 | $functions[$function_name] = array(); |
835 | - $sn_function_name = 'sn_' . $function_name . ($sub_type ? '_' . $sub_type : ''); |
|
835 | + $sn_function_name = 'sn_'.$function_name.($sub_type ? '_'.$sub_type : ''); |
|
836 | 836 | $functions[$function_name][] = $sn_function_name; |
837 | 837 | } |
838 | 838 | |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | } |
900 | 900 | |
901 | 901 | if (isset($nick_array[NICK_GENDER])) { |
902 | - $result[NICK_GENDER] = '<img src="' . ($user['dpath'] ? $user['dpath'] : DEFAULT_SKINPATH) . 'images/gender_' . $nick_array[NICK_GENDER] . '.png" />'; |
|
902 | + $result[NICK_GENDER] = '<img src="'.($user['dpath'] ? $user['dpath'] : DEFAULT_SKINPATH).'images/gender_'.$nick_array[NICK_GENDER].'.png" />'; |
|
903 | 903 | } |
904 | 904 | |
905 | 905 | if (isset($nick_array[NICK_AUTH_LEVEL]) || isset($nick_array[NICK_PREMIUM])) { |
@@ -931,14 +931,14 @@ discard block |
||
931 | 931 | } |
932 | 932 | |
933 | 933 | if (isset($nick_array[NICK_CLASS])) { |
934 | - $result[NICK_CLASS] = '<span ' . $nick_array[NICK_CLASS] . '>'; |
|
934 | + $result[NICK_CLASS] = '<span '.$nick_array[NICK_CLASS].'>'; |
|
935 | 935 | $result[NICK_CLASS_END] = '</span>'; |
936 | 936 | } |
937 | 937 | |
938 | 938 | $result[NICK_NICK] = sys_safe_output($nick_array[NICK_NICK]); |
939 | 939 | |
940 | 940 | if (isset($nick_array[NICK_ALLY])) { |
941 | - $result[NICK_ALLY] = '[' . sys_safe_output($nick_array[NICK_ALLY]) . ']'; |
|
941 | + $result[NICK_ALLY] = '['.sys_safe_output($nick_array[NICK_ALLY]).']'; |
|
942 | 942 | } |
943 | 943 | |
944 | 944 | $result[NICK_HTML] = true; |
@@ -961,7 +961,7 @@ discard block |
||
961 | 961 | */ |
962 | 962 | |
963 | 963 | |
964 | - if ($render_user['user_birthday'] && ($options === true || isset($options['icons']) || isset($options['birthday'])) && (date('Y', SN_TIME_NOW) . date('-m-d', strtotime($render_user['user_birthday'])) == date('Y-m-d', SN_TIME_NOW))) { |
|
964 | + if ($render_user['user_birthday'] && ($options === true || isset($options['icons']) || isset($options['birthday'])) && (date('Y', SN_TIME_NOW).date('-m-d', strtotime($render_user['user_birthday'])) == date('Y-m-d', SN_TIME_NOW))) { |
|
965 | 965 | $result[NICK_BIRTHSDAY] = ''; |
966 | 966 | } |
967 | 967 | |
@@ -983,7 +983,7 @@ discard block |
||
983 | 983 | } |
984 | 984 | |
985 | 985 | if ((isset($options['class']) && $options['class'])) { |
986 | - $result[NICK_CLASS] = (isset($result_options[NICK_CLASS]) ? ' ' . $result_options[NICK_CLASS] : '') . $options['class']; |
|
986 | + $result[NICK_CLASS] = (isset($result_options[NICK_CLASS]) ? ' '.$result_options[NICK_CLASS] : '').$options['class']; |
|
987 | 987 | } |
988 | 988 | |
989 | 989 | if ($render_user['ally_tag'] && ($options === true || (isset($options['ally']) && $options['ally']))) { |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | foreach ($temp as $user_id) { |
1012 | 1012 | $user_id = floatval($user_id); |
1013 | 1013 | if ($user_id) { |
1014 | - $user_skip_list[] = '`id` = ' . $user_id; |
|
1014 | + $user_skip_list[] = '`id` = '.$user_id; |
|
1015 | 1015 | } |
1016 | 1016 | } |
1017 | 1017 | } |
@@ -1410,7 +1410,7 @@ discard block |
||
1410 | 1410 | $time_left = min(floor($time_left / PERIOD_DAY), $term_original); |
1411 | 1411 | $cost_left = $term_original > 0 ? ceil($time_left / $term_original * $original_cost) : 0; |
1412 | 1412 | |
1413 | - array_walk_recursive($result, function (&$value) use ($cost_left) { |
|
1413 | + array_walk_recursive($result, function(&$value) use ($cost_left) { |
|
1414 | 1414 | $value -= $cost_left; |
1415 | 1415 | }); |
1416 | 1416 | } |
@@ -1465,7 +1465,7 @@ discard block |
||
1465 | 1465 | } |
1466 | 1466 | |
1467 | 1467 | function print_rr($var, $capture = false) { |
1468 | - $print = '<pre>' . htmlspecialchars(print_r($var, true)) . '</pre>'; |
|
1468 | + $print = '<pre>'.htmlspecialchars(print_r($var, true)).'</pre>'; |
|
1469 | 1469 | if ($capture) { |
1470 | 1470 | return $print; |
1471 | 1471 | } else { |
@@ -1567,7 +1567,7 @@ discard block |
||
1567 | 1567 | break; |
1568 | 1568 | } |
1569 | 1569 | $sort_option_inverse_closure = $sort_option_inverse ? -1 : 1; |
1570 | - usort($ListToSort, function ($a, $b) use ($sort_option_field, $sort_option_inverse_closure) { |
|
1570 | + usort($ListToSort, function($a, $b) use ($sort_option_field, $sort_option_inverse_closure) { |
|
1571 | 1571 | return $a[$sort_option_field] < $b[$sort_option_field] ? -1 * $sort_option_inverse_closure : ( |
1572 | 1572 | $a[$sort_option_field] > $b[$sort_option_field] ? 1 * $sort_option_inverse_closure : 0 |
1573 | 1573 | ); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | require_once('general_pname.php'); |
12 | 12 | |
13 | 13 | /** |
14 | - * @param $func_name |
|
14 | + * @param string $func_name |
|
15 | 15 | * @param array $func_arg |
16 | 16 | * |
17 | 17 | * @return mixed |
@@ -62,6 +62,9 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // ---------------------------------------------------------------------------------------------------------------- |
65 | +/** |
|
66 | + * @param string $filename |
|
67 | + */ |
|
65 | 68 | function sys_file_read($filename) { |
66 | 69 | return @file_get_contents($filename); |
67 | 70 | } |
@@ -104,7 +107,7 @@ discard block |
||
104 | 107 | /** |
105 | 108 | * Получение курса обмены валюты в серверную валюту |
106 | 109 | * |
107 | - * @param $currency_symbol |
|
110 | + * @param string $currency_symbol |
|
108 | 111 | * |
109 | 112 | * @return float |
110 | 113 | */ |
@@ -130,7 +133,7 @@ discard block |
||
130 | 133 | * - true - colors number to green if positive or zero; red if negative |
131 | 134 | * - 0 |
132 | 135 | * - numeric - colors number to green if less then $color; red if greater |
133 | - * @param int|bool $limit - generally converts "15000" to "15k", "2000000" to "2kk" etc |
|
136 | + * @param boolean $limit - generally converts "15000" to "15k", "2000000" to "2kk" etc |
|
134 | 137 | * - 0/false - proceed with $floor |
135 | 138 | * - numeric - divides number to segments by power of $limit and adds 'k' for each segment |
136 | 139 | * - makes sense for 1000, but works with any number |
@@ -229,6 +232,9 @@ discard block |
||
229 | 232 | return preg_replace($ListCensure, '*', $String); |
230 | 233 | } |
231 | 234 | |
235 | +/** |
|
236 | + * @param string $email |
|
237 | + */ |
|
232 | 238 | function is_email($email) { |
233 | 239 | return (preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i", $email)); |
234 | 240 | } |
@@ -266,6 +272,9 @@ discard block |
||
266 | 272 | return floatval(sys_get_param($param_name, $default)); |
267 | 273 | } |
268 | 274 | |
275 | +/** |
|
276 | + * @param string $param_name |
|
277 | + */ |
|
269 | 278 | function sys_get_param_escaped($param_name, $default = '') { |
270 | 279 | return db_escape(sys_get_param($param_name, $default)); |
271 | 280 | } |
@@ -434,6 +443,9 @@ discard block |
||
434 | 443 | } |
435 | 444 | |
436 | 445 | // Generates random string of $length symbols from $allowed_chars charset |
446 | +/** |
|
447 | + * @param string $allowed_chars |
|
448 | + */ |
|
437 | 449 | function sys_random_string($length = 16, $allowed_chars = SN_SYS_SEC_CHARS_ALLOWED) { |
438 | 450 | $allowed_length = strlen($allowed_chars); |
439 | 451 | |
@@ -538,6 +550,10 @@ discard block |
||
538 | 550 | return implode(';', $fleet_string); |
539 | 551 | } |
540 | 552 | |
553 | +/** |
|
554 | + * @param string $title |
|
555 | + * @param string $body |
|
556 | + */ |
|
541 | 557 | function mymail($email_unsafe, $title, $body, $from = '', $html = false) { |
542 | 558 | $from = trim($from ? $from : classSupernova::$config->game_adminEmail); |
543 | 559 | |
@@ -803,6 +819,9 @@ discard block |
||
803 | 819 | return serialize($nick_array); |
804 | 820 | } |
805 | 821 | |
822 | +/** |
|
823 | + * @param string $nick_string |
|
824 | + */ |
|
806 | 825 | function player_nick_uncompact($nick_string) { |
807 | 826 | try { |
808 | 827 | $result = unserialize($nick_string); |
@@ -990,6 +1009,9 @@ discard block |
||
990 | 1009 | return $result; |
991 | 1010 | } |
992 | 1011 | |
1012 | +/** |
|
1013 | + * @param string $groups |
|
1014 | + */ |
|
993 | 1015 | function isInGroup($groups, $unitId) { |
994 | 1016 | $group = sn_get_groups($groups); |
995 | 1017 | |
@@ -1058,6 +1080,9 @@ discard block |
||
1058 | 1080 | return $ranks; |
1059 | 1081 | } |
1060 | 1082 | |
1083 | +/** |
|
1084 | + * @param boolean $planet_id |
|
1085 | + */ |
|
1061 | 1086 | function sys_player_new_adjust($user_id, $planet_id) { return sn_function_call(__FUNCTION__, array($user_id, $planet_id, &$result)); } |
1062 | 1087 | |
1063 | 1088 | function sn_sys_player_new_adjust($user_id, $planet_id, &$result) { |
@@ -1216,6 +1241,9 @@ discard block |
||
1216 | 1241 | return $rates; |
1217 | 1242 | } |
1218 | 1243 | |
1244 | +/** |
|
1245 | + * @param integer $in_resource |
|
1246 | + */ |
|
1219 | 1247 | function get_unit_cost_in(&$cost, $in_resource = RES_METAL) { |
1220 | 1248 | static $rates; |
1221 | 1249 | |
@@ -1382,6 +1410,9 @@ discard block |
||
1382 | 1410 | return version_compare(sn_version_compare_extra($ver1), sn_version_compare_extra($ver2)); |
1383 | 1411 | } |
1384 | 1412 | |
1413 | +/** |
|
1414 | + * @param string $name |
|
1415 | + */ |
|
1385 | 1416 | function sn_setcookie($name, $value = null, $expire = null, $path = SN_ROOT_RELATIVE, $domain = null, $secure = null, $httponly = null) { |
1386 | 1417 | $_COOKIE[$name] = $value; |
1387 | 1418 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -13,10 +13,10 @@ |
||
13 | 13 | define('INSTALL', false); |
14 | 14 | define('IN_ADMIN', true); |
15 | 15 | |
16 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
16 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
17 | 17 | |
18 | 18 | if (!sn_module_get_active_count('payment')) { |
19 | - sys_redirect(SN_ROOT_VIRTUAL . 'admin/overview.php'); |
|
19 | + sys_redirect(SN_ROOT_VIRTUAL.'admin/overview.php'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | if ($user['authlevel'] < 3) { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | $img_name = classSupernova::$config->int_userbar_background; |
25 | 25 | break; |
26 | 26 | } |
27 | - $size = getimagesize(SN_ROOT_PHYSICAL . $img_name); |
|
28 | - $im = imagecreatefrompng(SN_ROOT_PHYSICAL . $img_name); |
|
27 | + $size = getimagesize(SN_ROOT_PHYSICAL.$img_name); |
|
28 | + $im = imagecreatefrompng(SN_ROOT_PHYSICAL.$img_name); |
|
29 | 29 | $image = imagecreatetruecolor($size[0], $size[1]); |
30 | 30 | imagecopy($image, $im, 0, 0, 0, 0, $size[0], $size[1]); |
31 | 31 | imagedestroy($im); |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | $txt_color2 = imagecolorallocatealpha($image, 255, 255, 255, 40); |
38 | 38 | |
39 | 39 | $fonts = array( |
40 | - 'userbar' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_userbar_font, |
|
41 | - 'universe' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_banner_fontUniverse, |
|
42 | - 'raids' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_banner_fontRaids, |
|
43 | - 'info' => SN_ROOT_PHYSICAL . "design/fonts/" . classSupernova::$config->int_banner_fontInfo, |
|
40 | + 'userbar' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_userbar_font, |
|
41 | + 'universe' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_banner_fontUniverse, |
|
42 | + 'raids' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_banner_fontRaids, |
|
43 | + 'info' => SN_ROOT_PHYSICAL."design/fonts/".classSupernova::$config->int_banner_fontInfo, |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | if ($id) { |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | $b_user = $user['username']; |
53 | 53 | $b_ally = $user['ally_name']; |
54 | 54 | $b_planet = $planet_row['name']; |
55 | - $b_xyz = "[" . $planet_row['galaxy'] . ":" . $planet_row['system'] . ":" . $planet_row['planet'] . "]"; |
|
56 | - $b_lvl = ($user['total_rank'] ? $user['total_rank'] : classSupernova::$config->users_amount) . "/" . classSupernova::$config->users_amount; |
|
55 | + $b_xyz = "[".$planet_row['galaxy'].":".$planet_row['system'].":".$planet_row['planet']."]"; |
|
56 | + $b_lvl = ($user['total_rank'] ? $user['total_rank'] : classSupernova::$config->users_amount)."/".classSupernova::$config->users_amount; |
|
57 | 57 | } else { |
58 | 58 | $b_user = classLocale::$lang['ov_banner_empty_id']; |
59 | 59 | $b_lvl = ''; |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | imagettftext($image, 9, 0, 410 - $is[2], 35, $txt_color, $fonts['info'], $b_ally); |
89 | 89 | |
90 | 90 | // Player b_planet |
91 | - imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
92 | - imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
91 | + imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
92 | + imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
93 | 93 | |
94 | 94 | //StatPoint |
95 | - $b_points = classLocale::$lang['ov_points'] . ": " . pretty_number(!empty($user['total_points']) ? $user['total_points'] : 0); |
|
95 | + $b_points = classLocale::$lang['ov_points'].": ".pretty_number(!empty($user['total_points']) ? $user['total_points'] : 0); |
|
96 | 96 | $is = imagettfbbox(8, 0, $fonts['info'], $b_points); |
97 | 97 | imagettftext($image, 8, 0, 412 - $is[2], 11, $txt_shadow, $fonts['info'], $b_points); |
98 | 98 | imagettftext($image, 8, 0, 410 - $is[2], 9, $txt_color, $fonts['info'], $b_points); |
@@ -100,21 +100,21 @@ discard block |
||
100 | 100 | //Raids Total |
101 | 101 | imagettftext($image, 6, 0, 8, 37, $txt_shadow2, $fonts['raids'], classLocale::$lang['NumberOfRaids']); |
102 | 102 | imagettftext($image, 6, 0, 6, 35, $txt_color2, $fonts['raids'], classLocale::$lang['NumberOfRaids']); |
103 | - $b_points = ": " . pretty_number(!empty($user['raids']) ? $user['raids'] : 0); |
|
103 | + $b_points = ": ".pretty_number(!empty($user['raids']) ? $user['raids'] : 0); |
|
104 | 104 | imagettftext($image, 6, 0, 61, 37, $txt_shadow2, $fonts['raids'], $b_points); |
105 | 105 | imagettftext($image, 6, 0, 59, 35, $txt_color2, $fonts['raids'], $b_points); |
106 | 106 | |
107 | 107 | //Raids Won |
108 | 108 | imagettftext($image, 6, 0, 8, 47, $txt_shadow2, $fonts['raids'], classLocale::$lang['RaidsWin']); |
109 | 109 | imagettftext($image, 6, 0, 6, 45, $txt_color2, $fonts['raids'], classLocale::$lang['RaidsWin']); |
110 | - $b_points = ": " . pretty_number(!empty($user['raidswin']) ? $user['raidswin'] : 0); |
|
110 | + $b_points = ": ".pretty_number(!empty($user['raidswin']) ? $user['raidswin'] : 0); |
|
111 | 111 | imagettftext($image, 6, 0, 61, 47, $txt_shadow2, $fonts['raids'], $b_points); |
112 | 112 | imagettftext($image, 6, 0, 59, 45, $txt_color2, $fonts['raids'], $b_points); |
113 | 113 | |
114 | 114 | //Raids Lost |
115 | 115 | imagettftext($image, 6, 0, 8, 57, $txt_shadow2, $fonts['raids'], classLocale::$lang['RaidsLoose']); |
116 | 116 | imagettftext($image, 6, 0, 6, 55, $txt_color2, $fonts['raids'], classLocale::$lang['RaidsLoose']); |
117 | - $b_points = ": " . pretty_number(!empty($user['raidsloose']) ? $user['raidsloose'] : 0); |
|
117 | + $b_points = ": ".pretty_number(!empty($user['raidsloose']) ? $user['raidsloose'] : 0); |
|
118 | 118 | imagettftext($image, 6, 0, 61, 57, $txt_shadow2, $fonts['raids'], $b_points); |
119 | 119 | imagettftext($image, 6, 0, 59, 55, $txt_color2, $fonts['raids'], $b_points); |
120 | 120 | } |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | } |
69 | 69 | $build_unit_list = sn_get_groups('tech'); |
70 | 70 | $artifact_id = ART_HEURISTIC_CHIP; |
71 | - $page_header = classLocale::$lang['tech'][UNIT_TECHNOLOGIES] . ($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
71 | + $page_header = classLocale::$lang['tech'][UNIT_TECHNOLOGIES].($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
72 | 72 | } elseif ($que_type == QUE_MERCENARY) { |
73 | 73 | $build_unit_list = sn_get_groups('mercenaries'); |
74 | 74 | $artifact_id = 0; |
75 | - $page_header = classLocale::$lang['tech'][UNIT_MERCENARIES] . ($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
75 | + $page_header = classLocale::$lang['tech'][UNIT_MERCENARIES].($user['user_as_ally'] ? " {$classLocale['sys_of_ally']} {$user['username']}" : ''); |
|
76 | 76 | } else { |
77 | 77 | if (mrc_get_level($user, $planet, STRUC_FACTORY_HANGAR) == 0) { |
78 | 78 | message(classLocale::$lang['need_hangar'], classLocale::$lang['tech'][STRUC_FACTORY_HANGAR]); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * ($resource_id == RES_ENERGY ? $config_resource_multiplier_plain : $config_resource_multiplier) |
246 | 246 | * (isset($density_info[$resource_id]) ? $density_info[$resource_id] : 1))) |
247 | 247 | ) { |
248 | - $level_production_base['R' . $resource_id] = $resource_income; |
|
248 | + $level_production_base['R'.$resource_id] = $resource_income; |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | } |
@@ -272,8 +272,8 @@ discard block |
||
272 | 272 | * ($resource_id == RES_ENERGY ? $config_resource_multiplier_plain : $config_resource_multiplier) |
273 | 273 | * (isset($density_info[$resource_id]) ? $density_info[$resource_id] : 1))) |
274 | 274 | ) { |
275 | - $level_production['R' . $resource_id] = $resource_income; |
|
276 | - $level_production['D' . $resource_id] = $resource_income - $level_production_base[$resource_id]; |
|
275 | + $level_production['R'.$resource_id] = $resource_income; |
|
276 | + $level_production['D'.$resource_id] = $resource_income - $level_production_base[$resource_id]; |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | $production['.']['resource'][] = $level_production; |
@@ -288,15 +288,15 @@ discard block |
||
288 | 288 | $level_start = $level_base_and_que > 1 ? $level_effective + $level_in_que - 1 : 1; |
289 | 289 | for ($i = 0; $i < 6; $i++) { |
290 | 290 | $level_production = array('LEVEL' => $level_start + $i); |
291 | - $level_production['R' . UNIT_PLAYER_EXPEDITIONS_MAX] = get_player_max_expeditons($user, $level_start + $i); |
|
292 | - $level_production['D' . UNIT_PLAYER_EXPEDITIONS_MAX] = $level_production['R' . UNIT_PLAYER_EXPEDITIONS_MAX] - $level_production_base[UNIT_PLAYER_EXPEDITIONS_MAX]; |
|
293 | - $level_production['R' . UNIT_PLAYER_COLONIES_MAX] = get_player_max_colonies($user, $level_start + $i); |
|
294 | - $level_production['D' . UNIT_PLAYER_COLONIES_MAX] = $level_production['R' . UNIT_PLAYER_COLONIES_MAX] - $level_production_base[UNIT_PLAYER_COLONIES_MAX]; |
|
291 | + $level_production['R'.UNIT_PLAYER_EXPEDITIONS_MAX] = get_player_max_expeditons($user, $level_start + $i); |
|
292 | + $level_production['D'.UNIT_PLAYER_EXPEDITIONS_MAX] = $level_production['R'.UNIT_PLAYER_EXPEDITIONS_MAX] - $level_production_base[UNIT_PLAYER_EXPEDITIONS_MAX]; |
|
293 | + $level_production['R'.UNIT_PLAYER_COLONIES_MAX] = get_player_max_colonies($user, $level_start + $i); |
|
294 | + $level_production['D'.UNIT_PLAYER_COLONIES_MAX] = $level_production['R'.UNIT_PLAYER_COLONIES_MAX] - $level_production_base[UNIT_PLAYER_COLONIES_MAX]; |
|
295 | 295 | $production['.']['resource'][] = $level_production; |
296 | 296 | |
297 | 297 | $level_production_base = array( |
298 | - UNIT_PLAYER_EXPEDITIONS_MAX => $level_production['R' . UNIT_PLAYER_EXPEDITIONS_MAX], |
|
299 | - UNIT_PLAYER_COLONIES_MAX => $level_production['R' . UNIT_PLAYER_COLONIES_MAX], |
|
298 | + UNIT_PLAYER_EXPEDITIONS_MAX => $level_production['R'.UNIT_PLAYER_EXPEDITIONS_MAX], |
|
299 | + UNIT_PLAYER_COLONIES_MAX => $level_production['R'.UNIT_PLAYER_COLONIES_MAX], |
|
300 | 300 | ); |
301 | 301 | } |
302 | 302 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | 5 | $template = gettemplate('viewreport', true); |
6 | 6 | $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']); |
@@ -2,9 +2,9 @@ discard block |
||
2 | 2 | |
3 | 3 | define('IN_ADMIN', true); |
4 | 4 | |
5 | -require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
|
5 | +require('../includes/init.'.substr(strrchr(__FILE__, '.'), 1)); |
|
6 | 6 | |
7 | -if($user['authlevel'] < 3) |
|
7 | +if ($user['authlevel'] < 3) |
|
8 | 8 | { |
9 | 9 | message(classLocale::$lang['sys_noalloaw'], classLocale::$lang['sys_noaccess']); |
10 | 10 | die(); |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | // [#] info_best_battles 1b0 |
21 | 21 | $best_reports = array(); |
22 | 22 | |
23 | -if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
23 | +if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) { |
|
24 | 24 | $query = db_ube_report_get_best_battles(); |
25 | - while($row = db_fetch($query)) { |
|
25 | + while ($row = db_fetch($query)) { |
|
26 | 26 | $best_reports[] = $row['ube_report_id']; |
27 | 27 | } |
28 | 28 | } |
29 | -$best_reports = !empty($best_reports) ? ' AND ube_report_id NOT IN (' . implode(',', $best_reports) . ')' : ''; |
|
29 | +$best_reports = !empty($best_reports) ? ' AND ube_report_id NOT IN ('.implode(',', $best_reports).')' : ''; |
|
30 | 30 | |
31 | 31 | |
32 | 32 | $ques = array( |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | // Удаляем юниты без планет |
91 | 91 | 'DELETE un FROM {{unit}} AS un |
92 | 92 | LEFT JOIN {{planets}} AS pl ON pl.id = un.unit_location_id |
93 | - WHERE unit_location_type = ' . LOC_PLANET . ' AND pl.id IS NULL;', |
|
93 | + WHERE unit_location_type = ' . LOC_PLANET.' AND pl.id IS NULL;', |
|
94 | 94 | // Удаляем пустые юниты с 0 уровнем (кроме Капитана) |
95 | - 'DELETE FROM {{unit}} WHERE unit_location_type = ' . LOC_PLANET . ' AND unit_level = 0 AND unit_type <> ' . UNIT_CAPTAIN, |
|
95 | + 'DELETE FROM {{unit}} WHERE unit_location_type = '.LOC_PLANET.' AND unit_level = 0 AND unit_type <> '.UNIT_CAPTAIN, |
|
96 | 96 | // Удаляем очереди на ничьих планетах |
97 | 97 | 'DELETE q FROM {{que}} AS q |
98 | 98 | LEFT JOIN {{planets}} AS p ON p.id = q.que_planet_id |
99 | 99 | WHERE |
100 | - que_type IN (' . QUE_STRUCTURES . ', ' . QUE_HANGAR . ', ' . SUBQUE_FLEET . ', ' . SUBQUE_DEFENSE . ') |
|
100 | + que_type IN (' . QUE_STRUCTURES.', '.QUE_HANGAR.', '.SUBQUE_FLEET.', '.SUBQUE_DEFENSE.') |
|
101 | 101 | AND |
102 | 102 | (p.id_owner = 0 OR p.id_owner IS NULL);', |
103 | 103 | |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | // Удаляются сообщения, старше 4 недель, кроме личных и Альянсовских |
113 | 113 | 'DELETE FROM {{messages}} WHERE |
114 | 114 | UNIX_TIMESTAMP() - message_time > 4*7 * 24 * 60 * 60 AND |
115 | - message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ');', |
|
115 | + message_type NOT IN (' . MSG_TYPE_PLAYER.', '.MSG_TYPE_ALLIANCE.');', |
|
116 | 116 | // Удаляются сообщения у пользователей, которые неактивны больше 4 недель - кроме личных и Альянсовских |
117 | 117 | 'DELETE m FROM `{{users}}` AS u |
118 | 118 | JOIN {{messages}} AS m ON m.message_owner = u.id |
119 | 119 | WHERE |
120 | - message_type NOT IN (' . MSG_TYPE_PLAYER . ', ' . MSG_TYPE_ALLIANCE . ') AND |
|
120 | + message_type NOT IN (' . MSG_TYPE_PLAYER.', '.MSG_TYPE_ALLIANCE.') AND |
|
121 | 121 | authlevel = 0 AND user_as_ally IS NULL AND /* Не админы, Не Альянсы */ |
122 | 122 | UNIX_TIMESTAMP() - onlinetime > 4*7 *86400;', |
123 | 123 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | (log_dark_matter_timestamp, log_dark_matter_username, log_dark_matter_reason, log_dark_matter_amount, |
138 | 138 | log_dark_matter_comment, log_dark_matter_page, log_dark_matter_sender) |
139 | 139 | SELECT |
140 | - '{$pack_until}', IF(u.username IS NULL, ldm.log_dark_matter_username, u.username), " . RPG_CUMULATIVE . ", sum(ldm.log_dark_matter_amount), |
|
140 | + '{$pack_until}', IF(u.username IS NULL, ldm.log_dark_matter_username, u.username), ".RPG_CUMULATIVE.", sum(ldm.log_dark_matter_amount), |
|
141 | 141 | 'Баланс на {$pack_until}', 'admin/ajax_maintenance.php', ldm.log_dark_matter_sender |
142 | 142 | FROM |
143 | 143 | {{log_dark_matter}} AS ldm |
@@ -155,22 +155,22 @@ discard block |
||
155 | 155 | "REPLACE INTO `{{log_users_online}}` |
156 | 156 | (online_timestamp, online_count, online_aggregated) |
157 | 157 | SELECT |
158 | - FROM_UNIXTIME((UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ")), ceil(avg(online_count)), " . LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10 . " |
|
158 | + FROM_UNIXTIME((UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10.") * (".PERIOD_MINUTE_10.")), ceil(avg(online_count)), ".LOG_ONLIINE_AGGREGATE_PERIOD_MINUTE_10." |
|
159 | 159 | FROM |
160 | 160 | `{{log_users_online}}` |
161 | 161 | WHERE |
162 | - online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE . " |
|
162 | + online_timestamp < '{$pack_until}' AND online_aggregated = ".LOG_ONLIINE_AGGREGATE_NONE." |
|
163 | 163 | GROUP BY |
164 | - (UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10 . ") * (" . PERIOD_MINUTE_10 . ");", |
|
164 | + (UNIX_TIMESTAMP(online_timestamp) DIV " . PERIOD_MINUTE_10.") * (".PERIOD_MINUTE_10.");", |
|
165 | 165 | |
166 | - "DELETE FROM {{log_users_online}} WHERE online_timestamp < '{$pack_until}' AND online_aggregated = " . LOG_ONLIINE_AGGREGATE_NONE, |
|
166 | + "DELETE FROM {{log_users_online}} WHERE online_timestamp < '{$pack_until}' AND online_aggregated = ".LOG_ONLIINE_AGGREGATE_NONE, |
|
167 | 167 | ), |
168 | 168 | |
169 | 169 | // Удаляем старые записи из логов |
170 | 170 | "DELETE FROM `{{logs}}` WHERE log_timestamp < '{$pack_until}';", |
171 | 171 | // Удаляем записи о маинтенансе, апдейте и пересчете статистики более чем недельной давности - они нам уже не нужны |
172 | 172 | 'DELETE FROM `{{logs}}` WHERE |
173 | - `log_code` IN (' . LOG_INFO_DB_CHANGE . ', ' . LOG_INFO_MAINTENANCE . ', ' . LOG_INFO_STAT_START . ', ' . LOG_INFO_STAT_PROCESS . ', ' . LOG_INFO_STAT_FINISH . ') |
|
173 | + `log_code` IN (' . LOG_INFO_DB_CHANGE.', '.LOG_INFO_MAINTENANCE.', '.LOG_INFO_STAT_START.', '.LOG_INFO_STAT_PROCESS.', '.LOG_INFO_STAT_FINISH.') |
|
174 | 174 | AND `log_timestamp` < DATE_SUB(NOW(),INTERVAL 7 DAY);', |
175 | 175 | |
176 | 176 | |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | $old_server_status == GAME_DISABLE_NONE ? classSupernova::$config->db_saveItem('game_disable', GAME_DISABLE_MAINTENANCE) : false; |
190 | 190 | sn_db_transaction_commit(); |
191 | 191 | |
192 | -foreach($ques as $que_transaction) { |
|
192 | +foreach ($ques as $que_transaction) { |
|
193 | 193 | sn_db_transaction_start(); |
194 | 194 | |
195 | 195 | !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false; |
196 | - foreach($que_transaction as $que) { |
|
196 | + foreach ($que_transaction as $que) { |
|
197 | 197 | set_time_limit(120); |
198 | - if(is_callable($que)) { |
|
198 | + if (is_callable($que)) { |
|
199 | 199 | $QryResult = call_user_func($que); |
200 | 200 | } else { |
201 | 201 | $QryResult = doquery($que); |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | //$que = str_replace('}}', '', $que); |
207 | 207 | |
208 | 208 | $msg .= |
209 | - '<li>' . htmlspecialchars($que) . |
|
210 | - ' --- <span style="' . ($QryResult ? 'ok">OK' : 'error">FAILED!') . '</span> ' . |
|
211 | - classSupernova::$db->db_affected_rows() . ' ' . classLocale::$lang['adm_records'] . |
|
209 | + '<li>'.htmlspecialchars($que). |
|
210 | + ' --- <span style="'.($QryResult ? 'ok">OK' : 'error">FAILED!').'</span> '. |
|
211 | + classSupernova::$db->db_affected_rows().' '.classLocale::$lang['adm_records']. |
|
212 | 212 | "</li>"; |
213 | 213 | |
214 | - classSupernova::$debug->warning($que . ' --- ' . ($QryResult ? 'OK' : 'FAILED!') . ' ' . classSupernova::$db->db_affected_rows() . ' ' . classLocale::$lang['adm_records'], 'System maintenance', LOG_INFO_MAINTENANCE); |
|
214 | + classSupernova::$debug->warning($que.' --- '.($QryResult ? 'OK' : 'FAILED!').' '.classSupernova::$db->db_affected_rows().' '.classLocale::$lang['adm_records'], 'System maintenance', LOG_INFO_MAINTENANCE); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | sn_db_transaction_commit(); |
@@ -239,5 +239,5 @@ discard block |
||
239 | 239 | |
240 | 240 | $adm_stat_title = classLocale::$lang['adm_stat_title']; |
241 | 241 | $result = $result ? "<li>{$adm_stat_title} - {$result}</li>" : ''; |
242 | -$result = '<div align="left"><ul>' . $msg . $result . '</ul></div>'; |
|
243 | -echo json_encode($result . ' ' . $totaltime); |
|
242 | +$result = '<div align="left"><ul>'.$msg.$result.'</ul></div>'; |
|
243 | +echo json_encode($result.' '.$totaltime); |