@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | $TargetAddress = sprintf(classLocale::$lang['sys_adress_planet'], $fleet_end_coordinates['galaxy'], $fleet_end_coordinates['system'], $fleet_end_coordinates['planet']); |
21 | 21 | |
22 | 22 | $TheMessage = classLocale::$lang['sys_colo_no_colonizer']; |
23 | - if($objFleet->shipsGetTotalById(SHIP_COLONIZER) >= 1) { |
|
23 | + if ($objFleet->shipsGetTotalById(SHIP_COLONIZER) >= 1) { |
|
24 | 24 | $TheMessage = classLocale::$lang['sys_colo_notfree']; |
25 | - if(empty($mission_data->dst_planet)) { |
|
25 | + if (empty($mission_data->dst_planet)) { |
|
26 | 26 | $iPlanetCount = get_player_current_colonies($src_user_row); |
27 | 27 | |
28 | 28 | // Can we colonize more planets? |
29 | 29 | $TheMessage = classLocale::$lang['sys_colo_maxcolo']; |
30 | - if($iPlanetCount < get_player_max_colonies($src_user_row)) { |
|
30 | + if ($iPlanetCount < get_player_max_colonies($src_user_row)) { |
|
31 | 31 | // Yes, we can colonize |
32 | 32 | $TheMessage = classLocale::$lang['sys_colo_badpos']; |
33 | 33 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | $fleet_end_coordinates['galaxy'], $fleet_end_coordinates['system'], $fleet_end_coordinates['planet'], |
36 | 36 | $objFleet->playerOwnerId, "{$classLocale['sys_colo_defaultname']} {$iPlanetCount}", false, |
37 | 37 | array('user_row' => $src_user_row)); |
38 | - if($NewOwnerPlanet) { |
|
39 | - $TheMessage = classLocale::$lang['sys_colo_arrival'] . $TargetAddress . classLocale::$lang['sys_colo_allisok']; |
|
38 | + if ($NewOwnerPlanet) { |
|
39 | + $TheMessage = classLocale::$lang['sys_colo_arrival'].$TargetAddress.classLocale::$lang['sys_colo_allisok']; |
|
40 | 40 | msg_send_simple_message($objFleet->playerOwnerId, '', $objFleet->time_arrive_to_target, MSG_TYPE_SPY, classLocale::$lang['sys_colo_mess_from'], classLocale::$lang['sys_colo_mess_report'], $TheMessage); |
41 | 41 | |
42 | 42 | $objFleet->shipAdjustCount(SHIP_COLONIZER, -1); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | $classLocale = classLocale::$lang; |
4 | 4 | |
5 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
5 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
6 | 6 | { |
7 | 7 | classSupernova::$debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
8 | 8 | } |
@@ -17,54 +17,54 @@ discard block |
||
17 | 17 | )); |
18 | 18 | |
19 | 19 | $info_action = sys_get_param_int('action'); |
20 | -if($info_action) |
|
20 | +if ($info_action) |
|
21 | 21 | { |
22 | 22 | try |
23 | 23 | { |
24 | 24 | sn_db_transaction_start(); |
25 | 25 | |
26 | 26 | $user = db_user_by_id($user['id'], true); |
27 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->rpg_cost_info) |
|
27 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < classSupernova::$config->rpg_cost_info) |
|
28 | 28 | { |
29 | 29 | throw new Exception(MARKET_NO_DM, ERR_ERROR); |
30 | 30 | } |
31 | 31 | |
32 | - switch($info_action) |
|
32 | + switch ($info_action) |
|
33 | 33 | { |
34 | 34 | case MARKET_INFO_PLAYER: |
35 | 35 | $user_info_name_unsafe = sys_get_param_str_unsafe('user_info_name'); |
36 | - if(!$user_info_name_unsafe) |
|
36 | + if (!$user_info_name_unsafe) |
|
37 | 37 | { |
38 | 38 | throw new Exception(MARKET_INFO_PLAYER_WRONG, ERR_ERROR); |
39 | 39 | } |
40 | 40 | |
41 | - if(is_id($user_info_name_unsafe)) |
|
41 | + if (is_id($user_info_name_unsafe)) |
|
42 | 42 | { |
43 | 43 | $user_info = db_user_by_id($user_info_name_unsafe, true, '`id`, `username`', true); |
44 | 44 | } |
45 | - if(!is_array($user_info)) |
|
45 | + if (!is_array($user_info)) |
|
46 | 46 | { |
47 | 47 | $user_info = db_user_by_username($user_info_name_unsafe, true, '`id`, `username`', true, true); |
48 | 48 | } |
49 | - if(!is_array($user_info)) |
|
49 | + if (!is_array($user_info)) |
|
50 | 50 | { |
51 | 51 | throw new Exception(MARKET_INFO_PLAYER_NOT_FOUND, ERR_ERROR); |
52 | 52 | } |
53 | - if($user_info['id'] == $user['id']) |
|
53 | + if ($user_info['id'] == $user['id']) |
|
54 | 54 | { |
55 | 55 | throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
56 | 56 | } |
57 | 57 | |
58 | 58 | $msg_text = array(); |
59 | - foreach(sn_get_groups('mercenaries') as $mercenary_id) |
|
59 | + foreach (sn_get_groups('mercenaries') as $mercenary_id) |
|
60 | 60 | { |
61 | - $msg_text[] = "{$classLocale['tech'][$mercenary_id]} - " . (($mercenary_level = mrc_get_level($user_info, null, $mercenary_id)) ? "{$classLocale['sys_level']} {$mercenary_level}" : classLocale::$lang['eco_mrk_info_not_hired']); |
|
61 | + $msg_text[] = "{$classLocale['tech'][$mercenary_id]} - ".(($mercenary_level = mrc_get_level($user_info, null, $mercenary_id)) ? "{$classLocale['sys_level']} {$mercenary_level}" : classLocale::$lang['eco_mrk_info_not_hired']); |
|
62 | 62 | } |
63 | - if($mercenary_level = mrc_get_level($user_info, null, UNIT_PREMIUM)) |
|
63 | + if ($mercenary_level = mrc_get_level($user_info, null, UNIT_PREMIUM)) |
|
64 | 64 | { |
65 | 65 | $msg_text[] = "{$classLocale['tech'][UNIT_PREMIUM]} - {$mercenary_level} {$classLocale['sys_level']}"; |
66 | 66 | } |
67 | - $msg_text = sprintf(classLocale::$lang['eco_mrk_info_player_message'], $user_info['id'], $user_info['username']) . "\r\n" . implode("\r\n", $msg_text); |
|
67 | + $msg_text = sprintf(classLocale::$lang['eco_mrk_info_player_message'], $user_info['id'], $user_info['username'])."\r\n".implode("\r\n", $msg_text); |
|
68 | 68 | |
69 | 69 | msg_send_simple_message($user['id'], 0, SN_TIME_NOW, MSG_TYPE_SPY, classLocale::$lang['eco_mrk_info_msg_from'], "{$classLocale['eco_mrk_info_player']} ID {$user_info['id']} [{$user_info['username']}]", $msg_text, false, true); |
70 | 70 | break; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | break; |
75 | 75 | } |
76 | 76 | |
77 | - if(!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -classSupernova::$config->rpg_cost_info, "Using Black Market page {$classLocale['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
77 | + if (!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -classSupernova::$config->rpg_cost_info, "Using Black Market page {$classLocale['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
78 | 78 | { |
79 | 79 | // TODO: throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
80 | 80 | } |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']); |
12 | 12 | $uni_system = sys_get_param_int('system'); |
13 | 13 | |
14 | - if($uni_galaxy < 1 || $uni_galaxy > Vector::$knownGalaxies) |
|
14 | + if ($uni_galaxy < 1 || $uni_galaxy > Vector::$knownGalaxies) |
|
15 | 15 | { |
16 | 16 | throw new exception(classLocale::$lang['uni_msg_error_wrong_galaxy'], ERR_ERROR); |
17 | 17 | } |
18 | 18 | |
19 | - if($uni_system < 0 || $uni_system > Vector::$knownSystems) |
|
19 | + if ($uni_system < 0 || $uni_system > Vector::$knownSystems) |
|
20 | 20 | { |
21 | 21 | throw new exception(classLocale::$lang['uni_msg_error_wrong_system'], ERR_ERROR); |
22 | 22 | } |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | $uni_row['universe_price'] += $uni_system ? classSupernova::$config->uni_price_system : classSupernova::$config->uni_price_galaxy; |
26 | 26 | $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$classLocale['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$classLocale['sys_galaxy']} {$uni_galaxy}")); |
27 | 27 | |
28 | - if(sys_get_param_str('uni_name_submit')) |
|
28 | + if (sys_get_param_str('uni_name_submit')) |
|
29 | 29 | { |
30 | 30 | $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name')); |
31 | 31 | |
32 | 32 | $uni_price = sys_get_param_float('uni_price'); |
33 | - if($uni_price < $uni_row['universe_price']) |
|
33 | + if ($uni_price < $uni_row['universe_price']) |
|
34 | 34 | { |
35 | 35 | throw new exception(classLocale::$lang['uni_msg_error_low_price'], ERR_ERROR); |
36 | 36 | } |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | sn_db_transaction_start(); |
40 | 40 | $user = db_user_by_id($user['id'], true); |
41 | 41 | // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price) |
42 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
42 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
43 | 43 | { |
44 | 44 | throw new exception(classLocale::$lang['uni_msg_error_no_dm'], ERR_ERROR); |
45 | 45 | } |
46 | 46 | |
47 | - if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
47 | + if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to ".sys_get_param_str_unsafe('uni_name'))) |
|
48 | 48 | { |
49 | 49 | throw new exception(classLocale::$lang['sys_msg_err_update_dm'], ERR_ERROR); |
50 | 50 | } |
@@ -74,4 +74,4 @@ discard block |
||
74 | 74 | 'PAGE_HINT' => classLocale::$lang['uni_name_page_hint'], |
75 | 75 | )); |
76 | 76 | |
77 | - display($template, classLocale::$lang['sys_universe'] . ' - ' . classLocale::$lang['uni_naming'], true, '', false); |
|
77 | + display($template, classLocale::$lang['sys_universe'].' - '.classLocale::$lang['uni_naming'], true, '', false); |
@@ -2,32 +2,32 @@ discard block |
||
2 | 2 | |
3 | 3 | function sys_avatar_upload($subject_id, &$avatar_field, $prefix = 'avatar') { |
4 | 4 | try { |
5 | - $avatar_filename = $fullsize_filename = SN_ROOT_PHYSICAL . 'images/avatar/' . $prefix . '_' . $subject_id; |
|
5 | + $avatar_filename = $fullsize_filename = SN_ROOT_PHYSICAL.'images/avatar/'.$prefix.'_'.$subject_id; |
|
6 | 6 | $avatar_filename .= '.png'; |
7 | 7 | $fullsize_filename .= '_full.png'; |
8 | - if(sys_get_param_int('avatar_remove')) { |
|
9 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
8 | + if (sys_get_param_int('avatar_remove')) { |
|
9 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
10 | 10 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
11 | 11 | } |
12 | 12 | $avatar_field = 0; |
13 | 13 | throw new Exception(classLocale::$lang['opt_msg_avatar_removed'], ERR_NONE); |
14 | - } elseif($_FILES['avatar']['size']) { |
|
15 | - if(!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) { |
|
14 | + } elseif ($_FILES['avatar']['size']) { |
|
15 | + if (!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) { |
|
16 | 16 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
17 | 17 | } |
18 | 18 | |
19 | - if($_FILES['avatar']['error']) { |
|
19 | + if ($_FILES['avatar']['error']) { |
|
20 | 20 | throw new Exception(sprintf(classLocale::$lang['opt_msg_avatar_error_upload'], $_FILES['avatar']['error']), ERR_ERROR); |
21 | 21 | } |
22 | 22 | |
23 | - if(!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) { |
|
23 | + if (!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) { |
|
24 | 24 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
25 | 25 | } |
26 | 26 | |
27 | 27 | $avatar_size = getimagesize($_FILES['avatar']['tmp_name']); |
28 | 28 | $avatar_max_width = classSupernova::$config->avatar_max_width; |
29 | 29 | $avatar_max_height = classSupernova::$config->avatar_max_height; |
30 | - if($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) { |
|
30 | + if ($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) { |
|
31 | 31 | $aspect_ratio = min($avatar_max_width / $avatar_size[0], $avatar_max_height / $avatar_size[1]); |
32 | 32 | $avatar_image_new = imagecreatetruecolor($avatar_size[0] * $aspect_ratio, $avatar_size[0] * $aspect_ratio); |
33 | 33 | $result = imagecopyresized($avatar_image_new, $avatar_image, 0, 0, 0, 0, $avatar_size[0] * $aspect_ratio, $avatar_size[0] * $aspect_ratio, $avatar_size[0], $avatar_size[1]); |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | $avatar_image = $avatar_image_new; |
36 | 36 | } |
37 | 37 | |
38 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
38 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) { |
|
39 | 39 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
40 | 40 | } |
41 | 41 | |
42 | - if(!imagepng($avatar_image, $avatar_filename, 9)) { |
|
42 | + if (!imagepng($avatar_image, $avatar_filename, 9)) { |
|
43 | 43 | throw new Exception(classLocale::$lang['opt_msg_avatar_error_writing'], ERR_ERROR); |
44 | 44 | } |
45 | 45 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | imagedestroy($avatar_image); |
48 | 48 | throw new Exception(classLocale::$lang['opt_msg_avatar_uploaded'], ERR_NONE); |
49 | 49 | } |
50 | - } catch(Exception $e) { |
|
50 | + } catch (Exception $e) { |
|
51 | 51 | return array( |
52 | 52 | 'STATUS' => in_array($e->getCode(), array(ERR_NONE, ERR_WARNING, ERR_ERROR)) ? $e->getCode() : ERR_ERROR, |
53 | 53 | 'MESSAGE' => $e->getMessage() |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | global $who; |
12 | 12 | |
13 | 13 | // $sn_group_stat_common = sn_get_groups('STAT_COMMON'); |
14 | - foreach($array as $key => $value) { |
|
15 | - if($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
14 | + foreach ($array as $key => $value) { |
|
15 | + if ($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
16 | 16 | continue; |
17 | 17 | } |
18 | 18 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $allow_anonymous = true; |
30 | 30 | |
31 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
31 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
32 | 32 | |
33 | 33 | lng_include('stat'); |
34 | 34 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $subject_list = array( |
45 | 45 | 1 => array('header' => classLocale::$lang['stat_player']), |
46 | 46 | ); |
47 | -if(!$source) { |
|
47 | +if (!$source) { |
|
48 | 48 | $subject_list[2] = array('header' => classLocale::$lang['stat_allys']); |
49 | 49 | } |
50 | 50 | stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $page_count = floor($record_count / 100); |
115 | 115 | $pages = array(); |
116 | -for($i = 0; $i <= $page_count; $i++) { |
|
116 | +for ($i = 0; $i <= $page_count; $i++) { |
|
117 | 117 | $first_element = $i * 100 + 1; |
118 | 118 | $last_element = $first_element + 99; |
119 | 119 | $pages[$first_element] = array( |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ); |
134 | 134 | //pdump($row); |
135 | 135 | |
136 | - if($who == 1) { |
|
136 | + if ($who == 1) { |
|
137 | 137 | $row_stat['ALLY_NAME'] = $row['ally_name']; |
138 | 138 | $row_stat['ALLY_ID'] = $row['ally_id']; |
139 | 139 | empty($row['username']) ? $row['username'] = $row['name'] : false; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | $id_ref = $_GET['id_ref'] ? intval($_GET['id_ref']) : 0; |
4 | -$id_ref = $id_ref ? '?id_ref=' . $id_ref : ''; |
|
4 | +$id_ref = $id_ref ? '?id_ref='.$id_ref : ''; |
|
5 | 5 | |
6 | 6 | header('HTTP/1.1 301 Moved Permanently'); |
7 | 7 | header("Location: login.php{$id_ref}#tab_password_reset"); |
@@ -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 | ); |
@@ -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']); |