@@ -8,41 +8,41 @@ discard block |
||
8 | 8 | * [!] Wrote from scratch |
9 | 9 | */ |
10 | 10 | |
11 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
11 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
12 | 12 | |
13 | 13 | lng_include('notes'); |
14 | 14 | |
15 | 15 | $template = gettemplate('notes', true); |
16 | 16 | |
17 | 17 | $result = array(); |
18 | -if(($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) { |
|
18 | +if (($result_message = sys_get_param_str('MESSAGE')) && isset(classLocale::$lang[$result_message])) { |
|
19 | 19 | $result[] = array('STATUS' => sys_get_param_int('STATUS'), 'MESSAGE' => classLocale::$lang[$result_message]); |
20 | 20 | } |
21 | 21 | |
22 | 22 | $note_id_edit = sys_get_param_id('note_id_edit'); |
23 | -if(sys_get_param('note_delete')) { |
|
23 | +if (sys_get_param('note_delete')) { |
|
24 | 24 | try { |
25 | 25 | $not = ''; |
26 | 26 | $query_where = ''; |
27 | - switch(sys_get_param_str('note_delete_range')) { |
|
27 | + switch (sys_get_param_str('note_delete_range')) { |
|
28 | 28 | case 'all': |
29 | 29 | break; |
30 | 30 | |
31 | 31 | case 'marked_not': |
32 | 32 | $not = 'NOT'; |
33 | 33 | case 'marked': |
34 | - if(!is_array($notes_marked = sys_get_param('note'))) { |
|
34 | + if (!is_array($notes_marked = sys_get_param('note'))) { |
|
35 | 35 | throw new Exception('note_err_none_selected', ERR_WARNING); |
36 | 36 | } |
37 | 37 | |
38 | 38 | $notes_marked_filtered = array(); |
39 | - foreach($notes_marked as $note_id => $note_select) { |
|
40 | - if($note_select == 'on' && $note_id = idval($note_id)) { |
|
39 | + foreach ($notes_marked as $note_id => $note_select) { |
|
40 | + if ($note_select == 'on' && $note_id = idval($note_id)) { |
|
41 | 41 | $notes_marked_filtered[] = $note_id; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | - if(empty($notes_marked_filtered)) { |
|
45 | + if (empty($notes_marked_filtered)) { |
|
46 | 46 | throw new Exception('note_err_none_selected', ERR_WARNING); |
47 | 47 | } |
48 | 48 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | db_note_list_delete($user, $query_where); |
60 | 60 | sn_db_transaction_commit(); |
61 | 61 | throw new Exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE); |
62 | - } catch(Exception $e) { |
|
62 | + } catch (Exception $e) { |
|
63 | 63 | $note_id_edit = 0; |
64 | 64 | sn_db_transaction_rollback(); |
65 | 65 | $result[] = array( |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | 'MESSAGE' => classLocale::$lang[$e->getMessage()], |
68 | 68 | ); |
69 | 69 | } |
70 | -} elseif(($note_title = sys_get_param_str('note_title')) || ($note_text = sys_get_param_str('note_text'))) { |
|
70 | +} elseif (($note_title = sys_get_param_str('note_title')) || ($note_text = sys_get_param_str('note_text'))) { |
|
71 | 71 | $note_title == db_escape(classLocale::$lang['note_new_title']) ? $note_title = '' : false; |
72 | 72 | ($note_text = sys_get_param_str('note_text')) == db_escape(classLocale::$lang['note_new_text']) ? $note_text = '' : false; |
73 | 73 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $note_system = max(0, min(sys_get_param_id('note_system'), Vector::$knownSystems)); |
77 | 77 | $note_planet = max(0, min(sys_get_param_id('note_planet'), Vector::$knownPlanets + 1)); |
78 | 78 | |
79 | - if(!$note_text && !$note_title && !$note_galaxy && !$note_system && !$note_planet) { |
|
79 | + if (!$note_text && !$note_title && !$note_galaxy && !$note_system && !$note_planet) { |
|
80 | 80 | throw new exception('note_err_note_empty', ERR_WARNING); |
81 | 81 | } |
82 | 82 | |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | $note_sticky = intval(sys_get_param_id('note_sticky')) ? 1 : 0; |
86 | 86 | |
87 | 87 | sn_db_transaction_start(); |
88 | - if($note_id_edit) { |
|
88 | + if ($note_id_edit) { |
|
89 | 89 | $check_note_id = db_note_get_id_and_owner($note_id_edit); |
90 | - if(!$check_note_id) { |
|
90 | + if (!$check_note_id) { |
|
91 | 91 | throw new Exception('note_err_note_not_found', ERR_ERROR); |
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
95 | - if($note_id_edit) { |
|
96 | - if($check_note_id['owner'] != $user['id']) { |
|
95 | + if ($note_id_edit) { |
|
96 | + if ($check_note_id['owner'] != $user['id']) { |
|
97 | 97 | throw new Exception('note_err_owner_wrong', ERR_ERROR); |
98 | 98 | } |
99 | 99 | |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | } |
104 | 104 | |
105 | 105 | sn_db_transaction_commit(); |
106 | - sys_redirect('notes.php?STATUS=' . ERR_NONE . '&MESSAGE=' . ($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added')); |
|
106 | + sys_redirect('notes.php?STATUS='.ERR_NONE.'&MESSAGE='.($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added')); |
|
107 | 107 | // throw new exception($note_id_edit ? 'note_err_none_changed' : 'note_err_none_added', ERR_NONE); |
108 | - } catch(Exception $e) { |
|
108 | + } catch (Exception $e) { |
|
109 | 109 | $note_id_edit = 0; |
110 | 110 | sn_db_transaction_rollback(); |
111 | 111 | $result[] = array( |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | -if(!$note_id_edit) { |
|
118 | +if (!$note_id_edit) { |
|
119 | 119 | note_assign($template, array( |
120 | 120 | 'id' => 0, |
121 | 121 | 'time' => SN_TIME_NOW, |
@@ -128,13 +128,13 @@ discard block |
||
128 | 128 | |
129 | 129 | $note_exist = false; |
130 | 130 | $notes_query = db_note_list_by_owner($user['id']); |
131 | -while($note_row = db_fetch($notes_query)) { |
|
131 | +while ($note_row = db_fetch($notes_query)) { |
|
132 | 132 | note_assign($template, $note_row); |
133 | 133 | $note_exist = $note_exist || $note_row['id'] == $note_id_edit; |
134 | 134 | } |
135 | 135 | $note_id_edit = $note_exist ? $note_id_edit : 0; |
136 | 136 | |
137 | -foreach($note_priority_classes as $note_priority_id => $note_priority_class) { |
|
137 | +foreach ($note_priority_classes as $note_priority_id => $note_priority_class) { |
|
138 | 138 | $template->assign_block_vars('note_priority', array( |
139 | 139 | 'ID' => $note_priority_id, |
140 | 140 | 'CLASS' => $note_priority_classes[$note_priority_id], |
@@ -142,14 +142,14 @@ discard block |
||
142 | 142 | )); |
143 | 143 | } |
144 | 144 | |
145 | -foreach(classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) { |
|
145 | +foreach (classLocale::$lang['sys_planet_type'] as $planet_type_id => $planet_type_string) { |
|
146 | 146 | $template->assign_block_vars('planet_type', array( |
147 | 147 | 'ID' => $planet_type_id, |
148 | 148 | 'TEXT' => $planet_type_string, |
149 | 149 | )); |
150 | 150 | } |
151 | 151 | |
152 | -foreach($result as $result_data) { |
|
152 | +foreach ($result as $result_data) { |
|
153 | 153 | $template->assign_block_vars('result', $result_data); |
154 | 154 | } |
155 | 155 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * v1 (c) copyright 2010 by Gorlum for http://supernova.ws |
9 | 9 | */ |
10 | 10 | |
11 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
11 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
12 | 12 | |
13 | 13 | lng_include('affilates'); |
14 | 14 | |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | $gained += $affilate_gain; |
33 | 33 | } |
34 | 34 | |
35 | -$bannerURL = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_banner_URL; |
|
35 | +$bannerURL = SN_ROOT_VIRTUAL_PARENT.classSupernova::$config->int_banner_URL; |
|
36 | 36 | $bannerURL .= strpos($bannerURL, '?') ? '&' : '?'; |
37 | 37 | $bannerURL .= "id={$user['id']}"; |
38 | 38 | |
39 | -$userbarURL = SN_ROOT_VIRTUAL_PARENT . classSupernova::$config->int_userbar_URL; |
|
39 | +$userbarURL = SN_ROOT_VIRTUAL_PARENT.classSupernova::$config->int_userbar_URL; |
|
40 | 40 | $userbarURL .= strpos($userbarURL, '?') ? '&' : '?'; |
41 | 41 | $userbarURL .= "id={$user['id']}"; |
42 | 42 |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | * @copyright 2008 by ??????? for XNova |
11 | 11 | */ |
12 | 12 | |
13 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
13 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
14 | 14 | |
15 | -if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
15 | +if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
16 | 16 | message(classLocale::$lang['sys_blitz_page_disabled'], classLocale::$lang['sys_error'], 'overview.php', 10); |
17 | 17 | die(); |
18 | 18 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | $template = gettemplate('search', true); |
27 | 27 | |
28 | -if($searchtext && $type) { |
|
29 | - switch($type) { |
|
28 | +if ($searchtext && $type) { |
|
29 | + switch ($type) { |
|
30 | 30 | case "planetname": |
31 | 31 | // $search = db_planet_list_search($searchtext); |
32 | 32 | break; |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | break; |
42 | 42 | } |
43 | 43 | |
44 | - while($row = db_fetch($search)) { |
|
45 | - if($type == 'playername' || $type == 'planetname') { |
|
44 | + while ($row = db_fetch($search)) { |
|
45 | + if ($type == 'playername' || $type == 'planetname') { |
|
46 | 46 | $template->assign_block_vars('search_result', array( |
47 | 47 | 'PLAYER_ID' => $row['uid'], |
48 | 48 | 'PLAYER_NAME' => htmlentities($row['username'], ENT_COMPAT, 'UTF-8'), |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
58 | 58 | 'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'), |
59 | 59 | )); |
60 | - } elseif($type == 'ally') { |
|
60 | + } elseif ($type == 'ally') { |
|
61 | 61 | $template->assign_block_vars('search_result', array( |
62 | 62 | 'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'), |
63 | 63 | 'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'), |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'ally' => 'sys_alliance', |
76 | 76 | ); |
77 | 77 | |
78 | -foreach($search_type as $type_id => $type_lang) { |
|
78 | +foreach ($search_type as $type_id => $type_lang) { |
|
79 | 79 | $template->assign_block_vars('type', array( |
80 | 80 | 'ID' => $type_id, |
81 | 81 | 'TEXT' => classLocale::$lang[$type_lang], |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include_once('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | -if(sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) { |
|
5 | +if (sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) { |
|
6 | 6 | sys_redirect('metamatter.php'); |
7 | 7 | } |
8 | 8 |
@@ -7,10 +7,10 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | 12 | |
13 | -require('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
13 | +require('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
14 | 14 | |
15 | 15 | lng_include('quest'); |
16 | 16 | $template = gettemplate('quest', true); |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | define('SN_IN_FLEET', true); |
4 | 4 | define('SN_RENDER_NAVBAR_PLANET', true); |
5 | 5 | |
6 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
6 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
7 | 7 | |
8 | 8 | // TODO - Переместить это куда-нибудь |
9 | 9 | $fleet_page = sys_get_param_int('fleet_page', sys_get_param_int('mode')); |
10 | -if($fleet_ship_sort = sys_get_param_id('sort_elements') && $fleet_page == 0) { |
|
10 | +if ($fleet_ship_sort = sys_get_param_id('sort_elements') && $fleet_page == 0) { |
|
11 | 11 | define('IN_AJAX', true); |
12 | - if(!empty(classLocale::$lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) { |
|
12 | + if (!empty(classLocale::$lang['player_option_fleet_ship_sort'][$fleet_ship_sort])) { |
|
13 | 13 | classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT] = $fleet_ship_sort; |
14 | 14 | classSupernova::$user_options[PLAYER_OPTION_FLEET_SHIP_SORT_INVERSE] = sys_get_param_id('sort_elements_inverse', 0); |
15 | 15 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $objFleet5->initDefaults($user, $planetrow, $targetVector, $target_mission, $ships, $fleet_group_mr, $speed_percent, 0, $captainId, $resources); |
46 | 46 | |
47 | 47 | |
48 | -switch($fleet_page) { |
|
48 | +switch ($fleet_page) { |
|
49 | 49 | case 1: |
50 | 50 | $objFleet5->fleetPage1(); |
51 | 51 | break; |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
3 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
4 | 4 | |
5 | -if(classSupernova::$config->game_mode == GAME_BLITZ) { |
|
5 | +if (classSupernova::$config->game_mode == GAME_BLITZ) { |
|
6 | 6 | message(classLocale::$lang['sys_blitz_page_disabled'], classLocale::$lang['sys_error'], 'overview.php', 10); |
7 | 7 | die(); |
8 | 8 | } |
@@ -14,16 +14,16 @@ discard block |
||
14 | 14 | |
15 | 15 | $mode = sys_get_param_str('mode'); |
16 | 16 | |
17 | -if($mode == 'ainfo') { |
|
17 | +if ($mode == 'ainfo') { |
|
18 | 18 | include('includes/alliance/ali_info.inc'); |
19 | 19 | } |
20 | 20 | |
21 | -if(!$user['ally_id']) { |
|
21 | +if (!$user['ally_id']) { |
|
22 | 22 | $user_request = db_ally_request_get_by_user_id($user['id']); |
23 | - if($user_request['id_user']) { |
|
23 | + if ($user_request['id_user']) { |
|
24 | 24 | require('includes/alliance/ali_external_request.inc'); |
25 | 25 | } else { |
26 | - switch($mode) { |
|
26 | + switch ($mode) { |
|
27 | 27 | case 'search': |
28 | 28 | require('includes/alliance/ali_external_search.inc'); |
29 | 29 | break; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | sn_ali_fill_user_ally($user); |
47 | -if(!isset($user['ally'])) { |
|
47 | +if (!isset($user['ally'])) { |
|
48 | 48 | db_user_set_by_id($user['id'], "`ally_id` = null, `ally_name` = null, `ally_register_time` = 0, `ally_rank_id` = 0"); |
49 | 49 | message(classLocale::$lang['ali_sys_notFound'], classLocale::$lang['your_alliance'], 'alliance.php'); |
50 | 50 | } |
@@ -72,18 +72,18 @@ discard block |
||
72 | 72 | |
73 | 73 | // This piece converting old ally data to new one |
74 | 74 | // unset($ally['ranklist']); |
75 | -if(!$ally['ranklist'] && $ally['ally_ranks']) { |
|
75 | +if (!$ally['ranklist'] && $ally['ally_ranks']) { |
|
76 | 76 | $ally_ranks = unserialize($ally['ally_ranks']); |
77 | 77 | $i = 0; |
78 | - foreach($ally_ranks as $rank_id => $rank) { |
|
79 | - foreach($ally_rights as $key => $value) { |
|
78 | + foreach ($ally_ranks as $rank_id => $rank) { |
|
79 | + foreach ($ally_rights as $key => $value) { |
|
80 | 80 | $ranks[$i][$value] = $rank[$rights_old[$key]]; |
81 | 81 | } |
82 | 82 | db_user_list_set_ally_deprecated_convert_ranks($user['ally_id'], $i, $rank_id); |
83 | 83 | $i++; |
84 | 84 | } |
85 | 85 | |
86 | - if(!empty($ranks)) { |
|
86 | + if (!empty($ranks)) { |
|
87 | 87 | ali_rank_list_save($ranks); |
88 | 88 | } |
89 | 89 | } |
@@ -101,15 +101,15 @@ discard block |
||
101 | 101 | |
102 | 102 | $edit = sys_get_param_str('edit'); |
103 | 103 | ally_pre_call(); |
104 | -switch($mode) { |
|
104 | +switch ($mode) { |
|
105 | 105 | case 'admin': |
106 | - if(!array_key_exists($edit, $sn_ali_admin_internal)) { |
|
106 | + if (!array_key_exists($edit, $sn_ali_admin_internal)) { |
|
107 | 107 | $edit = 'default'; |
108 | 108 | } |
109 | - if($sn_ali_admin_internal[$edit]['include']) { |
|
109 | + if ($sn_ali_admin_internal[$edit]['include']) { |
|
110 | 110 | require("includes/{$sn_ali_admin_internal[$edit]['include']}"); |
111 | 111 | } |
112 | - if(isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function'])) { |
|
112 | + if (isset($sn_ali_admin_internal[$edit]['function']) && is_callable($sn_ali_admin_internal[$edit]['function'])) { |
|
113 | 113 | call_user_func($sn_ali_admin_internal[$edit]['function']); |
114 | 114 | } |
115 | 115 | break; |
@@ -36,65 +36,65 @@ discard block |
||
36 | 36 | * |
37 | 37 | */ |
38 | 38 | |
39 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
39 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
40 | 40 | |
41 | 41 | lng_include('messages'); |
42 | 42 | |
43 | 43 | $mode = sys_get_param_str('msg_delete') ? 'delete' : sys_get_param_str('mode'); |
44 | 44 | $current_class = sys_get_param_int('message_class'); |
45 | -if(!isset($sn_message_class_list[$current_class])) { |
|
45 | +if (!isset($sn_message_class_list[$current_class])) { |
|
46 | 46 | $current_class = 0; |
47 | 47 | $mode = ''; |
48 | 48 | } |
49 | 49 | |
50 | -switch($mode) { |
|
50 | +switch ($mode) { |
|
51 | 51 | case 'write': |
52 | 52 | $error_list = array(); |
53 | 53 | $template = gettemplate('msg_message_compose', true); |
54 | 54 | |
55 | 55 | $recipient_name = sys_get_param_str_unsafe('recipient_name'); |
56 | - if($recipient_name) { |
|
56 | + if ($recipient_name) { |
|
57 | 57 | $recipient_row = db_user_by_username($recipient_name); |
58 | 58 | } |
59 | 59 | |
60 | - if(!$recipient_row) { |
|
60 | + if (!$recipient_row) { |
|
61 | 61 | $recipient_id = sys_get_param_id('id'); |
62 | 62 | $recipient_row = db_user_by_id($recipient_id); |
63 | - if(!$recipient_row) { |
|
63 | + if (!$recipient_row) { |
|
64 | 64 | $recipient_id = 0; |
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | - if($recipient_row) { |
|
68 | + if ($recipient_row) { |
|
69 | 69 | $recipient_id = $recipient_row['id']; |
70 | 70 | $recipient_name = $recipient_row['username']; |
71 | 71 | } |
72 | 72 | |
73 | - if($recipient_id == $user['id']) { |
|
73 | + if ($recipient_id == $user['id']) { |
|
74 | 74 | $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_self_send'], 'STATUS' => ERR_ERROR); |
75 | 75 | } |
76 | 76 | |
77 | 77 | $re = 0; |
78 | 78 | $subject = sys_get_param_str('subject'); |
79 | - while(strpos($subject, classLocale::$lang['msg_answer_prefix']) !== false) { |
|
79 | + while (strpos($subject, classLocale::$lang['msg_answer_prefix']) !== false) { |
|
80 | 80 | $subject = substr($subject, strlen(classLocale::$lang['msg_answer_prefix'])); |
81 | 81 | $re++; |
82 | 82 | } |
83 | - $re ? $subject = classLocale::$lang['msg_answer_prefix'] . $subject : false; |
|
83 | + $re ? $subject = classLocale::$lang['msg_answer_prefix'].$subject : false; |
|
84 | 84 | |
85 | - if(sys_get_param_str('msg_send')) { |
|
85 | + if (sys_get_param_str('msg_send')) { |
|
86 | 86 | $subject = $subject ? $subject : classLocale::$lang['msg_subject_default']; |
87 | 87 | |
88 | - if(!$recipient_id) { |
|
88 | + if (!$recipient_id) { |
|
89 | 89 | $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_player_not_found'], 'STATUS' => ERR_ERROR); |
90 | 90 | } |
91 | 91 | |
92 | 92 | $text = sys_get_param_str('text'); |
93 | - if(!$text) { |
|
93 | + if (!$text) { |
|
94 | 94 | $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_no_text'], 'STATUS' => ERR_ERROR); |
95 | 95 | } |
96 | 96 | |
97 | - if(empty($error_list)) { |
|
97 | + if (empty($error_list)) { |
|
98 | 98 | $error_list[] = array('MESSAGE' => classLocale::$lang['msg_not_message_sent'], 'STATUS' => ERR_NONE); |
99 | 99 | |
100 | 100 | $user_safe_name = db_escape($user['username']); |
@@ -123,12 +123,12 @@ discard block |
||
123 | 123 | 'TEXT' => htmlspecialchars($text), |
124 | 124 | )); |
125 | 125 | |
126 | - foreach($error_list as $error_message) { |
|
126 | + foreach ($error_list as $error_message) { |
|
127 | 127 | $template->assign_block_vars('result', $error_message); |
128 | 128 | } |
129 | 129 | |
130 | 130 | $message_query = db_message_list_get_last_20($user, $recipient_id); |
131 | - while($message_row = db_fetch($message_query)) { |
|
131 | + while ($message_row = db_fetch($message_query)) { |
|
132 | 132 | $template->assign_block_vars('messages', array( |
133 | 133 | 'ID' => $message_row['message_id'], |
134 | 134 | 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
@@ -147,25 +147,25 @@ discard block |
||
147 | 147 | |
148 | 148 | $message_range = sys_get_param_str('message_range'); |
149 | 149 | |
150 | - switch($message_range) { |
|
150 | + switch ($message_range) { |
|
151 | 151 | case 'unchecked': |
152 | 152 | case 'checked': |
153 | 153 | $marked_message_list = sys_get_param('mark', array()); |
154 | - if($message_range == 'checked' && empty($marked_message_list)) { |
|
154 | + if ($message_range == 'checked' && empty($marked_message_list)) { |
|
155 | 155 | break; |
156 | 156 | } |
157 | 157 | |
158 | 158 | $query_add = implode(',', $marked_message_list); |
159 | - if($query_add) { |
|
159 | + if ($query_add) { |
|
160 | 160 | $query_add = "IN ({$query_add})"; |
161 | - if($message_range == 'unchecked') { |
|
161 | + if ($message_range == 'unchecked') { |
|
162 | 162 | $query_add = "NOT {$query_add}"; |
163 | 163 | } |
164 | 164 | $query_add = " AND `message_id` {$query_add}"; |
165 | 165 | } |
166 | 166 | |
167 | 167 | case 'class': |
168 | - if($current_class != MSG_TYPE_OUTBOX && $current_class != MSG_TYPE_NEW) { |
|
168 | + if ($current_class != MSG_TYPE_OUTBOX && $current_class != MSG_TYPE_NEW) { |
|
169 | 169 | $query_add .= " AND `message_type` = {$current_class}"; |
170 | 170 | } |
171 | 171 | case 'all': |
@@ -173,19 +173,19 @@ discard block |
||
173 | 173 | break; |
174 | 174 | } |
175 | 175 | |
176 | - if($query_add) { |
|
176 | + if ($query_add) { |
|
177 | 177 | $query_add = $query_add === true ? '' : $query_add; |
178 | 178 | db_message_list_delete($user, $query_add); |
179 | 179 | } |
180 | 180 | |
181 | 181 | case 'show': |
182 | - if($current_class == MSG_TYPE_OUTBOX) { |
|
182 | + if ($current_class == MSG_TYPE_OUTBOX) { |
|
183 | 183 | $message_query = db_message_list_outbox_by_user_id($user['id']); |
184 | 184 | } else { |
185 | - if($current_class == MSG_TYPE_NEW) { |
|
185 | + if ($current_class == MSG_TYPE_NEW) { |
|
186 | 186 | $SubUpdateQry = array(); |
187 | - foreach($sn_message_class_list as $message_class_id => $message_class) { |
|
188 | - if($message_class_id != MSG_TYPE_OUTBOX) { |
|
187 | + foreach ($sn_message_class_list as $message_class_id => $message_class) { |
|
188 | + if ($message_class_id != MSG_TYPE_OUTBOX) { |
|
189 | 189 | $SubUpdateQry[] = "`{$message_class['name']}` = '0'"; |
190 | 190 | $user[$message_class['name']] = 0; |
191 | 191 | } |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | $message_query = db_message_list_by_owner_and_string($user, $SubSelectQry); |
204 | 204 | } |
205 | 205 | |
206 | - if(sys_get_param_int('return')) { |
|
206 | + if (sys_get_param_int('return')) { |
|
207 | 207 | header('Location: messages.php'); |
208 | 208 | die(); |
209 | 209 | } |
210 | 210 | |
211 | 211 | $template = gettemplate('msg_message_list', true); |
212 | - while($message_row = db_fetch($message_query)) { |
|
212 | + while ($message_row = db_fetch($message_query)) { |
|
213 | 213 | $template->assign_block_vars('messages', array( |
214 | 214 | 'ID' => $message_row['message_id'], |
215 | 215 | 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
@@ -232,18 +232,18 @@ discard block |
||
232 | 232 | break; |
233 | 233 | } |
234 | 234 | |
235 | -if(!$template) { |
|
235 | +if (!$template) { |
|
236 | 236 | $template = gettemplate('msg_message_class', true); |
237 | 237 | |
238 | 238 | $query = db_message_count_by_owner_and_type($user); |
239 | - while($message_row = db_fetch($query)) { |
|
239 | + while ($message_row = db_fetch($query)) { |
|
240 | 240 | $messages_total[$message_row['message_type']] = $message_row['message_count']; |
241 | 241 | $messages_total[MSG_TYPE_NEW] += $message_row['message_count']; |
242 | 242 | } |
243 | 243 | |
244 | 244 | $messages_total[MSG_TYPE_OUTBOX] = db_message_count_outbox($user); |
245 | 245 | |
246 | - foreach($sn_message_class_list as $message_class_id => $message_class) { |
|
246 | + foreach ($sn_message_class_list as $message_class_id => $message_class) { |
|
247 | 247 | $template->assign_block_vars('message_class', array( |
248 | 248 | 'ID' => $message_class_id, |
249 | 249 | 'STYLE' => $message_class['name'], |
@@ -48,106 +48,106 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | switch($mode) { |
51 | - case 'write': |
|
52 | - $error_list = array(); |
|
53 | - $template = gettemplate('msg_message_compose', true); |
|
51 | + case 'write': |
|
52 | + $error_list = array(); |
|
53 | + $template = gettemplate('msg_message_compose', true); |
|
54 | 54 | |
55 | - $recipient_name = sys_get_param_str_unsafe('recipient_name'); |
|
56 | - if($recipient_name) { |
|
57 | - $recipient_row = DBStaticUser::db_user_by_username($recipient_name); |
|
58 | - } |
|
55 | + $recipient_name = sys_get_param_str_unsafe('recipient_name'); |
|
56 | + if($recipient_name) { |
|
57 | + $recipient_row = DBStaticUser::db_user_by_username($recipient_name); |
|
58 | + } |
|
59 | 59 | |
60 | - if(!$recipient_row) { |
|
61 | - $recipient_id = sys_get_param_id('id'); |
|
62 | - $recipient_row = DBStaticUser::db_user_by_id($recipient_id); |
|
63 | 60 | if(!$recipient_row) { |
64 | - $recipient_id = 0; |
|
61 | + $recipient_id = sys_get_param_id('id'); |
|
62 | + $recipient_row = DBStaticUser::db_user_by_id($recipient_id); |
|
63 | + if(!$recipient_row) { |
|
64 | + $recipient_id = 0; |
|
65 | + } |
|
65 | 66 | } |
66 | - } |
|
67 | - |
|
68 | - if($recipient_row) { |
|
69 | - $recipient_id = $recipient_row['id']; |
|
70 | - $recipient_name = $recipient_row['username']; |
|
71 | - } |
|
72 | - |
|
73 | - if($recipient_id == $user['id']) { |
|
74 | - $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_self_send'], 'STATUS' => ERR_ERROR); |
|
75 | - } |
|
76 | - |
|
77 | - $re = 0; |
|
78 | - $subject = sys_get_param_str('subject'); |
|
79 | - while(strpos($subject, classLocale::$lang['msg_answer_prefix']) !== false) { |
|
80 | - $subject = substr($subject, strlen(classLocale::$lang['msg_answer_prefix'])); |
|
81 | - $re++; |
|
82 | - } |
|
83 | - $re ? $subject = classLocale::$lang['msg_answer_prefix'] . $subject : false; |
|
84 | 67 | |
85 | - if(sys_get_param_str('msg_send')) { |
|
86 | - $subject = $subject ? $subject : classLocale::$lang['msg_subject_default']; |
|
68 | + if($recipient_row) { |
|
69 | + $recipient_id = $recipient_row['id']; |
|
70 | + $recipient_name = $recipient_row['username']; |
|
71 | + } |
|
87 | 72 | |
88 | - if(!$recipient_id) { |
|
89 | - $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_player_not_found'], 'STATUS' => ERR_ERROR); |
|
73 | + if($recipient_id == $user['id']) { |
|
74 | + $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_self_send'], 'STATUS' => ERR_ERROR); |
|
90 | 75 | } |
91 | 76 | |
92 | - $text = sys_get_param_str('text'); |
|
93 | - if(!$text) { |
|
94 | - $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_no_text'], 'STATUS' => ERR_ERROR); |
|
77 | + $re = 0; |
|
78 | + $subject = sys_get_param_str('subject'); |
|
79 | + while(strpos($subject, classLocale::$lang['msg_answer_prefix']) !== false) { |
|
80 | + $subject = substr($subject, strlen(classLocale::$lang['msg_answer_prefix'])); |
|
81 | + $re++; |
|
95 | 82 | } |
83 | + $re ? $subject = classLocale::$lang['msg_answer_prefix'] . $subject : false; |
|
96 | 84 | |
97 | - if(empty($error_list)) { |
|
98 | - $error_list[] = array('MESSAGE' => classLocale::$lang['msg_not_message_sent'], 'STATUS' => ERR_NONE); |
|
85 | + if(sys_get_param_str('msg_send')) { |
|
86 | + $subject = $subject ? $subject : classLocale::$lang['msg_subject_default']; |
|
99 | 87 | |
100 | - $user_safe_name = db_escape($user['username']); |
|
101 | - $recipient_name = db_escape($recipient_name); |
|
102 | - msg_send_simple_message($recipient_id, $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, "{$user_safe_name} [{$user['galaxy']}:{$user['system']}:{$user['planet']}]", $subject, $text, true); |
|
88 | + if(!$recipient_id) { |
|
89 | + $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_player_not_found'], 'STATUS' => ERR_ERROR); |
|
90 | + } |
|
103 | 91 | |
104 | - //$recipient_id = 0; |
|
105 | - //$recipient_name = ''; |
|
106 | - //$subject = ''; |
|
107 | - $text = ''; |
|
92 | + $text = sys_get_param_str('text'); |
|
93 | + if(!$text) { |
|
94 | + $error_list[] = array('MESSAGE' => classLocale::$lang['msg_err_no_text'], 'STATUS' => ERR_ERROR); |
|
95 | + } |
|
108 | 96 | |
109 | - $msg_sent = true; |
|
110 | - } else { |
|
111 | - $subject = sys_get_param_str_unsafe('subject'); |
|
112 | - $text = sys_get_param_str_unsafe('text'); |
|
113 | - } |
|
114 | - $recipient_name = sys_get_param_str_unsafe('recipient_name'); |
|
115 | - } |
|
97 | + if(empty($error_list)) { |
|
98 | + $error_list[] = array('MESSAGE' => classLocale::$lang['msg_not_message_sent'], 'STATUS' => ERR_NONE); |
|
116 | 99 | |
117 | - $subject = $subject ? $subject : classLocale::$lang['msg_subject_default']; |
|
100 | + $user_safe_name = db_escape($user['username']); |
|
101 | + $recipient_name = db_escape($recipient_name); |
|
102 | + msg_send_simple_message($recipient_id, $user['id'], SN_TIME_NOW, MSG_TYPE_PLAYER, "{$user_safe_name} [{$user['galaxy']}:{$user['system']}:{$user['planet']}]", $subject, $text, true); |
|
118 | 103 | |
119 | - $template->assign_vars(array( |
|
120 | - 'RECIPIENT_ID' => $recipient_id, |
|
121 | - 'RECIPIENT_NAME' => htmlspecialchars($recipient_name), |
|
122 | - 'SUBJECT' => htmlspecialchars($subject), |
|
123 | - 'TEXT' => htmlspecialchars($text), |
|
124 | - )); |
|
104 | + //$recipient_id = 0; |
|
105 | + //$recipient_name = ''; |
|
106 | + //$subject = ''; |
|
107 | + $text = ''; |
|
125 | 108 | |
126 | - foreach($error_list as $error_message) { |
|
127 | - $template->assign_block_vars('result', $error_message); |
|
128 | - } |
|
109 | + $msg_sent = true; |
|
110 | + } else { |
|
111 | + $subject = sys_get_param_str_unsafe('subject'); |
|
112 | + $text = sys_get_param_str_unsafe('text'); |
|
113 | + } |
|
114 | + $recipient_name = sys_get_param_str_unsafe('recipient_name'); |
|
115 | + } |
|
129 | 116 | |
130 | - $message_query = DBStaticMessages::db_message_list_get_last_20($user, $recipient_id); |
|
131 | - while($message_row = db_fetch($message_query)) { |
|
132 | - $template->assign_block_vars('messages', array( |
|
133 | - 'ID' => $message_row['message_id'], |
|
134 | - 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
135 | - 'FROM' => htmlspecialchars($message_row['message_from']), |
|
136 | - 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
137 | - 'TEXT' => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']), |
|
117 | + $subject = $subject ? $subject : classLocale::$lang['msg_subject_default']; |
|
138 | 118 | |
139 | - 'FROM_ID' => $message_row['message_sender'], |
|
119 | + $template->assign_vars(array( |
|
120 | + 'RECIPIENT_ID' => $recipient_id, |
|
121 | + 'RECIPIENT_NAME' => htmlspecialchars($recipient_name), |
|
122 | + 'SUBJECT' => htmlspecialchars($subject), |
|
123 | + 'TEXT' => htmlspecialchars($text), |
|
140 | 124 | )); |
141 | - } |
|
142 | 125 | |
143 | - break; |
|
126 | + foreach($error_list as $error_message) { |
|
127 | + $template->assign_block_vars('result', $error_message); |
|
128 | + } |
|
129 | + |
|
130 | + $message_query = DBStaticMessages::db_message_list_get_last_20($user, $recipient_id); |
|
131 | + while($message_row = db_fetch($message_query)) { |
|
132 | + $template->assign_block_vars('messages', array( |
|
133 | + 'ID' => $message_row['message_id'], |
|
134 | + 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
135 | + 'FROM' => htmlspecialchars($message_row['message_from']), |
|
136 | + 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
137 | + 'TEXT' => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']), |
|
138 | + |
|
139 | + 'FROM_ID' => $message_row['message_sender'], |
|
140 | + )); |
|
141 | + } |
|
144 | 142 | |
145 | - case 'delete': |
|
146 | - $query_add = ''; |
|
143 | + break; |
|
147 | 144 | |
148 | - $message_range = sys_get_param_str('message_range'); |
|
145 | + case 'delete': |
|
146 | + $query_add = ''; |
|
149 | 147 | |
150 | - switch($message_range) { |
|
148 | + $message_range = sys_get_param_str('message_range'); |
|
149 | + |
|
150 | + switch($message_range) { |
|
151 | 151 | case 'unchecked': |
152 | 152 | case 'checked': |
153 | 153 | $marked_message_list = sys_get_param('mark', array()); |
@@ -171,65 +171,65 @@ discard block |
||
171 | 171 | case 'all': |
172 | 172 | $query_add = $query_add ? $query_add : true; |
173 | 173 | break; |
174 | - } |
|
174 | + } |
|
175 | 175 | |
176 | 176 | if($query_add) { |
177 | 177 | $query_add = $query_add === true ? '' : $query_add; |
178 | 178 | DBStaticMessages::db_message_list_delete($user, $query_add); |
179 | 179 | } |
180 | 180 | |
181 | - case 'show': |
|
182 | - if($current_class == MSG_TYPE_OUTBOX) { |
|
183 | - $message_query = DBStaticMessages::db_message_list_outbox_by_user_id($user['id']); |
|
184 | - } else { |
|
185 | - if($current_class == MSG_TYPE_NEW) { |
|
186 | - $SubUpdateQry = array(); |
|
187 | - foreach($sn_message_class_list as $message_class_id => $message_class) { |
|
188 | - if($message_class_id != MSG_TYPE_OUTBOX) { |
|
189 | - $SubUpdateQry[] = "`{$message_class['name']}` = '0'"; |
|
190 | - $user[$message_class['name']] = 0; |
|
181 | + case 'show': |
|
182 | + if($current_class == MSG_TYPE_OUTBOX) { |
|
183 | + $message_query = DBStaticMessages::db_message_list_outbox_by_user_id($user['id']); |
|
184 | + } else { |
|
185 | + if($current_class == MSG_TYPE_NEW) { |
|
186 | + $SubUpdateQry = array(); |
|
187 | + foreach($sn_message_class_list as $message_class_id => $message_class) { |
|
188 | + if($message_class_id != MSG_TYPE_OUTBOX) { |
|
189 | + $SubUpdateQry[] = "`{$message_class['name']}` = '0'"; |
|
190 | + $user[$message_class['name']] = 0; |
|
191 | + } |
|
191 | 192 | } |
193 | + $SubUpdateQry = implode(',', $SubUpdateQry); |
|
194 | + } else { |
|
195 | + $SubUpdateQry = "`{$sn_message_class_list[$current_class]['name']}` = '0', `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` = `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` - '{$user[$sn_message_class_list[$current_class]['name']]}'"; |
|
196 | + $SubSelectQry = "AND `message_type` = '{$current_class}'"; |
|
197 | + |
|
198 | + $user[$sn_message_class_list[MSG_TYPE_NEW]['name']] -= $user[$sn_message_class_list[$current_class]['name']]; |
|
199 | + $user[$sn_message_class_list[$current_class]['name']] = 0; |
|
192 | 200 | } |
193 | - $SubUpdateQry = implode(',', $SubUpdateQry); |
|
194 | - } else { |
|
195 | - $SubUpdateQry = "`{$sn_message_class_list[$current_class]['name']}` = '0', `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` = `{$sn_message_class_list[MSG_TYPE_NEW]['name']}` - '{$user[$sn_message_class_list[$current_class]['name']]}'"; |
|
196 | - $SubSelectQry = "AND `message_type` = '{$current_class}'"; |
|
197 | 201 | |
198 | - $user[$sn_message_class_list[MSG_TYPE_NEW]['name']] -= $user[$sn_message_class_list[$current_class]['name']]; |
|
199 | - $user[$sn_message_class_list[$current_class]['name']] = 0; |
|
202 | + DBStaticUser::db_user_set_by_id($user['id'], $SubUpdateQry); |
|
203 | + $message_query = DBStaticMessages::db_message_list_by_owner_and_string($user, $SubSelectQry); |
|
200 | 204 | } |
201 | 205 | |
202 | - DBStaticUser::db_user_set_by_id($user['id'], $SubUpdateQry); |
|
203 | - $message_query = DBStaticMessages::db_message_list_by_owner_and_string($user, $SubSelectQry); |
|
204 | - } |
|
205 | - |
|
206 | - if(sys_get_param_int('return')) { |
|
207 | - header('Location: messages.php'); |
|
208 | - die(); |
|
209 | - } |
|
206 | + if(sys_get_param_int('return')) { |
|
207 | + header('Location: messages.php'); |
|
208 | + die(); |
|
209 | + } |
|
210 | 210 | |
211 | - $template = gettemplate('msg_message_list', true); |
|
212 | - while($message_row = db_fetch($message_query)) { |
|
213 | - $template->assign_block_vars('messages', array( |
|
214 | - 'ID' => $message_row['message_id'], |
|
215 | - 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
216 | - 'FROM' => htmlspecialchars($message_row['message_from']), |
|
217 | - 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
218 | - 'TEXT' => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']), |
|
219 | - |
|
220 | - 'FROM_ID' => $message_row['message_sender'], |
|
221 | - 'SUBJ_SANITIZED' => htmlspecialchars($message_row['message_subject']), |
|
222 | - 'STYLE' => $current_class == MSG_TYPE_OUTBOX ? $sn_message_class_list[MSG_TYPE_OUTBOX]['name'] : $sn_message_class_list[$message_row['message_type']]['name'], |
|
223 | - )); |
|
224 | - } |
|
211 | + $template = gettemplate('msg_message_list', true); |
|
212 | + while($message_row = db_fetch($message_query)) { |
|
213 | + $template->assign_block_vars('messages', array( |
|
214 | + 'ID' => $message_row['message_id'], |
|
215 | + 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
216 | + 'FROM' => htmlspecialchars($message_row['message_from']), |
|
217 | + 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
218 | + 'TEXT' => in_array($message_row['message_type'], array(MSG_TYPE_PLAYER, MSG_TYPE_ALLIANCE)) && $message_row['message_sender'] ? nl2br(htmlspecialchars($message_row['message_text'])) : nl2br($message_row['message_text']), |
|
219 | + |
|
220 | + 'FROM_ID' => $message_row['message_sender'], |
|
221 | + 'SUBJ_SANITIZED' => htmlspecialchars($message_row['message_subject']), |
|
222 | + 'STYLE' => $current_class == MSG_TYPE_OUTBOX ? $sn_message_class_list[MSG_TYPE_OUTBOX]['name'] : $sn_message_class_list[$message_row['message_type']]['name'], |
|
223 | + )); |
|
224 | + } |
|
225 | 225 | |
226 | - $current_class_text = classLocale::$lang['msg_class'][$current_class]; |
|
226 | + $current_class_text = classLocale::$lang['msg_class'][$current_class]; |
|
227 | 227 | |
228 | - $template->assign_vars(array( |
|
229 | - "MESSAGE_CLASS" => $current_class, |
|
230 | - "MESSAGE_CLASS_TEXT" => $current_class_text, |
|
231 | - )); |
|
232 | - break; |
|
228 | + $template->assign_vars(array( |
|
229 | + "MESSAGE_CLASS" => $current_class, |
|
230 | + "MESSAGE_CLASS_TEXT" => $current_class_text, |
|
231 | + )); |
|
232 | + break; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | if(!$template) { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * |
23 | 23 | **/ |
24 | 24 | |
25 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
25 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @param $resource_id |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $storage_fill = $caps_real['total_storage'][$resource_id] ? floor(mrc_get_level($user, $planetrow, $resource_id) / $caps_real['total_storage'][$resource_id] * 100) : 0; |
37 | 37 | |
38 | 38 | $template->assign_block_vars('resources', array( |
39 | - 'NAME' => classLocale::$lang["sys_" . pname_resource_name($resource_id)], |
|
39 | + 'NAME' => classLocale::$lang["sys_".pname_resource_name($resource_id)], |
|
40 | 40 | |
41 | 41 | 'HOURLY' => pretty_number($totalProduction, true, true), |
42 | 42 | 'WEEKLY' => pretty_number($totalProduction * 24 * 7, true, true), |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | //$SubQry .= "`{$field_name}` = '{$percent}',"; |
78 | 78 | $SubQry[] = "`{$field_name}` = '{$percent}'"; |
79 | 79 | } else { |
80 | - classSupernova::$debug->warning('Supplying wrong ID in production array - attempt to change some field - ID' . $prod_id, 'Resource Page', 301); |
|
80 | + classSupernova::$debug->warning('Supplying wrong ID in production array - attempt to change some field - ID'.$prod_id, 'Resource Page', 301); |
|
81 | 81 | continue; |
82 | 82 | } |
83 | 83 | } |