@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | |
93 | 93 | for ($Option = 10; $Option >= 0; $Option--) |
94 | 94 | { |
95 | - $template->assign_block_vars('option', array( |
|
96 | - 'VALUE' => $Option * 10, |
|
97 | - )); |
|
95 | + $template->assign_block_vars('option', array( |
|
96 | + 'VALUE' => $Option * 10, |
|
97 | + )); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $caps_real = eco_get_planet_caps($user, $planetrow, 3600); |
@@ -163,14 +163,14 @@ discard block |
||
163 | 163 | int_calc_storage_bar(RES_DEUTERIUM); |
164 | 164 | |
165 | 165 | $template->assign_vars(array( |
166 | - 'PLANET_NAME' => $planetrow['name'], |
|
167 | - 'PLANET_TYPE' => $planetrow['planet_type'], |
|
168 | - 'PLANET_DENSITY_INDEX' => $planet_density_index, |
|
169 | - 'PLANET_CORE_TEXT' => $lang['uni_planet_density_types'][$planet_density_index], |
|
166 | + 'PLANET_NAME' => $planetrow['name'], |
|
167 | + 'PLANET_TYPE' => $planetrow['planet_type'], |
|
168 | + 'PLANET_DENSITY_INDEX' => $planet_density_index, |
|
169 | + 'PLANET_CORE_TEXT' => $lang['uni_planet_density_types'][$planet_density_index], |
|
170 | 170 | |
171 | - 'PRODUCTION_LEVEL' => floor($caps_real['efficiency'] * 100), |
|
171 | + 'PRODUCTION_LEVEL' => floor($caps_real['efficiency'] * 100), |
|
172 | 172 | |
173 | - 'PAGE_HINT' => $lang['res_hint'], |
|
173 | + 'PAGE_HINT' => $lang['res_hint'], |
|
174 | 174 | )); |
175 | 175 | |
176 | 176 | display($template, $lang['res_planet_production']); |
@@ -39,8 +39,8 @@ |
||
39 | 39 | 0 => $row['visit_time'], // start |
40 | 40 | 1 => $row['visit_time'], // end |
41 | 41 | ) |
42 | - //: false |
|
43 | - ; |
|
42 | + //: false |
|
43 | + ; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $session_list = array(); |
@@ -50,52 +50,52 @@ |
||
50 | 50 | stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common); |
51 | 51 | |
52 | 52 | $stat_types = array( |
53 | - STAT_TOTAL => array( |
|
54 | - 'type' => 'total', |
|
55 | - ), |
|
53 | + STAT_TOTAL => array( |
|
54 | + 'type' => 'total', |
|
55 | + ), |
|
56 | 56 | |
57 | - STAT_FLEET => array( |
|
58 | - 'type' => 'fleet', |
|
59 | - ), |
|
57 | + STAT_FLEET => array( |
|
58 | + 'type' => 'fleet', |
|
59 | + ), |
|
60 | 60 | |
61 | - STAT_TECH => array( |
|
62 | - 'type' => 'tech', |
|
63 | - ), |
|
61 | + STAT_TECH => array( |
|
62 | + 'type' => 'tech', |
|
63 | + ), |
|
64 | 64 | |
65 | - STAT_BUILDING => array( |
|
66 | - 'type' => 'build', |
|
67 | - ), |
|
65 | + STAT_BUILDING => array( |
|
66 | + 'type' => 'build', |
|
67 | + ), |
|
68 | 68 | |
69 | - STAT_DEFENSE => array( |
|
70 | - 'type' => 'defs', |
|
71 | - ), |
|
69 | + STAT_DEFENSE => array( |
|
70 | + 'type' => 'defs', |
|
71 | + ), |
|
72 | 72 | |
73 | - STAT_RESOURCE => array( |
|
74 | - 'type' => 'res', |
|
75 | - ), |
|
73 | + STAT_RESOURCE => array( |
|
74 | + 'type' => 'res', |
|
75 | + ), |
|
76 | 76 | |
77 | - STAT_RAID_TOTAL => array( |
|
78 | - 'type' => 'raids', |
|
79 | - ), |
|
77 | + STAT_RAID_TOTAL => array( |
|
78 | + 'type' => 'raids', |
|
79 | + ), |
|
80 | 80 | |
81 | - STAT_RAID_WON => array( |
|
82 | - 'type' => 'raidswin', |
|
83 | - ), |
|
81 | + STAT_RAID_WON => array( |
|
82 | + 'type' => 'raidswin', |
|
83 | + ), |
|
84 | 84 | |
85 | - STAT_RAID_LOST => array( |
|
86 | - 'type' => 'raidsloose', |
|
87 | - ), |
|
85 | + STAT_RAID_LOST => array( |
|
86 | + 'type' => 'raidsloose', |
|
87 | + ), |
|
88 | 88 | |
89 | 89 | STAT_LVL_BUILDING => array( |
90 | - 'type' => 'lvl_minier', |
|
90 | + 'type' => 'lvl_minier', |
|
91 | 91 | ), |
92 | 92 | |
93 | 93 | STAT_LVL_TECH => array( |
94 | - 'type' => 'player_rpg_tech_level', |
|
94 | + 'type' => 'player_rpg_tech_level', |
|
95 | 95 | ), |
96 | 96 | |
97 | 97 | STAT_LVL_RAID => array( |
98 | - 'type' => 'lvl_raid', |
|
98 | + 'type' => 'lvl_raid', |
|
99 | 99 | ), |
100 | 100 | ); |
101 | 101 | stat_tpl_assign($template, $type, 'type', $stat_types, $sn_group_stat_common); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | |
29 | 29 | if (!defined('INSIDE')) { |
30 | - die('Hack attempt!'); |
|
30 | + die('Hack attempt!'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | global $config; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | if (!defined('INSIDE')) |
30 | 30 | { |
31 | - die('Hack attempt!'); |
|
31 | + die('Hack attempt!'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $lang_info = array( |
@@ -689,15 +689,15 @@ discard block |
||
689 | 689 | ), |
690 | 690 | |
691 | 691 | 'months' => array( |
692 | - 1 =>'января', |
|
693 | - 2 =>'февраля', |
|
694 | - 3 =>'марта', |
|
695 | - 4 =>'апреля', |
|
696 | - 5 =>'мая', |
|
697 | - 6 =>'июня', |
|
698 | - 7 =>'июля', |
|
699 | - 8 =>'августа', |
|
700 | - 9 =>'сентября', |
|
692 | + 1 =>'января', |
|
693 | + 2 =>'февраля', |
|
694 | + 3 =>'марта', |
|
695 | + 4 =>'апреля', |
|
696 | + 5 =>'мая', |
|
697 | + 6 =>'июня', |
|
698 | + 7 =>'июля', |
|
699 | + 8 =>'августа', |
|
700 | + 9 =>'сентября', |
|
701 | 701 | 10 =>'октября', |
702 | 702 | 11 =>'ноября', |
703 | 703 | 12 =>'декабря' |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | PASSWORD_RESTORE_ERROR_ACCOUNT_NOT_EXISTS => 'Внутренняя ошибка - при смене пароля аккаунт не найден! Сообщите об этой ошибке Администрации!', |
994 | 994 | AUTH_PASSWORD_RESET_INSIDE_ERROR_NO_ACCOUNT_FOR_CONFIRMATION => 'ВНУТРЕННЯЯ ОШИБКА! Нет аккаунтов для сброса пароля при корректном коде подтверждения! Пожалуйста, сообщите об этой ошибке Администрации Вселенной!', |
995 | 995 | LOGIN_ERROR_NO_ACCOUNT_FOR_COOKIE_SET => 'ВНУТРЕННЯЯ ОШИБКА! СООБЩИТЕ АДМИНИСТРАЦИИ! Не установлен аккаунт при cookie_set()! Пожалуйста, сообщите об этой ошибке Администрации Вселенной!', |
996 | - ), |
|
996 | + ), |
|
997 | 997 | |
998 | 998 | 'log_reg_email_title' => "Ваша регистрация на сервере %1\$s игры СуперНова", |
999 | 999 | 'log_reg_email_text' => "Подтверждение регистрации для %3\$s\r\n\r\n |
@@ -48,112 +48,112 @@ 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 = db_user_by_username($recipient_name); |
|
58 | - } |
|
55 | + $recipient_name = sys_get_param_str_unsafe('recipient_name'); |
|
56 | + if($recipient_name) { |
|
57 | + $recipient_row = db_user_by_username($recipient_name); |
|
58 | + } |
|
59 | 59 | |
60 | - if(!$recipient_row) { |
|
61 | - $recipient_id = sys_get_param_id('id'); |
|
62 | - $recipient_row = 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 = db_user_by_id($recipient_id); |
|
63 | + if(!$recipient_row) { |
|
64 | + $recipient_id = 0; |
|
65 | + } |
|
65 | 66 | } |
66 | - } |
|
67 | 67 | |
68 | - if($recipient_row) { |
|
69 | - $recipient_id = $recipient_row['id']; |
|
70 | - $recipient_name = $recipient_row['username']; |
|
71 | - } |
|
68 | + if($recipient_row) { |
|
69 | + $recipient_id = $recipient_row['id']; |
|
70 | + $recipient_name = $recipient_row['username']; |
|
71 | + } |
|
72 | 72 | |
73 | - if($recipient_id == $user['id']) { |
|
74 | - $error_list[] = array('MESSAGE' => $lang['msg_err_self_send'], 'STATUS' => ERR_ERROR); |
|
75 | - } |
|
73 | + if($recipient_id == $user['id']) { |
|
74 | + $error_list[] = array('MESSAGE' => $lang['msg_err_self_send'], 'STATUS' => ERR_ERROR); |
|
75 | + } |
|
76 | 76 | |
77 | - $re = 0; |
|
78 | - $subject = sys_get_param_str('subject'); |
|
79 | - while(strpos($subject, $lang['msg_answer_prefix']) !== false) { |
|
80 | - $subject = substr($subject, strlen($lang['msg_answer_prefix'])); |
|
81 | - $re++; |
|
82 | - } |
|
83 | - $re ? $subject = $lang['msg_answer_prefix'] . $subject : false; |
|
77 | + $re = 0; |
|
78 | + $subject = sys_get_param_str('subject'); |
|
79 | + while(strpos($subject, $lang['msg_answer_prefix']) !== false) { |
|
80 | + $subject = substr($subject, strlen($lang['msg_answer_prefix'])); |
|
81 | + $re++; |
|
82 | + } |
|
83 | + $re ? $subject = $lang['msg_answer_prefix'] . $subject : false; |
|
84 | 84 | |
85 | - if(sys_get_param_str('msg_send')) { |
|
86 | - $subject = $subject ? $subject : $lang['msg_subject_default']; |
|
85 | + if(sys_get_param_str('msg_send')) { |
|
86 | + $subject = $subject ? $subject : $lang['msg_subject_default']; |
|
87 | 87 | |
88 | - if(!$recipient_id) { |
|
89 | - $error_list[] = array('MESSAGE' => $lang['msg_err_player_not_found'], 'STATUS' => ERR_ERROR); |
|
90 | - } |
|
88 | + if(!$recipient_id) { |
|
89 | + $error_list[] = array('MESSAGE' => $lang['msg_err_player_not_found'], 'STATUS' => ERR_ERROR); |
|
90 | + } |
|
91 | 91 | |
92 | - $text = sys_get_param_str('text'); |
|
93 | - if(!$text) { |
|
94 | - $error_list[] = array('MESSAGE' => $lang['msg_err_no_text'], 'STATUS' => ERR_ERROR); |
|
95 | - } |
|
92 | + $text = sys_get_param_str('text'); |
|
93 | + if(!$text) { |
|
94 | + $error_list[] = array('MESSAGE' => $lang['msg_err_no_text'], 'STATUS' => ERR_ERROR); |
|
95 | + } |
|
96 | 96 | |
97 | - if(empty($error_list)) { |
|
98 | - $error_list[] = array('MESSAGE' => $lang['msg_not_message_sent'], 'STATUS' => ERR_NONE); |
|
97 | + if(empty($error_list)) { |
|
98 | + $error_list[] = array('MESSAGE' => $lang['msg_not_message_sent'], 'STATUS' => ERR_NONE); |
|
99 | 99 | |
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); |
|
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); |
|
103 | 103 | |
104 | - //$recipient_id = 0; |
|
105 | - //$recipient_name = ''; |
|
106 | - //$subject = ''; |
|
107 | - $text = ''; |
|
104 | + //$recipient_id = 0; |
|
105 | + //$recipient_name = ''; |
|
106 | + //$subject = ''; |
|
107 | + $text = ''; |
|
108 | 108 | |
109 | - $msg_sent = true; |
|
110 | - } else { |
|
111 | - $subject = sys_get_param_str_unsafe('subject'); |
|
112 | - $text = sys_get_param_str_unsafe('text'); |
|
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'); |
|
113 | 115 | } |
114 | - $recipient_name = sys_get_param_str_unsafe('recipient_name'); |
|
115 | - } |
|
116 | 116 | |
117 | - $subject = $subject ? $subject : $lang['msg_subject_default']; |
|
117 | + $subject = $subject ? $subject : $lang['msg_subject_default']; |
|
118 | 118 | |
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 | - )); |
|
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 | + )); |
|
125 | 125 | |
126 | - foreach($error_list as $error_message) { |
|
127 | - $template->assign_block_vars('result', $error_message); |
|
128 | - } |
|
126 | + foreach($error_list as $error_message) { |
|
127 | + $template->assign_block_vars('result', $error_message); |
|
128 | + } |
|
129 | 129 | |
130 | - $message_query = doquery( |
|
131 | - "SELECT * FROM {{messages}} |
|
130 | + $message_query = doquery( |
|
131 | + "SELECT * FROM {{messages}} |
|
132 | 132 | WHERE |
133 | 133 | `message_type` = '" . MSG_TYPE_PLAYER . "' AND |
134 | 134 | ((`message_owner` = '{$user['id']}' AND `message_sender` = '{$recipient_id}') |
135 | 135 | OR |
136 | 136 | (`message_sender` = '{$user['id']}' AND `message_owner` = '{$recipient_id}')) ORDER BY `message_time` DESC LIMIT 20;"); |
137 | - while ($message_row = db_fetch($message_query)) { |
|
138 | - $template->assign_block_vars('messages', array( |
|
139 | - 'ID' => $message_row['message_id'], |
|
140 | - 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
141 | - 'FROM' => htmlspecialchars($message_row['message_from']), |
|
142 | - 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
143 | - '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']), |
|
144 | - |
|
145 | - 'FROM_ID' => $message_row['message_sender'], |
|
146 | - )); |
|
147 | - } |
|
137 | + while ($message_row = db_fetch($message_query)) { |
|
138 | + $template->assign_block_vars('messages', array( |
|
139 | + 'ID' => $message_row['message_id'], |
|
140 | + 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
141 | + 'FROM' => htmlspecialchars($message_row['message_from']), |
|
142 | + 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
143 | + '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']), |
|
144 | + |
|
145 | + 'FROM_ID' => $message_row['message_sender'], |
|
146 | + )); |
|
147 | + } |
|
148 | 148 | |
149 | - break; |
|
149 | + break; |
|
150 | 150 | |
151 | - case 'delete': |
|
152 | - $query_add = ''; |
|
151 | + case 'delete': |
|
152 | + $query_add = ''; |
|
153 | 153 | |
154 | - $message_range = sys_get_param_str('message_range'); |
|
154 | + $message_range = sys_get_param_str('message_range'); |
|
155 | 155 | |
156 | - switch($message_range) { |
|
156 | + switch($message_range) { |
|
157 | 157 | case 'unchecked': |
158 | 158 | case 'checked': |
159 | 159 | $marked_message_list = sys_get_param('mark', array()); |
@@ -177,66 +177,66 @@ discard block |
||
177 | 177 | case 'all': |
178 | 178 | $query_add = $query_add ? $query_add : true; |
179 | 179 | break; |
180 | - } |
|
180 | + } |
|
181 | 181 | |
182 | 182 | if($query_add) { |
183 | 183 | $query_add = $query_add === true ? '' : $query_add; |
184 | 184 | doquery("DELETE FROM `{{messages}}` WHERE `message_owner` = '{$user['id']}'{$query_add};"); |
185 | 185 | } |
186 | 186 | |
187 | - case 'show': |
|
188 | - if($current_class == MSG_TYPE_OUTBOX) { |
|
189 | - $message_query = db_message_list_outbox_by_user_id($user['id']); |
|
190 | - } else { |
|
191 | - if ($current_class == MSG_TYPE_NEW) { |
|
192 | - $SubUpdateQry = array(); |
|
193 | - foreach($sn_message_class_list as $message_class_id => $message_class) { |
|
194 | - if($message_class_id != MSG_TYPE_OUTBOX) { |
|
195 | - $SubUpdateQry[] = "`{$message_class['name']}` = '0'"; |
|
196 | - $user[$message_class['name']] = 0; |
|
187 | + case 'show': |
|
188 | + if($current_class == MSG_TYPE_OUTBOX) { |
|
189 | + $message_query = db_message_list_outbox_by_user_id($user['id']); |
|
190 | + } else { |
|
191 | + if ($current_class == MSG_TYPE_NEW) { |
|
192 | + $SubUpdateQry = array(); |
|
193 | + foreach($sn_message_class_list as $message_class_id => $message_class) { |
|
194 | + if($message_class_id != MSG_TYPE_OUTBOX) { |
|
195 | + $SubUpdateQry[] = "`{$message_class['name']}` = '0'"; |
|
196 | + $user[$message_class['name']] = 0; |
|
197 | + } |
|
197 | 198 | } |
199 | + $SubUpdateQry = implode(',', $SubUpdateQry); |
|
200 | + } else { |
|
201 | + $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']]}'"; |
|
202 | + $SubSelectQry = "AND `message_type` = '{$current_class}'"; |
|
203 | + |
|
204 | + $user[$sn_message_class_list[MSG_TYPE_NEW]['name']] -= $user[$sn_message_class_list[$current_class]['name']]; |
|
205 | + $user[$sn_message_class_list[$current_class]['name']] = 0; |
|
198 | 206 | } |
199 | - $SubUpdateQry = implode(',', $SubUpdateQry); |
|
200 | - } else { |
|
201 | - $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']]}'"; |
|
202 | - $SubSelectQry = "AND `message_type` = '{$current_class}'"; |
|
203 | 207 | |
204 | - $user[$sn_message_class_list[MSG_TYPE_NEW]['name']] -= $user[$sn_message_class_list[$current_class]['name']]; |
|
205 | - $user[$sn_message_class_list[$current_class]['name']] = 0; |
|
208 | + db_user_set_by_id($user['id'], $SubUpdateQry); |
|
209 | + $message_query = "SELECT * FROM {{messages}} WHERE `message_owner` = '{$user['id']}' {$SubSelectQry} ORDER BY `message_time` DESC;"; |
|
210 | + $message_query = doquery($message_query); |
|
206 | 211 | } |
207 | 212 | |
208 | - db_user_set_by_id($user['id'], $SubUpdateQry); |
|
209 | - $message_query = "SELECT * FROM {{messages}} WHERE `message_owner` = '{$user['id']}' {$SubSelectQry} ORDER BY `message_time` DESC;"; |
|
210 | - $message_query = doquery($message_query); |
|
211 | - } |
|
212 | - |
|
213 | - if(sys_get_param_int('return')) { |
|
214 | - header('Location: messages.php'); |
|
215 | - die(); |
|
216 | - } |
|
213 | + if(sys_get_param_int('return')) { |
|
214 | + header('Location: messages.php'); |
|
215 | + die(); |
|
216 | + } |
|
217 | 217 | |
218 | - $template = gettemplate('msg_message_list', true); |
|
219 | - while ($message_row = db_fetch($message_query)) { |
|
220 | - $template->assign_block_vars('messages', array( |
|
221 | - 'ID' => $message_row['message_id'], |
|
222 | - 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
223 | - 'FROM' => htmlspecialchars($message_row['message_from']), |
|
224 | - 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
225 | - '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']), |
|
226 | - |
|
227 | - 'FROM_ID' => $message_row['message_sender'], |
|
228 | - 'SUBJ_SANITIZED' => htmlspecialchars($message_row['message_subject']), |
|
229 | - 'STYLE' => $current_class == MSG_TYPE_OUTBOX ? $sn_message_class_list[MSG_TYPE_OUTBOX]['name'] : $sn_message_class_list[$message_row['message_type']]['name'], |
|
230 | - )); |
|
231 | - } |
|
218 | + $template = gettemplate('msg_message_list', true); |
|
219 | + while ($message_row = db_fetch($message_query)) { |
|
220 | + $template->assign_block_vars('messages', array( |
|
221 | + 'ID' => $message_row['message_id'], |
|
222 | + 'DATE' => date(FMT_DATE_TIME, $message_row['message_time'] + SN_CLIENT_TIME_DIFF), |
|
223 | + 'FROM' => htmlspecialchars($message_row['message_from']), |
|
224 | + 'SUBJ' => htmlspecialchars($message_row['message_subject']), |
|
225 | + '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']), |
|
226 | + |
|
227 | + 'FROM_ID' => $message_row['message_sender'], |
|
228 | + 'SUBJ_SANITIZED' => htmlspecialchars($message_row['message_subject']), |
|
229 | + 'STYLE' => $current_class == MSG_TYPE_OUTBOX ? $sn_message_class_list[MSG_TYPE_OUTBOX]['name'] : $sn_message_class_list[$message_row['message_type']]['name'], |
|
230 | + )); |
|
231 | + } |
|
232 | 232 | |
233 | - $current_class_text = $lang['msg_class'][$current_class]; |
|
233 | + $current_class_text = $lang['msg_class'][$current_class]; |
|
234 | 234 | |
235 | - $template->assign_vars(array( |
|
236 | - "MESSAGE_CLASS" => $current_class, |
|
237 | - "MESSAGE_CLASS_TEXT" => $current_class_text, |
|
238 | - )); |
|
239 | - break; |
|
235 | + $template->assign_vars(array( |
|
236 | + "MESSAGE_CLASS" => $current_class, |
|
237 | + "MESSAGE_CLASS_TEXT" => $current_class_text, |
|
238 | + )); |
|
239 | + break; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | if(!$template) { |
@@ -815,7 +815,7 @@ |
||
815 | 815 | '%H' => '(?P<H>[0-9]{2})', |
816 | 816 | '%M' => '(?P<M>[0-9]{2})', |
817 | 817 | '%S' => '(?P<S>[0-9]{2})', |
818 | - // usw.. |
|
818 | + // usw.. |
|
819 | 819 | ); |
820 | 820 | |
821 | 821 | $rexep = "#".strtr(preg_quote($format), $masks)."#"; |
@@ -62,8 +62,8 @@ |
||
62 | 62 | if($mercenary_level) { |
63 | 63 | $darkmater_cost = eco_get_total_cost($mercenary_id, $mercenary_level); |
64 | 64 | if(!$config->empire_mercenary_temporary && $mercenary_level_old) { |
65 | - $darkmater_cost_old = eco_get_total_cost($mercenary_id, $mercenary_level_old); |
|
66 | - $darkmater_cost[BUILD_CREATE][RES_DARK_MATTER] -= $darkmater_cost_old[BUILD_CREATE][RES_DARK_MATTER]; |
|
65 | + $darkmater_cost_old = eco_get_total_cost($mercenary_id, $mercenary_level_old); |
|
66 | + $darkmater_cost[BUILD_CREATE][RES_DARK_MATTER] -= $darkmater_cost_old[BUILD_CREATE][RES_DARK_MATTER]; |
|
67 | 67 | } |
68 | 68 | $darkmater_cost = ceil($darkmater_cost[BUILD_CREATE][RES_DARK_MATTER] * $mercenary_period * $sn_powerup_buy_discounts[$mercenary_period] / $config->empire_mercenary_base_period); |
69 | 69 | } else { |