@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | |
18 | 18 | global $lang; |
19 | 19 | |
20 | - $TargetAdress = sprintf ($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']); |
|
20 | + $TargetAdress = sprintf($lang['sys_adress_planet'], $fleet_row['fleet_end_galaxy'], $fleet_row['fleet_end_system'], $fleet_row['fleet_end_planet']); |
|
21 | 21 | |
22 | 22 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
23 | 23 | |
24 | 24 | $TheMessage = $lang['sys_colo_no_colonizer']; |
25 | - if($fleet_array[SHIP_COLONIZER] >= 1) |
|
25 | + if ($fleet_array[SHIP_COLONIZER] >= 1) |
|
26 | 26 | { |
27 | 27 | $TheMessage = $lang['sys_colo_notfree']; |
28 | 28 | if (!$mission_data['dst_planet'] || empty($mission_data['dst_planet'])) |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | // Can we colonize more planets? |
33 | 33 | $TheMessage = $lang['sys_colo_maxcolo']; |
34 | - if($iPlanetCount < get_player_max_colonies($src_user_row)) |
|
34 | + if ($iPlanetCount < get_player_max_colonies($src_user_row)) |
|
35 | 35 | { |
36 | 36 | // Yes, we can colonize |
37 | 37 | $TheMessage = $lang['sys_colo_badpos']; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if ($NewOwnerPlanet) |
43 | 43 | { |
44 | 44 | $TheMessage = $lang['sys_colo_arrival'] . $TargetAdress . $lang['sys_colo_allisok']; |
45 | - msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); |
|
45 | + msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_SPY, $lang['sys_colo_mess_from'], $lang['sys_colo_mess_report'], $TheMessage); |
|
46 | 46 | |
47 | 47 | $fleet_array[SHIP_COLONIZER]--; |
48 | 48 | $fleet_row['fleet_amount']--; |
@@ -9,28 +9,28 @@ discard block |
||
9 | 9 | $avatar_filename = $fullsize_filename = SN_ROOT_PHYSICAL . 'images/avatar/' . $prefix . '_' . $subject_id; |
10 | 10 | $avatar_filename .= '.png'; |
11 | 11 | $fullsize_filename .= '_full.png'; |
12 | - if(sys_get_param_int('avatar_remove')) |
|
12 | + if (sys_get_param_int('avatar_remove')) |
|
13 | 13 | { |
14 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
14 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
15 | 15 | { |
16 | 16 | throw new Exception($lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
17 | 17 | } |
18 | 18 | $avatar_field = 0; |
19 | 19 | throw new Exception($lang['opt_msg_avatar_removed'], ERR_NONE); |
20 | 20 | } |
21 | - elseif($_FILES['avatar']['size']) |
|
21 | + elseif ($_FILES['avatar']['size']) |
|
22 | 22 | { |
23 | - if(!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) |
|
23 | + if (!in_array($_FILES['avatar']['type'], array('image/gif', 'image/jpeg', 'image/jpg', 'image/pjpeg', 'image/png')) || $_FILES['avatar']['size'] > 204800) |
|
24 | 24 | { |
25 | 25 | throw new Exception($lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
26 | 26 | } |
27 | 27 | |
28 | - if($_FILES['avatar']['error']) |
|
28 | + if ($_FILES['avatar']['error']) |
|
29 | 29 | { |
30 | 30 | throw new Exception(sprintf($lang['opt_msg_avatar_error_upload'], $_FILES['avatar']['error']), ERR_ERROR); |
31 | 31 | } |
32 | 32 | |
33 | - if(!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) |
|
33 | + if (!($avatar_image = imagecreatefromstring(file_get_contents($_FILES['avatar']['tmp_name'])))) |
|
34 | 34 | { |
35 | 35 | throw new Exception($lang['opt_msg_avatar_error_unsupported'], ERR_WARNING); |
36 | 36 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $avatar_size = getimagesize($_FILES['avatar']['tmp_name']); |
39 | 39 | $avatar_max_width = $config-> avatar_max_width; |
40 | 40 | $avatar_max_height = $config-> avatar_max_height; |
41 | - if($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) |
|
41 | + if ($avatar_size[0] > $avatar_max_width || $avatar_size[1] > $avatar_max_height) |
|
42 | 42 | { |
43 | 43 | $aspect_ratio = min($avatar_max_width / $avatar_size[0], $avatar_max_height / $avatar_size[1]); |
44 | 44 | $avatar_image_new = imagecreatetruecolor($avatar_size[0] * $aspect_ratio, $avatar_size[0] * $aspect_ratio); |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | $avatar_image = $avatar_image_new; |
48 | 48 | } |
49 | 49 | |
50 | - if(file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
50 | + if (file_exists($avatar_filename) && !unlink($avatar_filename)) |
|
51 | 51 | { |
52 | 52 | throw new Exception($lang['opt_msg_avatar_error_delete'], ERR_ERROR); |
53 | 53 | } |
54 | 54 | |
55 | - if(!imagepng($avatar_image, $avatar_filename, 9)) |
|
55 | + if (!imagepng($avatar_image, $avatar_filename, 9)) |
|
56 | 56 | { |
57 | 57 | throw new Exception($lang['opt_msg_avatar_error_writing'], ERR_ERROR); |
58 | 58 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | |
10 | -function flt_planet_capture(&$fleet_row, &$combat_data) {return sn_function_call('flt_planet_capture', array(&$fleet_row, &$combat_data, &$result));} |
|
10 | +function flt_planet_capture(&$fleet_row, &$combat_data) {return sn_function_call('flt_planet_capture', array(&$fleet_row, &$combat_data, &$result)); } |
|
11 | 11 | function sn_flt_planet_capture(&$fleet_row, &$combat_data, &$result) { |
12 | 12 | return $result; |
13 | 13 | } |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | $destination_user = $mission_data['dst_user']; |
18 | 18 | $destination_planet = $mission_data['dst_planet']; |
19 | 19 | |
20 | - if(!$fleet_row) { |
|
20 | + if (!$fleet_row) { |
|
21 | 21 | return null; |
22 | 22 | } |
23 | 23 | |
24 | - if( |
|
24 | + if ( |
|
25 | 25 | // Нет данных о планете назначения или её владельце |
26 | 26 | empty($destination_user) || empty($destination_planet) || !is_array($destination_user) || !is_array($destination_planet) |
27 | 27 | || |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | $combat_data = sn_ube_report_load(sys_get_param_str('cypher')); |
17 | 17 | |
18 | - if($combat_data != UBE_REPORT_NOT_FOUND) { |
|
18 | + if ($combat_data != UBE_REPORT_NOT_FOUND) { |
|
19 | 19 | sn_ube_report_generate($combat_data, $template_result); |
20 | 20 | $template = gettemplate('ube_combat_report', $template); |
21 | 21 | $template->assign_vars(array( |
@@ -14,14 +14,14 @@ |
||
14 | 14 | global $lang, $user, $planetrow; |
15 | 15 | |
16 | 16 | $tech_tree = array(); |
17 | - foreach(get_unit_param('techtree') as $unit_group_id => $unit_list) |
|
17 | + foreach (get_unit_param('techtree') as $unit_group_id => $unit_list) |
|
18 | 18 | { |
19 | 19 | $tech_tree[] = array( |
20 | 20 | 'NAME' => $lang['tech'][$unit_group_id], |
21 | 21 | 'GROUP_ID' => $unit_group_id, |
22 | 22 | ); |
23 | 23 | |
24 | - foreach($unit_list as $unit_id) |
|
24 | + foreach ($unit_list as $unit_id) |
|
25 | 25 | { |
26 | 26 | $sn_data_unit = get_unit_param($unit_id); |
27 | 27 | $level_basic = $sn_data_unit[P_STACKABLE] ? 0 : mrc_get_level($user, $planetrow, $unit_id, false, true); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $query = db_user_list("`authlevel` > 0 ORDER BY `authlevel` ASC"); |
19 | 19 | |
20 | 20 | // while($row = db_fetch($query)) |
21 | - foreach($query as $row) |
|
21 | + foreach ($query as $row) |
|
22 | 22 | { |
23 | 23 | $template_result['.']['contact'][] = array( |
24 | 24 | 'NAME' => $row['username'], |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | 'factor' => 1.5, |
16 | 16 | ), |
17 | 17 | P_UNIT_PRODUCTION => array( |
18 | - RES_METAL => function ($level, $production_factor, $user, $planet_row) {return 40 * $level * pow(1.1, $level) * (0.1 * $production_factor);}, |
|
19 | - RES_ENERGY => function ($level, $production_factor, $user, $planet_row) {return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor);}, |
|
18 | + RES_METAL => function($level, $production_factor, $user, $planet_row) {return 40 * $level * pow(1.1, $level) * (0.1 * $production_factor); }, |
|
19 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor); }, |
|
20 | 20 | ), |
21 | 21 | P_MINING_IS_MANAGED => true, |
22 | 22 | ), |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | 'factor' => 1.6, |
34 | 34 | ), |
35 | 35 | P_UNIT_PRODUCTION => array( |
36 | - RES_CRYSTAL => function ($level, $production_factor, $user, $planet_row) {return 32 * $level * pow(1.1, $level) * (0.1 * $production_factor);}, |
|
37 | - RES_ENERGY => function ($level, $production_factor, $user, $planet_row) {return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor);}, |
|
36 | + RES_CRYSTAL => function($level, $production_factor, $user, $planet_row) {return 32 * $level * pow(1.1, $level) * (0.1 * $production_factor); }, |
|
37 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor); }, |
|
38 | 38 | ), |
39 | 39 | P_MINING_IS_MANAGED => true, |
40 | 40 | ), |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | 'factor' => 1.5, |
52 | 52 | ), |
53 | 53 | P_UNIT_PRODUCTION => array( |
54 | - RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) {return 10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28);}, |
|
55 | - RES_ENERGY => function ($level, $production_factor, $user, $planet_row) {return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor);}, |
|
54 | + RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) {return 10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28); }, |
|
55 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor); }, |
|
56 | 56 | ), |
57 | 57 | P_MINING_IS_MANAGED => true, |
58 | 58 | ), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | 'factor' => 1.5, |
70 | 70 | ), |
71 | 71 | P_UNIT_PRODUCTION => array( |
72 | - RES_ENERGY => function ($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor);}, |
|
72 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor); }, |
|
73 | 73 | ), |
74 | 74 | P_MINING_IS_MANAGED => true, |
75 | 75 | ), |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | 'factor' => 1.8, |
88 | 88 | ), |
89 | 89 | P_UNIT_PRODUCTION => array( |
90 | - RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) {return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor);}, |
|
91 | - RES_ENERGY => function ($level, $production_factor, $user, $planet_row) {return 30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, "", TECH_ENERGY), $level) * (0.1 * $production_factor);}, |
|
90 | + RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) {return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor); }, |
|
91 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) {return 30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, "", TECH_ENERGY), $level) * (0.1 * $production_factor); }, |
|
92 | 92 | ), |
93 | 93 | P_MINING_IS_MANAGED => true, |
94 | 94 | ), |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | 'factor' => 2, |
106 | 106 | ), |
107 | 107 | 'storage' => array( |
108 | - RES_METAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);}, |
|
108 | + RES_METAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); }, |
|
109 | 109 | ), |
110 | 110 | ), |
111 | 111 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | 'factor' => 2, |
122 | 122 | ), |
123 | 123 | 'storage' => array( |
124 | - RES_CRYSTAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);}, |
|
124 | + RES_CRYSTAL => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); }, |
|
125 | 125 | ), |
126 | 126 | ), |
127 | 127 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | 'factor' => 2, |
138 | 138 | ), |
139 | 139 | 'storage' => array( |
140 | - RES_DEUTERIUM => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level);}, |
|
140 | + RES_DEUTERIUM => function($level) {return BASE_STORAGE_SIZE * pow(1.5, $level); }, |
|
141 | 141 | ), |
142 | 142 | ), |
143 | 143 |
@@ -2,25 +2,25 @@ discard block |
||
2 | 2 | |
3 | 3 | // ------------------------------------------------------------------------------------------------------------------------------ |
4 | 4 | function sn_sys_load_php_files($dir_name, $load_extension = 'php', $modules = false) { |
5 | - if(file_exists($dir_name)) { |
|
5 | + if (file_exists($dir_name)) { |
|
6 | 6 | $dir = opendir($dir_name); |
7 | - while(($file = readdir($dir)) !== false) { |
|
8 | - if($file == '..' || $file == '.') { |
|
7 | + while (($file = readdir($dir)) !== false) { |
|
8 | + if ($file == '..' || $file == '.') { |
|
9 | 9 | continue; |
10 | 10 | } |
11 | 11 | |
12 | 12 | $full_filename = $dir_name . $file; |
13 | - if($modules && is_dir($full_filename)) { |
|
14 | - if(file_exists($full_filename = "{$full_filename}/{$file}.{$load_extension}")) { |
|
13 | + if ($modules && is_dir($full_filename)) { |
|
14 | + if (file_exists($full_filename = "{$full_filename}/{$file}.{$load_extension}")) { |
|
15 | 15 | require_once($full_filename); |
16 | 16 | // Registering module |
17 | - if(class_exists($file)) { |
|
17 | + if (class_exists($file)) { |
|
18 | 18 | new $file($full_filename); |
19 | 19 | } |
20 | 20 | } |
21 | 21 | } else { |
22 | 22 | $extension = substr($full_filename, -strlen($load_extension)); |
23 | - if($extension == $load_extension) { |
|
23 | + if ($extension == $load_extension) { |
|
24 | 24 | require_once($full_filename); |
25 | 25 | } |
26 | 26 | } |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | */ |
40 | 40 | function init_update(&$config) { |
41 | 41 | $update_file = SN_ROOT_PHYSICAL . "includes/update" . DOT_PHP_EX; |
42 | - if(file_exists($update_file)) { |
|
43 | - if(filemtime($update_file) > $config->db_loadItem('var_db_update') || $config->db_loadItem('db_version') < DB_VERSION) { |
|
44 | - if(defined('IN_ADMIN')) { |
|
42 | + if (file_exists($update_file)) { |
|
43 | + if (filemtime($update_file) > $config->db_loadItem('var_db_update') || $config->db_loadItem('db_version') < DB_VERSION) { |
|
44 | + if (defined('IN_ADMIN')) { |
|
45 | 45 | sn_db_transaction_start(); // Для защиты от двойного запуска апдейта - начинаем транзакцию. Так запись в базе будет блокирована |
46 | - if(SN_TIME_NOW >= $config->db_loadItem('var_db_update_end')) { |
|
46 | + if (SN_TIME_NOW >= $config->db_loadItem('var_db_update_end')) { |
|
47 | 47 | $config->db_saveItem('var_db_update_end', SN_TIME_NOW + ($config->upd_lock_time ? $config->upd_lock_time : 300)); |
48 | 48 | sn_db_transaction_commit(); |
49 | 49 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $current_time = time(); |
54 | 54 | $config->db_saveItem('var_db_update', $current_time); |
55 | 55 | $config->db_saveItem('var_db_update_end', $current_time); |
56 | - } elseif(filemtime($update_file) > $config->var_db_update) { |
|
56 | + } elseif (filemtime($update_file) > $config->var_db_update) { |
|
57 | 57 | $timeout = $config->var_db_update_end - SN_TIME_NOW; |
58 | 58 | die( |
59 | 59 | "Обновляется база данных. Рассчетное время окончания - {$timeout} секунд (время обновления может увеличиваться). Пожалуйста, подождите...<br /> |
@@ -30,29 +30,29 @@ discard block |
||
30 | 30 | } |
31 | 31 | $size = getimagesize(SN_ROOT_PHYSICAL . $img_name); |
32 | 32 | $im = imagecreatefrompng(SN_ROOT_PHYSICAL . $img_name); |
33 | - $image = imagecreatetruecolor($size[0],$size[1]); |
|
34 | - imagecopy($image,$im,0,0,0,0,$size[0],$size[1]); |
|
33 | + $image = imagecreatetruecolor($size[0], $size[1]); |
|
34 | + imagecopy($image, $im, 0, 0, 0, 0, $size[0], $size[1]); |
|
35 | 35 | imagedestroy($im); |
36 | 36 | |
37 | 37 | // Colors |
38 | 38 | $color = "FFFFFF"; |
39 | - $red = hexdec(substr($color,0,2)); |
|
40 | - $green = hexdec(substr($color,2,4)); |
|
41 | - $blue = hexdec(substr($color,4,6)); |
|
42 | - $select = imagecolorallocate($image,$red,$green,$blue); |
|
39 | + $red = hexdec(substr($color, 0, 2)); |
|
40 | + $green = hexdec(substr($color, 2, 4)); |
|
41 | + $blue = hexdec(substr($color, 4, 6)); |
|
42 | + $select = imagecolorallocate($image, $red, $green, $blue); |
|
43 | 43 | $txt_shadow = imagecolorallocatealpha($image, 255, 255, 255, 255); |
44 | 44 | $txt_color = imagecolorallocatealpha($image, 255, 255, 255, 2); |
45 | 45 | $txt_shadow2 = imagecolorallocatealpha($image, 255, 255, 255, 255); |
46 | 46 | $txt_color2 = imagecolorallocatealpha($image, 255, 255, 255, 40); |
47 | 47 | |
48 | - $fonts = array ( |
|
48 | + $fonts = array( |
|
49 | 49 | 'userbar' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_userbar_font, |
50 | 50 | 'universe' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_banner_fontUniverse, |
51 | 51 | 'raids' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_banner_fontRaids, |
52 | 52 | 'info' => SN_ROOT_PHYSICAL . "design/fonts/" . $config->int_banner_fontInfo, |
53 | 53 | ); |
54 | 54 | |
55 | - if($id) |
|
55 | + if ($id) |
|
56 | 56 | { |
57 | 57 | // Querys |
58 | 58 | $user = db_user_by_id($id); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | $b_user = $user['username']; |
63 | 63 | $b_ally = $user['ally_name']; |
64 | 64 | $b_planet = $planet_row['name']; |
65 | - $b_xyz = "[".$planet_row['galaxy'].":".$planet_row['system'].":".$planet_row['planet']."]"; |
|
66 | - $b_lvl = ($user['total_rank'] ? $user['total_rank'] : $config->users_amount) ."/{$config->users_amount}"; |
|
65 | + $b_xyz = "[" . $planet_row['galaxy'] . ":" . $planet_row['system'] . ":" . $planet_row['planet'] . "]"; |
|
66 | + $b_lvl = ($user['total_rank'] ? $user['total_rank'] : $config->users_amount) . "/{$config->users_amount}"; |
|
67 | 67 | } |
68 | 68 | else |
69 | 69 | { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | imagettftext($image, 11, 0, 8, 26, $txt_shadow, $fonts['info'], $b_user); |
86 | 86 | imagettftext($image, 11, 0, 6, 23, $txt_color, $fonts['info'], $b_user); |
87 | 87 | |
88 | - if($id) |
|
88 | + if ($id) |
|
89 | 89 | { |
90 | 90 | // Player level - right-alligned |
91 | 91 | $is = imagettfbbox(11, 0, $fonts['info'], $b_lvl); |
@@ -94,37 +94,37 @@ discard block |
||
94 | 94 | |
95 | 95 | // Ally name |
96 | 96 | $is = imagettfbbox(9, 0, $fonts['info'], $b_ally); |
97 | - imagettftext($image, 9, 0, 412-$is[2], 37, $txt_shadow, $fonts['info'], $b_ally); |
|
98 | - imagettftext($image, 9, 0, 410-$is[2], 35, $txt_color, $fonts['info'], $b_ally); |
|
97 | + imagettftext($image, 9, 0, 412 - $is[2], 37, $txt_shadow, $fonts['info'], $b_ally); |
|
98 | + imagettftext($image, 9, 0, 410 - $is[2], 35, $txt_color, $fonts['info'], $b_ally); |
|
99 | 99 | |
100 | 100 | // Player b_planet |
101 | - imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
102 | - imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet." ".$b_xyz); |
|
101 | + imagettftext($image, 6, 0, 8, 10, $txt_shadow2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
102 | + imagettftext($image, 6, 0, 6, 9, $txt_color2, $fonts['raids'], $b_planet . " " . $b_xyz); |
|
103 | 103 | |
104 | 104 | //StatPoint |
105 | - $b_points = $lang['ov_points'].": ".pretty_number($user['total_points']); |
|
105 | + $b_points = $lang['ov_points'] . ": " . pretty_number($user['total_points']); |
|
106 | 106 | $is = imagettfbbox(8, 0, $fonts['info'], $b_points); |
107 | - imagettftext($image, 8, 0, 412-$is[2], 11, $txt_shadow, $fonts['info'], $b_points); |
|
108 | - imagettftext($image, 8, 0, 410-$is[2], 9, $txt_color, $fonts['info'], $b_points); |
|
107 | + imagettftext($image, 8, 0, 412 - $is[2], 11, $txt_shadow, $fonts['info'], $b_points); |
|
108 | + imagettftext($image, 8, 0, 410 - $is[2], 9, $txt_color, $fonts['info'], $b_points); |
|
109 | 109 | |
110 | 110 | //Raids Total |
111 | 111 | imagettftext($image, 6, 0, 8, 37, $txt_shadow2, $fonts['raids'], $lang['NumberOfRaids']); |
112 | 112 | imagettftext($image, 6, 0, 6, 35, $txt_color2, $fonts['raids'], $lang['NumberOfRaids']); |
113 | - $b_points = ": ".pretty_number($user['raids']); |
|
113 | + $b_points = ": " . pretty_number($user['raids']); |
|
114 | 114 | imagettftext($image, 6, 0, 61, 37, $txt_shadow2, $fonts['raids'], $b_points); |
115 | 115 | imagettftext($image, 6, 0, 59, 35, $txt_color2, $fonts['raids'], $b_points); |
116 | 116 | |
117 | 117 | //Raids Won |
118 | 118 | imagettftext($image, 6, 0, 8, 47, $txt_shadow2, $fonts['raids'], $lang['RaidsWin']); |
119 | 119 | imagettftext($image, 6, 0, 6, 45, $txt_color2, $fonts['raids'], $lang['RaidsWin']); |
120 | - $b_points = ": ".pretty_number($user['raidswin']); |
|
120 | + $b_points = ": " . pretty_number($user['raidswin']); |
|
121 | 121 | imagettftext($image, 6, 0, 61, 47, $txt_shadow2, $fonts['raids'], $b_points); |
122 | 122 | imagettftext($image, 6, 0, 59, 45, $txt_color2, $fonts['raids'], $b_points); |
123 | 123 | |
124 | 124 | //Raids Lost |
125 | 125 | imagettftext($image, 6, 0, 8, 57, $txt_shadow2, $fonts['raids'], $lang['RaidsLoose']); |
126 | 126 | imagettftext($image, 6, 0, 6, 55, $txt_color2, $fonts['raids'], $lang['RaidsLoose']); |
127 | - $b_points = ": ".pretty_number($user['raidsloose']); |
|
127 | + $b_points = ": " . pretty_number($user['raidsloose']); |
|
128 | 128 | imagettftext($image, 6, 0, 61, 57, $txt_shadow2, $fonts['raids'], $b_points); |
129 | 129 | imagettftext($image, 6, 0, 59, 55, $txt_color2, $fonts['raids'], $b_points); |
130 | 130 | } |
@@ -137,25 +137,25 @@ discard block |
||
137 | 137 | $is = imagettfbbox(9, 0, $fonts['userbar'], $b_univ); |
138 | 138 | $is = $size[0] - $is[2] - 2; |
139 | 139 | imagettftext($image, 9, 0, $is, $size[1] - 3, $txt_shadow, $fonts['userbar'], $b_univ); |
140 | - imagettftext($image, 9, 0, $is-1, $size[1] - 5, $txt_color, $fonts['userbar'], $b_univ); |
|
141 | - imagettftext($image, 22, 0, $is-8, $size[1], $txt_color, $fonts['userbar'], '/'); |
|
140 | + imagettftext($image, 9, 0, $is - 1, $size[1] - 5, $txt_color, $fonts['userbar'], $b_univ); |
|
141 | + imagettftext($image, 22, 0, $is - 8, $size[1], $txt_color, $fonts['userbar'], '/'); |
|
142 | 142 | |
143 | 143 | // Player name |
144 | 144 | imagettftext($image, 9, 0, 4, $size[1] - 4, $txt_shadow, $fonts['userbar'], $b_user); |
145 | 145 | imagettftext($image, 9, 0, 2, $size[1] - 6, $txt_color, $fonts['userbar'], $b_user); |
146 | 146 | |
147 | - if($id) |
|
147 | + if ($id) |
|
148 | 148 | { |
149 | 149 | // Player level - right-alligned |
150 | 150 | $isp = imagettfbbox(9, 0, $fonts['userbar'], $b_lvl); |
151 | - imagettftext($image, 9, 0, $is-$isp[2] - 10, $size[1] - 4, $txt_shadow, $fonts['userbar'], $b_lvl); |
|
152 | - imagettftext($image, 9, 0, $is-$isp[2] - 10 - 1, $size[1] - 4 - 1, $txt_color, $fonts['userbar'], $b_lvl); |
|
151 | + imagettftext($image, 9, 0, $is - $isp[2] - 10, $size[1] - 4, $txt_shadow, $fonts['userbar'], $b_lvl); |
|
152 | + imagettftext($image, 9, 0, $is - $isp[2] - 10 - 1, $size[1] - 4 - 1, $txt_color, $fonts['userbar'], $b_lvl); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | 156 | //And now convert it back to PNG-8 |
157 | - $im_result = imagecreate($size[0],$size[1]); |
|
158 | - imagecopy($im_result,$image,0,0,0,0,$size[0],$size[1]); |
|
157 | + $im_result = imagecreate($size[0], $size[1]); |
|
158 | + imagecopy($im_result, $image, 0, 0, 0, 0, $size[0], $size[1]); |
|
159 | 159 | imagedestroy($image); |
160 | 160 | //And save it |
161 | 161 | $imagetypes = imagetypes(); |