@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $query_where = array(); |
167 | 167 | $query_params = $search_data['params']; |
168 | 168 | |
169 | - if( $smcFunc['db_title'] == "PostgreSQL") |
|
169 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
170 | 170 | $modSettings['search_simple_fulltext'] = true; |
171 | 171 | |
172 | 172 | if ($query_params['id_search']) |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | if (!empty($modSettings['search_simple_fulltext'])) |
211 | 211 | { |
212 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
212 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
213 | 213 | { |
214 | 214 | $language_ftx = $smcFunc['db_search_language'](); |
215 | 215 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | // remove any indexed words that are used in the complex body search terms |
228 | 228 | $words['indexed_words'] = array_diff($words['indexed_words'], $words['complex_words']); |
229 | 229 | |
230 | - if($smcFunc['db_title'] == "PostgreSQL"){ |
|
230 | + if ($smcFunc['db_title'] == "PostgreSQL") { |
|
231 | 231 | $row = 0; |
232 | 232 | foreach ($words['indexed_words'] as $fulltextWord) { |
233 | 233 | $query_params['boolean_match'] .= ($row <> 0 ? '&' : ''); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | // if we have bool terms to search, add them in |
245 | 245 | if ($query_params['boolean_match']) { |
246 | - if($smcFunc['db_title'] == "PostgreSQL") |
|
246 | + if ($smcFunc['db_title'] == "PostgreSQL") |
|
247 | 247 | { |
248 | 248 | $language_ftx = $smcFunc['db_search_language'](); |
249 | 249 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | } |
258 | 258 | |
259 | - $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? ( ' |
|
259 | + $ignoreRequest = $smcFunc['db_search_query']('insert_into_log_messages_fulltext', ($smcFunc['db_support_ignore'] ? (' |
|
260 | 260 | INSERT IGNORE INTO {db_prefix}' . $search_data['insert_into'] . ' |
261 | 261 | (' . implode(', ', array_keys($query_select)) . ')') : '') . ' |
262 | 262 | SELECT ' . implode(', ', $query_select) . ' |
@@ -11,8 +11,9 @@ discard block |
||
11 | 11 | * @version 2.1 Beta 4 |
12 | 12 | */ |
13 | 13 | |
14 | -if (!defined('SMF')) |
|
14 | +if (!defined('SMF')) { |
|
15 | 15 | die('No direct access...'); |
16 | +} |
|
16 | 17 | |
17 | 18 | /** |
18 | 19 | * Class fulltext_search |
@@ -98,8 +99,9 @@ discard block |
||
98 | 99 | $smcFunc['db_free_result']($request); |
99 | 100 | } |
100 | 101 | // 4 is the MySQL default... |
101 | - else |
|
102 | - $min_word_length = 4; |
|
102 | + else { |
|
103 | + $min_word_length = 4; |
|
104 | + } |
|
103 | 105 | |
104 | 106 | return $min_word_length; |
105 | 107 | } |
@@ -138,8 +140,7 @@ discard block |
||
138 | 140 | $wordsSearch['words'][] = trim($word, "/*- "); |
139 | 141 | $wordsSearch['complex_words'][] = count($subwords) === 1 ? $word : '"' . $word . '"'; |
140 | 142 | } |
141 | - } |
|
142 | - elseif ($smcFunc['strlen'](trim($word, "/*- ")) < $this->min_word_length) |
|
143 | + } elseif ($smcFunc['strlen'](trim($word, "/*- ")) < $this->min_word_length) |
|
143 | 144 | { |
144 | 145 | // short words have feelings too |
145 | 146 | $wordsSearch['words'][] = trim($word, "/*- "); |
@@ -149,8 +150,9 @@ discard block |
||
149 | 150 | |
150 | 151 | $fulltextWord = count($subwords) === 1 ? $word : '"' . $word . '"'; |
151 | 152 | $wordsSearch['indexed_words'][] = $fulltextWord; |
152 | - if ($isExcluded) |
|
153 | - $wordsExclude[] = $fulltextWord; |
|
153 | + if ($isExcluded) { |
|
154 | + $wordsExclude[] = $fulltextWord; |
|
155 | + } |
|
154 | 156 | } |
155 | 157 | |
156 | 158 | /** |
@@ -166,44 +168,54 @@ discard block |
||
166 | 168 | $query_where = array(); |
167 | 169 | $query_params = $search_data['params']; |
168 | 170 | |
169 | - if( $smcFunc['db_title'] == "PostgreSQL") |
|
170 | - $modSettings['search_simple_fulltext'] = true; |
|
171 | + if( $smcFunc['db_title'] == "PostgreSQL") { |
|
172 | + $modSettings['search_simple_fulltext'] = true; |
|
173 | + } |
|
171 | 174 | |
172 | - if ($query_params['id_search']) |
|
173 | - $query_select['id_search'] = '{int:id_search}'; |
|
175 | + if ($query_params['id_search']) { |
|
176 | + $query_select['id_search'] = '{int:id_search}'; |
|
177 | + } |
|
174 | 178 | |
175 | 179 | $count = 0; |
176 | - if (empty($modSettings['search_simple_fulltext'])) |
|
177 | - foreach ($words['words'] as $regularWord) |
|
180 | + if (empty($modSettings['search_simple_fulltext'])) { |
|
181 | + foreach ($words['words'] as $regularWord) |
|
178 | 182 | { |
179 | 183 | $query_where[] = 'm.body' . (in_array($regularWord, $query_params['excluded_words']) ? ' NOT' : '') . (empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : 'RLIKE') . '{string:complex_body_' . $count . '}'; |
184 | + } |
|
180 | 185 | $query_params['complex_body_' . $count++] = empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($regularWord, array('_' => '\\_', '%' => '\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\[\]$.+*?|{}()])/'), array('[$1]'), $regularWord), '\\\'') . '[[:>:]]'; |
181 | 186 | } |
182 | 187 | |
183 | - if ($query_params['user_query']) |
|
184 | - $query_where[] = '{raw:user_query}'; |
|
185 | - if ($query_params['board_query']) |
|
186 | - $query_where[] = 'm.id_board {raw:board_query}'; |
|
188 | + if ($query_params['user_query']) { |
|
189 | + $query_where[] = '{raw:user_query}'; |
|
190 | + } |
|
191 | + if ($query_params['board_query']) { |
|
192 | + $query_where[] = 'm.id_board {raw:board_query}'; |
|
193 | + } |
|
187 | 194 | |
188 | - if ($query_params['topic']) |
|
189 | - $query_where[] = 'm.id_topic = {int:topic}'; |
|
190 | - if ($query_params['min_msg_id']) |
|
191 | - $query_where[] = 'm.id_msg >= {int:min_msg_id}'; |
|
192 | - if ($query_params['max_msg_id']) |
|
193 | - $query_where[] = 'm.id_msg <= {int:max_msg_id}'; |
|
195 | + if ($query_params['topic']) { |
|
196 | + $query_where[] = 'm.id_topic = {int:topic}'; |
|
197 | + } |
|
198 | + if ($query_params['min_msg_id']) { |
|
199 | + $query_where[] = 'm.id_msg >= {int:min_msg_id}'; |
|
200 | + } |
|
201 | + if ($query_params['max_msg_id']) { |
|
202 | + $query_where[] = 'm.id_msg <= {int:max_msg_id}'; |
|
203 | + } |
|
194 | 204 | |
195 | 205 | $count = 0; |
196 | - if (!empty($query_params['excluded_phrases']) && empty($modSettings['search_force_index'])) |
|
197 | - foreach ($query_params['excluded_phrases'] as $phrase) |
|
206 | + if (!empty($query_params['excluded_phrases']) && empty($modSettings['search_force_index'])) { |
|
207 | + foreach ($query_params['excluded_phrases'] as $phrase) |
|
198 | 208 | { |
199 | 209 | $query_where[] = 'subject NOT ' . (empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : 'RLIKE') . '{string:exclude_subject_phrase_' . $count . '}'; |
210 | + } |
|
200 | 211 | $query_params['exclude_subject_phrase_' . $count++] = empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($phrase, array('_' => '\\_', '%' => '\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\[\]$.+*?|{}()])/'), array('[$1]'), $phrase), '\\\'') . '[[:>:]]'; |
201 | 212 | } |
202 | 213 | $count = 0; |
203 | - if (!empty($query_params['excluded_subject_words']) && empty($modSettings['search_force_index'])) |
|
204 | - foreach ($query_params['excluded_subject_words'] as $excludedWord) |
|
214 | + if (!empty($query_params['excluded_subject_words']) && empty($modSettings['search_force_index'])) { |
|
215 | + foreach ($query_params['excluded_subject_words'] as $excludedWord) |
|
205 | 216 | { |
206 | 217 | $query_where[] = 'subject NOT ' . (empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : 'RLIKE') . '{string:exclude_subject_words_' . $count . '}'; |
218 | + } |
|
207 | 219 | $query_params['exclude_subject_words_' . $count++] = empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($excludedWord, array('_' => '\\_', '%' => '\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\[\]$.+*?|{}()])/'), array('[$1]'), $excludedWord), '\\\'') . '[[:>:]]'; |
208 | 220 | } |
209 | 221 | |
@@ -215,12 +227,11 @@ discard block |
||
215 | 227 | |
216 | 228 | $query_where[] = 'to_tsvector({string:language_ftx},body) @@ to_tsquery({string:language_ftx},{string:body_match})'; |
217 | 229 | $query_params['language_ftx'] = $language_ftx; |
230 | + } else { |
|
231 | + $query_where[] = 'MATCH (body) AGAINST ({string:body_match})'; |
|
218 | 232 | } |
219 | - else |
|
220 | - $query_where[] = 'MATCH (body) AGAINST ({string:body_match})'; |
|
221 | 233 | $query_params['body_match'] = implode(' ', array_diff($words['indexed_words'], $query_params['excluded_index_words'])); |
222 | - } |
|
223 | - else |
|
234 | + } else |
|
224 | 235 | { |
225 | 236 | $query_params['boolean_match'] = ''; |
226 | 237 | |
@@ -234,10 +245,10 @@ discard block |
||
234 | 245 | $query_params['boolean_match'] .= (in_array($fulltextWord, $query_params['excluded_index_words']) ? '!' : '') . $fulltextWord . ' '; |
235 | 246 | $row++; |
236 | 247 | } |
237 | - } |
|
238 | - else |
|
239 | - foreach ($words['indexed_words'] as $fulltextWord) |
|
248 | + } else { |
|
249 | + foreach ($words['indexed_words'] as $fulltextWord) |
|
240 | 250 | $query_params['boolean_match'] .= (in_array($fulltextWord, $query_params['excluded_index_words']) ? '-' : '+') . $fulltextWord . ' '; |
251 | + } |
|
241 | 252 | |
242 | 253 | $query_params['boolean_match'] = substr($query_params['boolean_match'], 0, -1); |
243 | 254 | |
@@ -249,9 +260,9 @@ discard block |
||
249 | 260 | |
250 | 261 | $query_where[] = 'to_tsvector({string:language_ftx},body) @@ to_tsquery({string:language_ftx},{string:boolean_match})'; |
251 | 262 | $query_params['language_ftx'] = $language_ftx; |
263 | + } else { |
|
264 | + $query_where[] = 'MATCH (body) AGAINST ({string:boolean_match} IN BOOLEAN MODE)'; |
|
252 | 265 | } |
253 | - else |
|
254 | - $query_where[] = 'MATCH (body) AGAINST ({string:boolean_match} IN BOOLEAN MODE)'; |
|
255 | 266 | } |
256 | 267 | |
257 | 268 | } |
@@ -116,9 +116,10 @@ discard block |
||
116 | 116 | <h3 class="catbg">', $txt['attachment_transfer'], '</h3> |
117 | 117 | </div>'; |
118 | 118 | |
119 | - if (!empty($context['results'])) |
|
120 | - echo ' |
|
119 | + if (!empty($context['results'])) { |
|
120 | + echo ' |
|
121 | 121 | <div class="noticebox">', $context['results'], '</div>'; |
122 | + } |
|
122 | 123 | |
123 | 124 | echo ' |
124 | 125 | <div class="windowbg2 noup"> |
@@ -129,9 +130,10 @@ discard block |
||
129 | 130 | <dd><select name="from"> |
130 | 131 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
131 | 132 | |
132 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
133 | - echo ' |
|
133 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
134 | + echo ' |
|
134 | 135 | <option value="', $id, '">', $dir, '</option>'; |
136 | + } |
|
135 | 137 | echo ' |
136 | 138 | </select></dd> |
137 | 139 | <dt>', $txt['attachment_transfer_auto'], '</dt> |
@@ -139,13 +141,14 @@ discard block |
||
139 | 141 | <option value="0">', $txt['attachment_transfer_auto_select'], '</option> |
140 | 142 | <option value="-1">', $txt['attachment_transfer_forum_root'], '</option>'; |
141 | 143 | |
142 | - if (!empty($context['base_dirs'])) |
|
143 | - foreach ($context['base_dirs'] as $id => $dir) |
|
144 | + if (!empty($context['base_dirs'])) { |
|
145 | + foreach ($context['base_dirs'] as $id => $dir) |
|
144 | 146 | echo ' |
145 | 147 | <option value="', $id, '">', $dir, '</option>'; |
146 | - else |
|
147 | - echo ' |
|
148 | + } else { |
|
149 | + echo ' |
|
148 | 150 | <option value="0" disabled>', $txt['attachment_transfer_no_base'], '</option>'; |
151 | + } |
|
149 | 152 | |
150 | 153 | echo ' |
151 | 154 | </select></dd> |
@@ -153,16 +156,18 @@ discard block |
||
153 | 156 | <dd><select name="to"> |
154 | 157 | <option value="0">', $txt['attachment_transfer_select'], '</option>'; |
155 | 158 | |
156 | - foreach ($context['attach_dirs'] as $id => $dir) |
|
157 | - echo ' |
|
159 | + foreach ($context['attach_dirs'] as $id => $dir) { |
|
160 | + echo ' |
|
158 | 161 | <option value="', $id, '">', $dir, '</option>'; |
162 | + } |
|
159 | 163 | echo ' |
160 | 164 | </select></dd>'; |
161 | 165 | |
162 | - if (!empty($modSettings['attachmentDirFileLimit'])) |
|
163 | - echo ' |
|
166 | + if (!empty($modSettings['attachmentDirFileLimit'])) { |
|
167 | + echo ' |
|
164 | 168 | <dt>', $txt['attachment_transfer_empty'], '</dt> |
165 | 169 | <dd><input type="checkbox" name="empty_it"', $context['checked'] ? ' checked' : '', '></dd>'; |
170 | + } |
|
166 | 171 | echo ' |
167 | 172 | </dl> |
168 | 173 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -238,10 +243,11 @@ discard block |
||
238 | 243 | // Loop through each error reporting the status |
239 | 244 | foreach ($context['repair_errors'] as $error => $number) |
240 | 245 | { |
241 | - if (!empty($number)) |
|
242 | - echo ' |
|
246 | + if (!empty($number)) { |
|
247 | + echo ' |
|
243 | 248 | <input type="checkbox" name="to_fix[]" id="', $error, '" value="', $error, '"> |
244 | 249 | <label for="', $error, '">', sprintf($txt['attach_repair_' . $error], $number), '</label><br>'; |
250 | + } |
|
245 | 251 | } |
246 | 252 | |
247 | 253 | echo ' <br> |
@@ -416,8 +416,8 @@ discard block |
||
416 | 416 | </div> |
417 | 417 | <div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
418 | 418 | <div class="attach-ui"> |
419 | - <a data-dz-remove class="button_submit cancel">', $txt['modify_cancel'] ,'</a> |
|
420 | - <a class="button_submit upload">', $txt['upload'] ,'</a> |
|
419 | + <a data-dz-remove class="button_submit cancel">', $txt['modify_cancel'], '</a> |
|
420 | + <a class="button_submit upload">', $txt['upload'], '</a> |
|
421 | 421 | </div> |
422 | 422 | </div> |
423 | 423 | </div> |
@@ -435,10 +435,10 @@ discard block |
||
435 | 435 | </dt> |
436 | 436 | <dd class="smalltext fallback"> |
437 | 437 | <div id="attachUpload" class="descbox"> |
438 | - <h5>', $txt['attach_drop_zone'] ,'</h5> |
|
439 | - <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a> |
|
440 | - <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a> |
|
441 | - <a class="button_submit fileinput-button">', $txt['attach_add'] ,'</a> |
|
438 | + <h5>', $txt['attach_drop_zone'], '</h5> |
|
439 | + <a class="button_submit" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a> |
|
440 | + <a class="button_submit" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a> |
|
441 | + <a class="button_submit fileinput-button">', $txt['attach_add'], '</a> |
|
442 | 442 | <div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
443 | 443 | <div class="fallback"> |
444 | 444 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | // Option to delete an event if user is editing one. |
546 | 546 | if ($context['make_event'] && !$context['event']['new']) |
547 | 547 | echo ' |
548 | - <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
|
548 | + <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button_submit you_sure">'; |
|
549 | 549 | |
550 | 550 | echo ' |
551 | 551 | </span> |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | });'; |
800 | 800 | |
801 | 801 | echo ' |
802 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
802 | + var oEditorID = "', $context['post_box_name'], '"; |
|
803 | 803 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
804 | 804 | </script>'; |
805 | 805 | |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | { |
832 | 832 | echo ' |
833 | 833 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
834 | - <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li> |
|
834 | + <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li> |
|
835 | 835 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
836 | 836 | </ul>'; |
837 | 837 | } |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | <head> |
919 | 919 | <meta charset="', $context['character_set'], '"> |
920 | 920 | <title>', $txt['spell_check'], '</title> |
921 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
921 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
922 | 922 | <style> |
923 | 923 | body, td |
924 | 924 | { |
@@ -951,8 +951,8 @@ discard block |
||
951 | 951 | var spell_formname = window.opener.spell_formname; |
952 | 952 | var spell_fieldname = window.opener.spell_fieldname; |
953 | 953 | </script> |
954 | - <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script> |
|
955 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
954 | + <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script> |
|
955 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
956 | 956 | <script> |
957 | 957 | ', $context['spell_js'], ' |
958 | 958 | </script> |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | <head> |
995 | 995 | <meta charset="', $context['character_set'], '"> |
996 | 996 | <title>', $txt['retrieving_quote'], '</title> |
997 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
997 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
998 | 998 | </head> |
999 | 999 | <body> |
1000 | 1000 | ', $txt['retrieving_quote'], ' |
@@ -22,22 +22,24 @@ discard block |
||
22 | 22 | <script>'; |
23 | 23 | |
24 | 24 | // When using Go Back due to fatal_error, allow the form to be re-submitted with changes. |
25 | - if (isBrowser('is_firefox')) |
|
26 | - echo ' |
|
25 | + if (isBrowser('is_firefox')) { |
|
26 | + echo ' |
|
27 | 27 | window.addEventListener("pageshow", reActivate, false);'; |
28 | + } |
|
28 | 29 | |
29 | 30 | // Start with message icons - and any missing from this theme. |
30 | 31 | echo ' |
31 | 32 | var icon_urls = {'; |
32 | - foreach ($context['icons'] as $icon) |
|
33 | - echo ' |
|
33 | + foreach ($context['icons'] as $icon) { |
|
34 | + echo ' |
|
34 | 35 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
36 | + } |
|
35 | 37 | echo ' |
36 | 38 | };'; |
37 | 39 | |
38 | 40 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
39 | - if ($context['make_poll']) |
|
40 | - echo ' |
|
41 | + if ($context['make_poll']) { |
|
42 | + echo ' |
|
41 | 43 | var pollOptionNum = 0, pollTabIndex; |
42 | 44 | var pollOptionId = ', $context['last_choice_id'], '; |
43 | 45 | function addPollOption() |
@@ -56,11 +58,13 @@ discard block |
||
56 | 58 | |
57 | 59 | setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<dt><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>:</dt><dd><input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('"></dd><p id="pollMoreOptions"></p>'), '); |
58 | 60 | }'; |
61 | + } |
|
59 | 62 | |
60 | 63 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
61 | - if ($context['make_event']) |
|
62 | - echo ' |
|
64 | + if ($context['make_event']) { |
|
65 | + echo ' |
|
63 | 66 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
67 | + } |
|
64 | 68 | |
65 | 69 | // End of the javascript, start the form and display the link tree. |
66 | 70 | echo ' |
@@ -80,9 +84,10 @@ discard block |
||
80 | 84 | </div> |
81 | 85 | </div><br>'; |
82 | 86 | |
83 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
84 | - echo ' |
|
87 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
88 | + echo ' |
|
85 | 89 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
90 | + } |
|
86 | 91 | |
87 | 92 | // Start the main table. |
88 | 93 | echo ' |
@@ -117,18 +122,20 @@ discard block |
||
117 | 122 | } |
118 | 123 | |
119 | 124 | // If it's locked, show a message to warn the replier. |
120 | - if (!empty($context['locked'])) |
|
121 | - echo ' |
|
125 | + if (!empty($context['locked'])) { |
|
126 | + echo ' |
|
122 | 127 | <p class="errorbox"> |
123 | 128 | ', $txt['topic_locked_no_reply'], ' |
124 | 129 | </p>'; |
130 | + } |
|
125 | 131 | |
126 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
127 | - echo ' |
|
132 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
133 | + echo ' |
|
128 | 134 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
129 | 135 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
130 | 136 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
131 | 137 | </div>'; |
138 | + } |
|
132 | 139 | |
133 | 140 | // The post header... important stuff |
134 | 141 | echo ' |
@@ -180,9 +187,10 @@ discard block |
||
180 | 187 | { |
181 | 188 | echo ' |
182 | 189 | <optgroup label="', $category['name'], '">'; |
183 | - foreach ($category['boards'] as $board) |
|
184 | - echo ' |
|
190 | + foreach ($category['boards'] as $board) { |
|
191 | + echo ' |
|
185 | 192 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' </option>'; |
193 | + } |
|
186 | 194 | echo ' |
187 | 195 | </optgroup>'; |
188 | 196 | } |
@@ -218,9 +226,10 @@ discard block |
||
218 | 226 | <span class="label">', $txt['calendar_timezone'], '</span> |
219 | 227 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
220 | 228 | |
221 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
222 | - echo ' |
|
229 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
230 | + echo ' |
|
223 | 231 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
232 | + } |
|
224 | 233 | |
225 | 234 | echo ' |
226 | 235 | </select> |
@@ -286,14 +295,15 @@ discard block |
||
286 | 295 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
287 | 296 | </dd>'; |
288 | 297 | |
289 | - if ($context['poll_options']['guest_vote_enabled']) |
|
290 | - echo ' |
|
298 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
299 | + echo ' |
|
291 | 300 | <dt> |
292 | 301 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
293 | 302 | </dt> |
294 | 303 | <dd> |
295 | 304 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '> |
296 | 305 | </dd>'; |
306 | + } |
|
297 | 307 | |
298 | 308 | echo ' |
299 | 309 | <dt> |
@@ -314,8 +324,8 @@ discard block |
||
314 | 324 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
315 | 325 | |
316 | 326 | // If we're editing and displaying edit details, show a box where they can say why |
317 | - if (isset($context['editing']) && $modSettings['show_modify']) |
|
318 | - echo ' |
|
327 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
328 | + echo ' |
|
319 | 329 | <dl> |
320 | 330 | <dt class="clear"> |
321 | 331 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -324,20 +334,23 @@ discard block |
||
324 | 334 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"> |
325 | 335 | </dd> |
326 | 336 | </dl>'; |
337 | + } |
|
327 | 338 | |
328 | 339 | // If this message has been edited in the past - display when it was. |
329 | - if (isset($context['last_modified'])) |
|
330 | - echo ' |
|
340 | + if (isset($context['last_modified'])) { |
|
341 | + echo ' |
|
331 | 342 | <div class="padding smalltext"> |
332 | 343 | ', $context['last_modified_text'], ' |
333 | 344 | </div>'; |
345 | + } |
|
334 | 346 | |
335 | 347 | // If the admin has enabled the hiding of the additional options - show a link and image for it. |
336 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
337 | - echo ' |
|
348 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
349 | + echo ' |
|
338 | 350 | <div id="postAdditionalOptionsHeader"> |
339 | 351 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
340 | 352 | </div>'; |
353 | + } |
|
341 | 354 | |
342 | 355 | echo ' |
343 | 356 | <div id="postAdditionalOptions">'; |
@@ -369,19 +382,21 @@ discard block |
||
369 | 382 | <input type="hidden" name="attach_del[]" value="0"> |
370 | 383 | ', $txt['uncheck_unwatchd_attach'], ': |
371 | 384 | </dd>'; |
372 | - foreach ($context['current_attachments'] as $attachment) |
|
373 | - echo ' |
|
385 | + foreach ($context['current_attachments'] as $attachment) { |
|
386 | + echo ' |
|
374 | 387 | <dd class="smalltext"> |
375 | 388 | <label for="attachment_', $attachment['attachID'], '"><input type="checkbox" id="attachment_', $attachment['attachID'], '" name="attach_del[]" value="', $attachment['attachID'], '"', empty($attachment['unchecked']) ? ' checked' : '', '> ', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''), |
376 | 389 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '</label> |
377 | 390 | </dd>'; |
391 | + } |
|
378 | 392 | |
379 | 393 | echo ' |
380 | 394 | </dl>'; |
381 | 395 | |
382 | - if (!empty($context['files_in_session_warning'])) |
|
383 | - echo ' |
|
396 | + if (!empty($context['files_in_session_warning'])) { |
|
397 | + echo ' |
|
384 | 398 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
399 | + } |
|
385 | 400 | } |
386 | 401 | |
387 | 402 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -445,8 +460,8 @@ discard block |
||
445 | 460 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1028 . '">'); |
446 | 461 | |
447 | 462 | // Show more boxes if they aren't approaching that limit. |
448 | - if ($context['num_allowed_attachments'] > 1) |
|
449 | - echo ' |
|
463 | + if ($context['num_allowed_attachments'] > 1) { |
|
464 | + echo ' |
|
450 | 465 | <script> |
451 | 466 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
452 | 467 | var current_attachment = 1; |
@@ -467,9 +482,10 @@ discard block |
||
467 | 482 | </div> |
468 | 483 | </div> |
469 | 484 | </dd>'; |
470 | - else |
|
471 | - echo ' |
|
485 | + } else { |
|
486 | + echo ' |
|
472 | 487 | </dd>'; |
488 | + } |
|
473 | 489 | |
474 | 490 | // Add any template changes for an alternative upload system here. |
475 | 491 | call_integration_hook('integrate_upload_template'); |
@@ -478,21 +494,25 @@ discard block |
||
478 | 494 | <dd class="smalltext">'; |
479 | 495 | |
480 | 496 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
481 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
482 | - echo ' |
|
497 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
498 | + echo ' |
|
483 | 499 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
500 | + } |
|
484 | 501 | |
485 | - if (!empty($context['attachment_restrictions'])) |
|
486 | - echo ' |
|
502 | + if (!empty($context['attachment_restrictions'])) { |
|
503 | + echo ' |
|
487 | 504 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
505 | + } |
|
488 | 506 | |
489 | - if ($context['num_allowed_attachments'] == 0) |
|
490 | - echo ' |
|
507 | + if ($context['num_allowed_attachments'] == 0) { |
|
508 | + echo ' |
|
491 | 509 | ', $txt['attach_limit_nag'], '<br>'; |
510 | + } |
|
492 | 511 | |
493 | - if (!$context['can_post_attachment_unapproved']) |
|
494 | - echo ' |
|
512 | + if (!$context['can_post_attachment_unapproved']) { |
|
513 | + echo ' |
|
495 | 514 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
515 | + } |
|
496 | 516 | |
497 | 517 | echo ' |
498 | 518 | </dd> |
@@ -515,10 +535,11 @@ discard block |
||
515 | 535 | <dt><strong>', $txt['subject'], '</strong></dt> |
516 | 536 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
517 | 537 | |
518 | - foreach ($context['drafts'] as $draft) |
|
519 | - echo ' |
|
538 | + foreach ($context['drafts'] as $draft) { |
|
539 | + echo ' |
|
520 | 540 | <dt>', $draft['link'], '</dt> |
521 | 541 | <dd>', $draft['poster_time'], '</dd>'; |
542 | + } |
|
522 | 543 | echo ' |
523 | 544 | </dl> |
524 | 545 | </div>'; |
@@ -543,9 +564,10 @@ discard block |
||
543 | 564 | ', template_control_richedit_buttons($context['post_box_name']); |
544 | 565 | |
545 | 566 | // Option to delete an event if user is editing one. |
546 | - if ($context['make_event'] && !$context['event']['new']) |
|
547 | - echo ' |
|
567 | + if ($context['make_event'] && !$context['event']['new']) { |
|
568 | + echo ' |
|
548 | 569 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button_submit you_sure">'; |
570 | + } |
|
549 | 571 | |
550 | 572 | echo ' |
551 | 573 | </span> |
@@ -554,9 +576,10 @@ discard block |
||
554 | 576 | <br class="clear">'; |
555 | 577 | |
556 | 578 | // Assuming this isn't a new topic pass across the last message id. |
557 | - if (isset($context['topic_last_message'])) |
|
558 | - echo ' |
|
579 | + if (isset($context['topic_last_message'])) { |
|
580 | + echo ' |
|
559 | 581 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
582 | + } |
|
560 | 583 | |
561 | 584 | echo ' |
562 | 585 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -698,9 +721,10 @@ discard block |
||
698 | 721 | |
699 | 722 | newPostsHTML += \'<div class="windowbg\' + (++reply_counter % 2 == 0 ? \'2\' : \'\') + \'"><div id="msg\' + newPosts[i].getAttribute("id") + \'"><div class="floatleft"><h5>', $txt['posted_by'], ': \' + newPosts[i].getElementsByTagName("poster")[0].firstChild.nodeValue + \'</h5><span class="smalltext">« <strong>', $txt['on'], ':</strong> \' + newPosts[i].getElementsByTagName("time")[0].firstChild.nodeValue + \' »</span> <span class="new_posts" id="image_new_\' + newPosts[i].getAttribute("id") + \'">', $txt['new'], '</span></div>\';'; |
700 | 723 | |
701 | - if ($context['can_quote']) |
|
702 | - echo ' |
|
724 | + if ($context['can_quote']) { |
|
725 | + echo ' |
|
703 | 726 | newPostsHTML += \'<ul class="quickbuttons" id="msg_\' + newPosts[i].getAttribute("id") + \'_quote"><li><a href="#postmodify" onclick="return insertQuoteFast(\\\'\' + newPosts[i].getAttribute("id") + \'\\\');" class="quote_button"><span>', $txt['quote'], '</span><\' + \'/a></li></ul>\';'; |
727 | + } |
|
704 | 728 | |
705 | 729 | echo ' |
706 | 730 | newPostsHTML += \'<br class="clear">\'; |
@@ -743,8 +767,8 @@ discard block |
||
743 | 767 | }'; |
744 | 768 | |
745 | 769 | // Code for showing and hiding additional options. |
746 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
747 | - echo ' |
|
770 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
771 | + echo ' |
|
748 | 772 | var oSwapAdditionalOptions = new smc_Toggle({ |
749 | 773 | bToggleEnabled: true, |
750 | 774 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -772,10 +796,11 @@ discard block |
||
772 | 796 | } |
773 | 797 | ] |
774 | 798 | });'; |
799 | + } |
|
775 | 800 | |
776 | 801 | // Code for showing and hiding drafts |
777 | - if (!empty($context['drafts'])) |
|
778 | - echo ' |
|
802 | + if (!empty($context['drafts'])) { |
|
803 | + echo ' |
|
779 | 804 | var oSwapDraftOptions = new smc_Toggle({ |
780 | 805 | bToggleEnabled: true, |
781 | 806 | bCurrentlyCollapsed: true, |
@@ -797,6 +822,7 @@ discard block |
||
797 | 822 | } |
798 | 823 | ] |
799 | 824 | });'; |
825 | + } |
|
800 | 826 | |
801 | 827 | echo ' |
802 | 828 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -817,8 +843,9 @@ discard block |
||
817 | 843 | foreach ($context['previous_posts'] as $post) |
818 | 844 | { |
819 | 845 | $ignoring = false; |
820 | - if (!empty($post['is_ignored'])) |
|
821 | - $ignored_posts[] = $ignoring = $post['id']; |
|
846 | + if (!empty($post['is_ignored'])) { |
|
847 | + $ignored_posts[] = $ignoring = $post['id']; |
|
848 | + } |
|
822 | 849 | |
823 | 850 | echo ' |
824 | 851 | <div class="windowbg"> |
@@ -1001,10 +1028,10 @@ discard block |
||
1001 | 1028 | <div id="temporary_posting_area" style="display: none;"></div> |
1002 | 1029 | <script>'; |
1003 | 1030 | |
1004 | - if ($context['close_window']) |
|
1005 | - echo ' |
|
1031 | + if ($context['close_window']) { |
|
1032 | + echo ' |
|
1006 | 1033 | window.close();'; |
1007 | - else |
|
1034 | + } else |
|
1008 | 1035 | { |
1009 | 1036 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;). |
1010 | 1037 | echo ' |
@@ -1058,11 +1085,12 @@ discard block |
||
1058 | 1085 | </p> |
1059 | 1086 | <ul>'; |
1060 | 1087 | |
1061 | - foreach ($context['groups'] as $group) |
|
1062 | - echo ' |
|
1088 | + foreach ($context['groups'] as $group) { |
|
1089 | + echo ' |
|
1063 | 1090 | <li> |
1064 | 1091 | <label for="who_', $group['id'], '"><input type="checkbox" name="who[', $group['id'], ']" id="who_', $group['id'], '" value="', $group['id'], '" checked> ', $group['name'], '</label> <em>(', $group['member_count'], ')</em> |
1065 | 1092 | </li>'; |
1093 | + } |
|
1066 | 1094 | |
1067 | 1095 | echo ' |
1068 | 1096 | <li> |
@@ -24,11 +24,12 @@ discard block |
||
24 | 24 | <h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3> |
25 | 25 | </div>'; |
26 | 26 | |
27 | - if (!empty($context['disable_groups'])) |
|
28 | - echo ' |
|
27 | + if (!empty($context['disable_groups'])) { |
|
28 | + echo ' |
|
29 | 29 | <div class="information"> |
30 | 30 | <span class="alert">', $txt['paid_mod_edit_note'], '</span> |
31 | 31 | </div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | echo ' |
34 | 35 | <div class="windowbg2"> |
@@ -68,9 +69,10 @@ discard block |
||
68 | 69 | <option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>'; |
69 | 70 | |
70 | 71 | // Put each group into the box. |
71 | - foreach ($context['groups'] as $id => $name) |
|
72 | - echo ' |
|
72 | + foreach ($context['groups'] as $id => $name) { |
|
73 | + echo ' |
|
73 | 74 | <option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>'; |
75 | + } |
|
74 | 76 | |
75 | 77 | echo ' |
76 | 78 | </select> |
@@ -81,9 +83,10 @@ discard block |
||
81 | 83 | <dd>'; |
82 | 84 | |
83 | 85 | // Put a checkbox in for each group |
84 | - foreach ($context['groups'] as $id => $name) |
|
85 | - echo ' |
|
86 | + foreach ($context['groups'] as $id => $name) { |
|
87 | + echo ' |
|
86 | 88 | <label for="addgroup_', $id, '"><input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '> <span class="smalltext">', $name, '</span></label><br>'; |
89 | + } |
|
87 | 90 | |
88 | 91 | echo ' |
89 | 92 | </dd> |
@@ -135,8 +138,8 @@ discard block |
||
135 | 138 | <fieldset>'; |
136 | 139 | |
137 | 140 | //!! Removed until implemented |
138 | - if (!empty($sdflsdhglsdjgs)) |
|
139 | - echo ' |
|
141 | + if (!empty($sdflsdhglsdjgs)) { |
|
142 | + echo ' |
|
140 | 143 | <dl class="settings"> |
141 | 144 | <dt> |
142 | 145 | <label for="allow_partial_check">', $txt['paid_mod_allow_partial'], '</label>:<br><span class="smalltext">', $txt['paid_mod_allow_partial_desc'], '</span> |
@@ -145,6 +148,7 @@ discard block |
||
145 | 148 | <input type="checkbox" name="allow_partial" id="allow_partial_check"', empty($context['sub']['allow_partial']) ? '' : ' checked', '> |
146 | 149 | </dd> |
147 | 150 | </dl>'; |
151 | + } |
|
148 | 152 | |
149 | 153 | echo ' |
150 | 154 | <div class="information"> |
@@ -245,8 +249,8 @@ discard block |
||
245 | 249 | <dl class="settings">'; |
246 | 250 | |
247 | 251 | // Do we need a username? |
248 | - if ($context['action_type'] == 'add') |
|
249 | - echo ' |
|
252 | + if ($context['action_type'] == 'add') { |
|
253 | + echo ' |
|
250 | 254 | |
251 | 255 | <dt> |
252 | 256 | <strong>', $txt['paid_username'], ':</strong><br> |
@@ -255,6 +259,7 @@ discard block |
||
255 | 259 | <dd> |
256 | 260 | <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30"> |
257 | 261 | </dd>'; |
262 | + } |
|
258 | 263 | |
259 | 264 | echo ' |
260 | 265 | <dt> |
@@ -272,9 +277,10 @@ discard block |
||
272 | 277 | <select name="year" id="year" onchange="generateDays();">'; |
273 | 278 | |
274 | 279 | // Show a list of all the years we allow... |
275 | - for ($year = 2005; $year <= 2030; $year++) |
|
276 | - echo ' |
|
280 | + for ($year = 2005; $year <= 2030; $year++) { |
|
281 | + echo ' |
|
277 | 282 | <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>'; |
283 | + } |
|
278 | 284 | |
279 | 285 | echo ' |
280 | 286 | </select> |
@@ -282,9 +288,10 @@ discard block |
||
282 | 288 | <select name="month" id="month" onchange="generateDays();">'; |
283 | 289 | |
284 | 290 | // There are 12 months per year - ensure that they all get listed. |
285 | - for ($month = 1; $month <= 12; $month++) |
|
286 | - echo ' |
|
291 | + for ($month = 1; $month <= 12; $month++) { |
|
292 | + echo ' |
|
287 | 293 | <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
294 | + } |
|
288 | 295 | |
289 | 296 | echo ' |
290 | 297 | </select> |
@@ -292,9 +299,10 @@ discard block |
||
292 | 299 | <select name="day" id="day">'; |
293 | 300 | |
294 | 301 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
295 | - for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) |
|
296 | - echo ' |
|
302 | + for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) { |
|
303 | + echo ' |
|
297 | 304 | <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>'; |
305 | + } |
|
298 | 306 | |
299 | 307 | echo ' |
300 | 308 | </select> |
@@ -306,9 +314,10 @@ discard block |
||
306 | 314 | <select name="yearend" id="yearend" onchange="generateDays(\'end\');">'; |
307 | 315 | |
308 | 316 | // Show a list of all the years we allow... |
309 | - for ($year = 2005; $year <= 2030; $year++) |
|
310 | - echo ' |
|
317 | + for ($year = 2005; $year <= 2030; $year++) { |
|
318 | + echo ' |
|
311 | 319 | <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>'; |
320 | + } |
|
312 | 321 | |
313 | 322 | echo ' |
314 | 323 | </select> |
@@ -316,9 +325,10 @@ discard block |
||
316 | 325 | <select name="monthend" id="monthend" onchange="generateDays(\'end\');">'; |
317 | 326 | |
318 | 327 | // There are 12 months per year - ensure that they all get listed. |
319 | - for ($month = 1; $month <= 12; $month++) |
|
320 | - echo ' |
|
328 | + for ($month = 1; $month <= 12; $month++) { |
|
329 | + echo ' |
|
321 | 330 | <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
331 | + } |
|
322 | 332 | |
323 | 333 | echo ' |
324 | 334 | </select> |
@@ -326,9 +336,10 @@ discard block |
||
326 | 336 | <select name="dayend" id="dayend">'; |
327 | 337 | |
328 | 338 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
329 | - for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) |
|
330 | - echo ' |
|
339 | + for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) { |
|
340 | + echo ' |
|
331 | 341 | <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>'; |
342 | + } |
|
332 | 343 | |
333 | 344 | echo ' |
334 | 345 | </select> |
@@ -410,8 +421,7 @@ discard block |
||
410 | 421 | <div class="information"> |
411 | 422 | ', $txt['paid_subs_none'], ' |
412 | 423 | </div>'; |
413 | - } |
|
414 | - else |
|
424 | + } else |
|
415 | 425 | { |
416 | 426 | echo ' |
417 | 427 | <div class="information"> |
@@ -423,8 +433,9 @@ discard block |
||
423 | 433 | { |
424 | 434 | |
425 | 435 | // Ignore the inactive ones... |
426 | - if (empty($subscription['active'])) |
|
427 | - continue; |
|
436 | + if (empty($subscription['active'])) { |
|
437 | + continue; |
|
438 | + } |
|
428 | 439 | |
429 | 440 | echo ' |
430 | 441 | <div class="cat_bar"> |
@@ -434,9 +445,10 @@ discard block |
||
434 | 445 | <p><strong>', $subscription['name'], '</strong></p> |
435 | 446 | <p class="smalltext">', $subscription['desc'], '</p>'; |
436 | 447 | |
437 | - if (!$subscription['flexible']) |
|
438 | - echo ' |
|
448 | + if (!$subscription['flexible']) { |
|
449 | + echo ' |
|
439 | 450 | <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>'; |
451 | + } |
|
440 | 452 | |
441 | 453 | if ($context['user']['is_owner']) |
442 | 454 | { |
@@ -449,24 +461,25 @@ discard block |
||
449 | 461 | <select name="cur[', $subscription['id'], ']">'; |
450 | 462 | |
451 | 463 | // Print out the costs for this one. |
452 | - foreach ($subscription['costs'] as $duration => $value) |
|
453 | - echo ' |
|
464 | + foreach ($subscription['costs'] as $duration => $value) { |
|
465 | + echo ' |
|
454 | 466 | <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>'; |
467 | + } |
|
455 | 468 | |
456 | 469 | echo ' |
457 | 470 | </select>'; |
458 | - } |
|
459 | - else |
|
460 | - echo ' |
|
471 | + } else { |
|
472 | + echo ' |
|
461 | 473 | ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']); |
474 | + } |
|
462 | 475 | |
463 | 476 | echo ' |
464 | 477 | <hr> |
465 | 478 | <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button_submit">'; |
466 | - } |
|
467 | - else |
|
468 | - echo ' |
|
479 | + } else { |
|
480 | + echo ' |
|
469 | 481 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>'; |
482 | + } |
|
470 | 483 | |
471 | 484 | echo ' |
472 | 485 | </div>'; |
@@ -493,19 +506,20 @@ discard block |
||
493 | 506 | </thead> |
494 | 507 | <tbody>'; |
495 | 508 | |
496 | - if (empty($context['current'])) |
|
497 | - echo ' |
|
509 | + if (empty($context['current'])) { |
|
510 | + echo ' |
|
498 | 511 | <tr class="windowbg"> |
499 | 512 | <td colspan="4"> |
500 | 513 | ', $txt['paid_none_yet'], ' |
501 | 514 | </td> |
502 | 515 | </tr>'; |
516 | + } |
|
503 | 517 | |
504 | 518 | foreach ($context['current'] as $sub) |
505 | 519 | { |
506 | 520 | |
507 | - if (!$sub['hide']) |
|
508 | - echo ' |
|
521 | + if (!$sub['hide']) { |
|
522 | + echo ' |
|
509 | 523 | <tr class="windowbg"> |
510 | 524 | <td> |
511 | 525 | ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), ' |
@@ -517,6 +531,7 @@ discard block |
||
517 | 531 | ', $sub['end'], ' |
518 | 532 | </td> |
519 | 533 | </tr>'; |
534 | + } |
|
520 | 535 | } |
521 | 536 | echo ' |
522 | 537 | </tbody> |
@@ -567,15 +582,17 @@ discard block |
||
567 | 582 | ', $gateway['desc'], '<br> |
568 | 583 | <form action="', $gateway['form'], '" method="post">'; |
569 | 584 | |
570 | - if (!empty($gateway['javascript'])) |
|
571 | - echo ' |
|
585 | + if (!empty($gateway['javascript'])) { |
|
586 | + echo ' |
|
572 | 587 | <script> |
573 | 588 | ', $gateway['javascript'], ' |
574 | 589 | </script>'; |
590 | + } |
|
575 | 591 | |
576 | - foreach ($gateway['hidden'] as $name => $value) |
|
577 | - echo ' |
|
592 | + foreach ($gateway['hidden'] as $name => $value) { |
|
593 | + echo ' |
|
578 | 594 | <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">'; |
595 | + } |
|
579 | 596 | |
580 | 597 | echo ' |
581 | 598 | <br><input type="submit" value="', $gateway['submit'], '" class="button_submit"> |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | foreach ($message['custom_fields']['above_member'] as $custom) |
233 | 233 | echo ' |
234 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
234 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
235 | 235 | |
236 | 236 | echo ' |
237 | 237 | </ul> |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | if (!empty($message['custom_fields']['below_avatar'])) |
269 | 269 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
270 | 270 | echo ' |
271 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
271 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
272 | 272 | |
273 | 273 | if (!$message['member']['is_guest']) |
274 | 274 | echo ' |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | foreach ($message['custom_fields']['icons'] as $custom) |
312 | 312 | echo ' |
313 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
313 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
314 | 314 | |
315 | 315 | echo ' |
316 | 316 | </ol> |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (!empty($message['custom_fields']['standard'])) |
369 | 369 | foreach ($message['custom_fields']['standard'] as $custom) |
370 | 370 | echo ' |
371 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
371 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
372 | 372 | |
373 | 373 | // Are we showing the warning status? |
374 | 374 | if ($message['member']['can_see_warning']) |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | if (!empty($message['custom_fields']['bottom_poster'])) |
380 | 380 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
381 | 381 | echo ' |
382 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
382 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | // Done with the information about the poster... on to the post itself. |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | |
478 | 478 | foreach ($message['custom_fields']['above_signature'] as $custom) |
479 | 479 | echo ' |
480 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
480 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
481 | 481 | |
482 | 482 | echo ' |
483 | 483 | </ul> |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | |
499 | 499 | foreach ($message['custom_fields']['below_signature'] as $custom) |
500 | 500 | echo ' |
501 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
501 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
502 | 502 | |
503 | 503 | echo ' |
504 | 504 | </ul> |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | while ($message = $context['get_pmessage']('subject')) |
631 | 631 | { |
632 | 632 | echo ' |
633 | - <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','"> |
|
633 | + <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '"> |
|
634 | 634 | <td class="table_icon"> |
635 | 635 | <script> |
636 | 636 | currentLabels[', $message['id'], '] = {'; |
@@ -902,12 +902,12 @@ discard block |
||
902 | 902 | // You can only reply if they are not a guest... |
903 | 903 | if (!$message['member']['is_guest']) |
904 | 904 | echo ' |
905 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
|
906 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
|
905 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], ' |
|
906 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator']; |
|
907 | 907 | // This is for "forwarding" - even if the member is gone. |
908 | 908 | else |
909 | 909 | echo ' |
910 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
|
910 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator']; |
|
911 | 911 | } |
912 | 912 | |
913 | 913 | echo ' |
@@ -1007,7 +1007,7 @@ discard block |
||
1007 | 1007 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
1008 | 1008 | <dl> |
1009 | 1009 | <dt> |
1010 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
1010 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
1011 | 1011 | </dt> |
1012 | 1012 | <dd class="error" id="error_list"> |
1013 | 1013 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
1064 | 1064 | </dt> |
1065 | 1065 | <dd id="pm_subject"> |
1066 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
1066 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
1067 | 1067 | </dd> |
1068 | 1068 | </dl><hr>'; |
1069 | 1069 | |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | echo ' |
1427 | 1427 | <div class="padding"> |
1428 | 1428 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit"> |
1429 | - <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure"> |
|
1429 | + <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button_submit you_sure"> |
|
1430 | 1430 | </div>'; |
1431 | 1431 | |
1432 | 1432 | echo ' |
@@ -1590,7 +1590,7 @@ discard block |
||
1590 | 1590 | if (!empty($context['rules'])) |
1591 | 1591 | echo ' |
1592 | 1592 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1593 | - <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">'; |
|
1593 | + <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button_submit smalltext you_sure">'; |
|
1594 | 1594 | |
1595 | 1595 | echo ' |
1596 | 1596 | </div> |
@@ -1831,9 +1831,9 @@ discard block |
||
1831 | 1831 | |
1832 | 1832 | echo ' |
1833 | 1833 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
1834 | - <option value="">', $txt['pm_rule_sel_action'] , ':</option> |
|
1835 | - <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option> |
|
1836 | - <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option> |
|
1834 | + <option value="">', $txt['pm_rule_sel_action'], ':</option> |
|
1835 | + <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option> |
|
1836 | + <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option> |
|
1837 | 1837 | </select> |
1838 | 1838 | <span id="labdiv', $k, '"> |
1839 | 1839 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
@@ -1945,7 +1945,7 @@ discard block |
||
1945 | 1945 | </div> |
1946 | 1946 | <ul class="quickbuttons"> |
1947 | 1947 | <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li> |
1948 | - <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1948 | + <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1949 | 1949 | </ul> |
1950 | 1950 | </div>'; |
1951 | 1951 | } |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | <div id="personal_messages">'; |
22 | 22 | |
23 | 23 | // Show the capacity bar, if available. |
24 | - if (!empty($context['limit_bar'])) |
|
25 | - echo ' |
|
24 | + if (!empty($context['limit_bar'])) { |
|
25 | + echo ' |
|
26 | 26 | <div class="cat_bar"> |
27 | 27 | <h3 class="catbg"> |
28 | 28 | <span class="floatleft">', $txt['pm_capacity'], ':</span> |
@@ -32,14 +32,16 @@ discard block |
||
32 | 32 | <span class="floatright', $context['limit_bar']['percent'] > 90 ? ' alert' : '', '">', $context['limit_bar']['text'], '</span> |
33 | 33 | </h3> |
34 | 34 | </div>'; |
35 | + } |
|
35 | 36 | |
36 | 37 | // Message sent? Show a small indication. |
37 | - if (isset($context['pm_sent'])) |
|
38 | - echo ' |
|
38 | + if (isset($context['pm_sent'])) { |
|
39 | + echo ' |
|
39 | 40 | <div class="infobox"> |
40 | 41 | ', $txt['pm_sent'], ' |
41 | 42 | </div>'; |
42 | -} |
|
43 | + } |
|
44 | + } |
|
43 | 45 | |
44 | 46 | /** |
45 | 47 | * Just the end of the index bar, nothing special. |
@@ -72,8 +74,7 @@ discard block |
||
72 | 74 | { |
73 | 75 | echo ' |
74 | 76 | <div class="no_unread">', $txt['pm_no_unread'], '</div>'; |
75 | - } |
|
76 | - else |
|
77 | + } else |
|
77 | 78 | { |
78 | 79 | foreach ($context['unread_pms'] as $id_pm => $pm_details) |
79 | 80 | { |
@@ -193,14 +194,15 @@ discard block |
||
193 | 194 | if ($context['get_pmessage']('message', true)) |
194 | 195 | { |
195 | 196 | // Show the helpful titlebar - generally. |
196 | - if ($context['display_mode'] != 1) |
|
197 | - echo ' |
|
197 | + if ($context['display_mode'] != 1) { |
|
198 | + echo ' |
|
198 | 199 | <div class="cat_bar"> |
199 | 200 | <h3 class="catbg"> |
200 | 201 | <span id="author">', $txt['author'], '</span> |
201 | 202 | <span id="topic_title">', $txt[$context['display_mode'] == 0 ? 'messages' : 'conversation'], '</span> |
202 | 203 | </h3> |
203 | 204 | </div>'; |
205 | + } |
|
204 | 206 | |
205 | 207 | // Show a few buttons if we are in conversation mode and outputting the first message. |
206 | 208 | if ($context['display_mode'] == 2) |
@@ -229,9 +231,10 @@ discard block |
||
229 | 231 | <div class="custom_fields_above_member"> |
230 | 232 | <ul class="nolist">'; |
231 | 233 | |
232 | - foreach ($message['custom_fields']['above_member'] as $custom) |
|
233 | - echo ' |
|
234 | + foreach ($message['custom_fields']['above_member'] as $custom) { |
|
235 | + echo ' |
|
234 | 236 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
237 | + } |
|
235 | 238 | |
236 | 239 | echo ' |
237 | 240 | </ul> |
@@ -243,9 +246,10 @@ discard block |
||
243 | 246 | <a id="msg', $message['id'], '"></a>'; |
244 | 247 | |
245 | 248 | // Show online and offline buttons? |
246 | - if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) |
|
247 | - echo ' |
|
249 | + if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest']) { |
|
250 | + echo ' |
|
248 | 251 | <span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>'; |
252 | + } |
|
249 | 253 | |
250 | 254 | // Show a link to the member's profile (but only if the sender isn't a guest). |
251 | 255 | echo ' |
@@ -258,48 +262,56 @@ discard block |
||
258 | 262 | <ul class="user_info">'; |
259 | 263 | |
260 | 264 | // Show the user's avatar. |
261 | - if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) |
|
262 | - echo ' |
|
265 | + if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image'])) { |
|
266 | + echo ' |
|
263 | 267 | <li class="avatar"> |
264 | 268 | <a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">', $message['member']['avatar']['image'], '</a> |
265 | 269 | </li>'; |
270 | + } |
|
266 | 271 | |
267 | 272 | // Are there any custom fields below the avatar? |
268 | - if (!empty($message['custom_fields']['below_avatar'])) |
|
269 | - foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
273 | + if (!empty($message['custom_fields']['below_avatar'])) { |
|
274 | + foreach ($message['custom_fields']['below_avatar'] as $custom) |
|
270 | 275 | echo ' |
271 | 276 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
277 | + } |
|
272 | 278 | |
273 | - if (!$message['member']['is_guest']) |
|
274 | - echo ' |
|
279 | + if (!$message['member']['is_guest']) { |
|
280 | + echo ' |
|
275 | 281 | <li class="icons">', $message['member']['group_icons'], '</li>'; |
282 | + } |
|
276 | 283 | // Show the member's primary group (like 'Administrator') if they have one. |
277 | - if (isset($message['member']['group']) && $message['member']['group'] != '') |
|
278 | - echo ' |
|
284 | + if (isset($message['member']['group']) && $message['member']['group'] != '') { |
|
285 | + echo ' |
|
279 | 286 | <li class="membergroup">', $message['member']['group'], '</li>'; |
287 | + } |
|
280 | 288 | |
281 | 289 | // Show the member's custom title, if they have one. |
282 | - if (isset($message['member']['title']) && $message['member']['title'] != '') |
|
283 | - echo ' |
|
290 | + if (isset($message['member']['title']) && $message['member']['title'] != '') { |
|
291 | + echo ' |
|
284 | 292 | <li class="title">', $message['member']['title'], '</li>'; |
293 | + } |
|
285 | 294 | |
286 | 295 | // Don't show these things for guests. |
287 | 296 | if (!$message['member']['is_guest']) |
288 | 297 | { |
289 | 298 | // Show the post group if and only if they have no other group or the option is on, and they are in a post group. |
290 | - if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') |
|
291 | - echo ' |
|
299 | + if ((empty($modSettings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '') { |
|
300 | + echo ' |
|
292 | 301 | <li class="postgroup">', $message['member']['post_group'], '</li>'; |
302 | + } |
|
293 | 303 | |
294 | 304 | // Show how many posts they have made. |
295 | - if (!isset($context['disabled_fields']['posts'])) |
|
296 | - echo ' |
|
305 | + if (!isset($context['disabled_fields']['posts'])) { |
|
306 | + echo ' |
|
297 | 307 | <li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>'; |
308 | + } |
|
298 | 309 | |
299 | 310 | // Show their personal text? |
300 | - if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') |
|
301 | - echo ' |
|
311 | + if (!empty($modSettings['show_blurb']) && $message['member']['blurb'] != '') { |
|
312 | + echo ' |
|
302 | 313 | <li class="blurb">', $message['member']['blurb'], '</li>'; |
314 | + } |
|
303 | 315 | |
304 | 316 | // Any custom fields to show as icons? |
305 | 317 | if (!empty($message['custom_fields']['icons'])) |
@@ -308,9 +320,10 @@ discard block |
||
308 | 320 | <li class="im_icons"> |
309 | 321 | <ol>'; |
310 | 322 | |
311 | - foreach ($message['custom_fields']['icons'] as $custom) |
|
312 | - echo ' |
|
323 | + foreach ($message['custom_fields']['icons'] as $custom) { |
|
324 | + echo ' |
|
313 | 325 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
326 | + } |
|
314 | 327 | |
315 | 328 | echo ' |
316 | 329 | </ol> |
@@ -318,19 +331,22 @@ discard block |
||
318 | 331 | } |
319 | 332 | |
320 | 333 | // Show the IP to this user for this post - because you can moderate? |
321 | - if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) |
|
322 | - echo ' |
|
334 | + if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip'])) { |
|
335 | + echo ' |
|
323 | 336 | <li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>'; |
337 | + } |
|
324 | 338 | |
325 | 339 | // Or, should we show it because this is you? |
326 | - elseif ($message['can_see_ip']) |
|
327 | - echo ' |
|
340 | + elseif ($message['can_see_ip']) { |
|
341 | + echo ' |
|
328 | 342 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>'; |
343 | + } |
|
329 | 344 | |
330 | 345 | // Okay, you are logged in, then we can show something about why IPs are logged... |
331 | - else |
|
332 | - echo ' |
|
346 | + else { |
|
347 | + echo ' |
|
333 | 348 | <li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>'; |
349 | + } |
|
334 | 350 | |
335 | 351 | // Show the profile, website, email address, and personal message buttons. |
336 | 352 | if ($message['member']['show_profile_buttons']) |
@@ -340,24 +356,28 @@ discard block |
||
340 | 356 | <ol class="profile_icons">'; |
341 | 357 | |
342 | 358 | // Show the profile button |
343 | - if ($message['member']['can_view_profile']) |
|
344 | - echo ' |
|
359 | + if ($message['member']['can_view_profile']) { |
|
360 | + echo ' |
|
345 | 361 | <li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '">' : $txt['view_profile']), '</a></li>'; |
362 | + } |
|
346 | 363 | |
347 | 364 | // Don't show an icon if they haven't specified a website. |
348 | - if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) |
|
349 | - echo ' |
|
365 | + if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website'])) { |
|
366 | + echo ' |
|
350 | 367 | <li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<span class="generic_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>'; |
368 | + } |
|
351 | 369 | |
352 | 370 | // Don't show the email address if they want it hidden. |
353 | - if ($message['member']['show_email']) |
|
354 | - echo ' |
|
371 | + if ($message['member']['show_email']) { |
|
372 | + echo ' |
|
355 | 373 | <li><a href="mailto:', $message['member']['email'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="generic_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>'; |
374 | + } |
|
356 | 375 | |
357 | 376 | // Since we know this person isn't a guest, you *can* message them. |
358 | - if ($context['can_send_pm']) |
|
359 | - echo ' |
|
377 | + if ($context['can_send_pm']) { |
|
378 | + echo ' |
|
360 | 379 | <li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<span class="generic_icons im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . ' centericon" title="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '"></span> ' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>'; |
380 | + } |
|
361 | 381 | |
362 | 382 | echo ' |
363 | 383 | </ol> |
@@ -365,21 +385,24 @@ discard block |
||
365 | 385 | } |
366 | 386 | |
367 | 387 | // Any custom fields for standard placement? |
368 | - if (!empty($message['custom_fields']['standard'])) |
|
369 | - foreach ($message['custom_fields']['standard'] as $custom) |
|
388 | + if (!empty($message['custom_fields']['standard'])) { |
|
389 | + foreach ($message['custom_fields']['standard'] as $custom) |
|
370 | 390 | echo ' |
371 | 391 | <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
392 | + } |
|
372 | 393 | |
373 | 394 | // Are we showing the warning status? |
374 | - if ($message['member']['can_see_warning']) |
|
375 | - echo ' |
|
395 | + if ($message['member']['can_see_warning']) { |
|
396 | + echo ' |
|
376 | 397 | <li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="generic_icons warning_', $message['member']['warning_status'], '"></span>', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>'; |
398 | + } |
|
377 | 399 | |
378 | 400 | // Are there any custom fields to show at the bottom of the poster info? |
379 | - if (!empty($message['custom_fields']['bottom_poster'])) |
|
380 | - foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
401 | + if (!empty($message['custom_fields']['bottom_poster'])) { |
|
402 | + foreach ($message['custom_fields']['bottom_poster'] as $custom) |
|
381 | 403 | echo ' |
382 | 404 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
405 | + } |
|
383 | 406 | } |
384 | 407 | |
385 | 408 | // Done with the information about the poster... on to the post itself. |
@@ -398,24 +421,28 @@ discard block |
||
398 | 421 | <span class="smalltext">« <strong> ', $txt['sent_to'], ':</strong> '; |
399 | 422 | |
400 | 423 | // People it was sent directly to.... |
401 | - if (!empty($message['recipients']['to'])) |
|
402 | - echo implode(', ', $message['recipients']['to']); |
|
424 | + if (!empty($message['recipients']['to'])) { |
|
425 | + echo implode(', ', $message['recipients']['to']); |
|
426 | + } |
|
403 | 427 | // Otherwise, we're just going to say "some people"... |
404 | - elseif ($context['folder'] != 'sent') |
|
405 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
428 | + elseif ($context['folder'] != 'sent') { |
|
429 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
430 | + } |
|
406 | 431 | |
407 | 432 | echo ' |
408 | 433 | <strong> ', $txt['on'], ':</strong> ', $message['time'], ' » |
409 | 434 | </span>'; |
410 | 435 | |
411 | 436 | // If we're in the sent items, show who it was sent to besides the "To:" people. |
412 | - if (!empty($message['recipients']['bcc'])) |
|
413 | - echo ' |
|
437 | + if (!empty($message['recipients']['bcc'])) { |
|
438 | + echo ' |
|
414 | 439 | <br><span class="smalltext">« <strong> ', $txt['pm_bcc'], ':</strong> ', implode(', ', $message['recipients']['bcc']), ' »</span>'; |
440 | + } |
|
415 | 441 | |
416 | - if (!empty($message['is_replied_to'])) |
|
417 | - echo ' |
|
442 | + if (!empty($message['is_replied_to'])) { |
|
443 | + echo ' |
|
418 | 444 | <br><span class="smalltext">« ', $context['folder'] == 'sent' ? $txt['pm_sent_is_replied_to'] : $txt['pm_is_replied_to'], ' »</span>'; |
445 | + } |
|
419 | 446 | |
420 | 447 | echo ' |
421 | 448 | </div> |
@@ -423,13 +450,15 @@ discard block |
||
423 | 450 | <div class="post"> |
424 | 451 | <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>'; |
425 | 452 | |
426 | - if ($message['can_report'] || $context['can_send_pm']) |
|
427 | - echo ' |
|
453 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
454 | + echo ' |
|
428 | 455 | <div class="under_message">'; |
456 | + } |
|
429 | 457 | |
430 | - if ($message['can_report']) |
|
431 | - echo ' |
|
458 | + if ($message['can_report']) { |
|
459 | + echo ' |
|
432 | 460 | <a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="floatright">' . $txt['pm_report_to_admin'] . '</a>'; |
461 | + } |
|
433 | 462 | |
434 | 463 | echo ' |
435 | 464 | <ul class="quickbuttons">'; |
@@ -441,32 +470,36 @@ discard block |
||
441 | 470 | if (!$message['member']['is_guest']) |
442 | 471 | { |
443 | 472 | // Is there than more than one recipient you can reply to? |
444 | - if ($message['number_recipients'] > 1) |
|
445 | - echo ' |
|
473 | + if ($message['number_recipients'] > 1) { |
|
474 | + echo ' |
|
446 | 475 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all"><span class="generic_icons reply_all_button"></span>', $txt['reply_to_all'], '</a></li>'; |
476 | + } |
|
447 | 477 | |
448 | 478 | echo ' |
449 | 479 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '"><span class="generic_icons reply_button"></span>', $txt['reply'], '</a></li> |
450 | 480 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '"><span class="generic_icons quote"></span>', $txt['quote_action'], '</a></li>'; |
451 | 481 | } |
452 | 482 | // This is for "forwarding" - even if the member is gone. |
453 | - else |
|
454 | - echo ' |
|
483 | + else { |
|
484 | + echo ' |
|
455 | 485 | <li><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote"><span class="generic_icons quote"></span>', $txt['reply_quote'], '</a></li>'; |
486 | + } |
|
456 | 487 | } |
457 | 488 | echo ' |
458 | 489 | <li><a href="', $scripturl, '?action=pm;sa=pmactions;pm_actions%5b', $message['id'], '%5D=delete;f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', addslashes($txt['remove_message_question']), '" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['delete'], '</a></li>'; |
459 | 490 | |
460 | - if (empty($context['display_mode'])) |
|
461 | - echo ' |
|
491 | + if (empty($context['display_mode'])) { |
|
492 | + echo ' |
|
462 | 493 | <li><input type="checkbox" name="pms[]" id="deletedisplay', $message['id'], '" value="', $message['id'], '" onclick="document.getElementById(\'deletelisting', $message['id'], '\').checked = this.checked;"></li>'; |
494 | + } |
|
463 | 495 | |
464 | 496 | echo ' |
465 | 497 | </ul>'; |
466 | 498 | |
467 | - if ($message['can_report'] || $context['can_send_pm']) |
|
468 | - echo ' |
|
499 | + if ($message['can_report'] || $context['can_send_pm']) { |
|
500 | + echo ' |
|
469 | 501 | </div>'; |
502 | + } |
|
470 | 503 | |
471 | 504 | // Are there any custom profile fields for above the signature? |
472 | 505 | if (!empty($message['custom_fields']['above_signature'])) |
@@ -475,9 +508,10 @@ discard block |
||
475 | 508 | <div class="custom_fields_above_signature"> |
476 | 509 | <ul class="nolist">'; |
477 | 510 | |
478 | - foreach ($message['custom_fields']['above_signature'] as $custom) |
|
479 | - echo ' |
|
511 | + foreach ($message['custom_fields']['above_signature'] as $custom) { |
|
512 | + echo ' |
|
480 | 513 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
514 | + } |
|
481 | 515 | |
482 | 516 | echo ' |
483 | 517 | </ul> |
@@ -485,9 +519,10 @@ discard block |
||
485 | 519 | } |
486 | 520 | |
487 | 521 | // Show the member's signature? |
488 | - if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) |
|
489 | - echo ' |
|
522 | + if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled']) { |
|
523 | + echo ' |
|
490 | 524 | <div class="signature">', $message['member']['signature'], '</div>'; |
525 | + } |
|
491 | 526 | |
492 | 527 | // Are there any custom profile fields for below the signature? |
493 | 528 | if (!empty($message['custom_fields']['below_signature'])) |
@@ -496,9 +531,10 @@ discard block |
||
496 | 531 | <div class="custom_fields_below_signature"> |
497 | 532 | <ul class="nolist">'; |
498 | 533 | |
499 | - foreach ($message['custom_fields']['below_signature'] as $custom) |
|
500 | - echo ' |
|
534 | + foreach ($message['custom_fields']['below_signature'] as $custom) { |
|
535 | + echo ' |
|
501 | 536 | <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
537 | + } |
|
502 | 538 | |
503 | 539 | echo ' |
504 | 540 | </ul> |
@@ -523,19 +559,21 @@ discard block |
||
523 | 559 | { |
524 | 560 | echo ' |
525 | 561 | <option value="" disabled>', $txt['pm_msg_label_apply'], ':</option>'; |
526 | - foreach ($context['labels'] as $label) |
|
527 | - if (!isset($message['labels'][$label['id']])) |
|
562 | + foreach ($context['labels'] as $label) { |
|
563 | + if (!isset($message['labels'][$label['id']])) |
|
528 | 564 | echo ' |
529 | 565 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
566 | + } |
|
530 | 567 | } |
531 | 568 | // ... and are there any that can be removed? |
532 | 569 | if (!empty($message['labels']) && (count($message['labels']) > 1 || !isset($message['labels'][-1]))) |
533 | 570 | { |
534 | 571 | echo ' |
535 | 572 | <option value="" disabled>', $txt['pm_msg_label_remove'], ':</option>'; |
536 | - foreach ($message['labels'] as $label) |
|
537 | - echo ' |
|
573 | + foreach ($message['labels'] as $label) { |
|
574 | + echo ' |
|
538 | 575 | <option value="', $label['id'], '"> ', $label['name'], '</option>'; |
576 | + } |
|
539 | 577 | } |
540 | 578 | echo ' |
541 | 579 | </select> |
@@ -555,13 +593,14 @@ discard block |
||
555 | 593 | </div>'; |
556 | 594 | } |
557 | 595 | |
558 | - if (empty($context['display_mode'])) |
|
559 | - echo ' |
|
596 | + if (empty($context['display_mode'])) { |
|
597 | + echo ' |
|
560 | 598 | |
561 | 599 | <div class="pagesection"> |
562 | 600 | <div class="floatleft">', $context['page_index'], '</div> |
563 | 601 | <div class="floatright"><input type="submit" name="del_selected" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" onclick="if (!confirm(\'', $txt['delete_selected_confirm'], '\')) return false;" class="button_submit"></div> |
564 | 602 | </div>'; |
603 | + } |
|
565 | 604 | |
566 | 605 | // Show a few buttons if we are in conversation mode and outputting the first message. |
567 | 606 | elseif ($context['display_mode'] == 2 && isset($context['conversation_buttons'])) |
@@ -621,11 +660,12 @@ discard block |
||
621 | 660 | </tr> |
622 | 661 | </thead> |
623 | 662 | <tbody>'; |
624 | - if (!$context['show_delete']) |
|
625 | - echo ' |
|
663 | + if (!$context['show_delete']) { |
|
664 | + echo ' |
|
626 | 665 | <tr class="windowbg"> |
627 | 666 | <td colspan="5">', $txt['pm_alert_none'], '</td> |
628 | 667 | </tr>'; |
668 | + } |
|
629 | 669 | |
630 | 670 | while ($message = $context['get_pmessage']('subject')) |
631 | 671 | { |
@@ -678,9 +718,10 @@ discard block |
||
678 | 718 | |
679 | 719 | foreach ($context['labels'] as $label) |
680 | 720 | { |
681 | - if ($label['id'] != $context['current_label_id']) |
|
682 | - echo ' |
|
721 | + if ($label['id'] != $context['current_label_id']) { |
|
722 | + echo ' |
|
683 | 723 | <option value="add_', $label['id'], '"> ', $label['name'], '</option>'; |
724 | + } |
|
684 | 725 | } |
685 | 726 | |
686 | 727 | echo ' |
@@ -765,9 +806,10 @@ discard block |
||
765 | 806 | <dt class="between">', $txt['pm_search_post_age'], ':</dt> |
766 | 807 | <dd>', $txt['pm_search_between'], ' <input type="number" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" min="0" max="9999"> ', $txt['pm_search_between_and'], ' <input type="number" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" min="0" max="9999"> ', $txt['pm_search_between_days'], '</dd> |
767 | 808 | </dl>'; |
768 | - if (!$context['currently_using_labels']) |
|
769 | - echo ' |
|
809 | + if (!$context['currently_using_labels']) { |
|
810 | + echo ' |
|
770 | 811 | <input type="submit" name="pm_search" value="', $txt['pm_search_go'], '" class="button_submit">'; |
812 | + } |
|
771 | 813 | echo ' |
772 | 814 | <br class="clear_right"> |
773 | 815 | </div> |
@@ -787,12 +829,13 @@ discard block |
||
787 | 829 | <div id="advanced_panel_div"> |
788 | 830 | <ul id="searchLabelsExpand">'; |
789 | 831 | |
790 | - foreach ($context['search_labels'] as $label) |
|
791 | - echo ' |
|
832 | + foreach ($context['search_labels'] as $label) { |
|
833 | + echo ' |
|
792 | 834 | <li> |
793 | 835 | <label for="searchlabel_', $label['id'], '"><input type="checkbox" id="searchlabel_', $label['id'], '" name="searchlabel[', $label['id'], ']" value="', $label['id'], '"', $label['checked'] ? ' checked' : '', '> |
794 | 836 | ', $label['name'], '</label> |
795 | 837 | </li>'; |
838 | + } |
|
796 | 839 | |
797 | 840 | echo ' |
798 | 841 | </ul> |
@@ -852,8 +895,8 @@ discard block |
||
852 | 895 | </div>'; |
853 | 896 | |
854 | 897 | // complete results ? |
855 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
856 | - echo ' |
|
898 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
899 | + echo ' |
|
857 | 900 | <table class="table_grid"> |
858 | 901 | <thead> |
859 | 902 | <tr class="title_bar"> |
@@ -863,6 +906,7 @@ discard block |
||
863 | 906 | </tr> |
864 | 907 | </thead> |
865 | 908 | <tbody>'; |
909 | + } |
|
866 | 910 | |
867 | 911 | // Print each message out... |
868 | 912 | foreach ($context['personal_messages'] as $message) |
@@ -882,11 +926,13 @@ discard block |
||
882 | 926 | |
883 | 927 | // Show the recipients. |
884 | 928 | // @todo This doesn't deal with the sent item searching quite right for bcc. |
885 | - if (!empty($message['recipients']['to'])) |
|
886 | - echo implode(', ', $message['recipients']['to']); |
|
929 | + if (!empty($message['recipients']['to'])) { |
|
930 | + echo implode(', ', $message['recipients']['to']); |
|
931 | + } |
|
887 | 932 | // Otherwise, we're just going to say "some people"... |
888 | - elseif ($context['folder'] != 'sent') |
|
889 | - echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
933 | + elseif ($context['folder'] != 'sent') { |
|
934 | + echo '(', $txt['pm_undisclosed_recipients'], ')'; |
|
935 | + } |
|
890 | 936 | |
891 | 937 | echo ' |
892 | 938 | </h3> |
@@ -900,14 +946,16 @@ discard block |
||
900 | 946 | $quote_button = create_button('quote.png', 'reply_quote', 'reply_quote', 'class="centericon"'); |
901 | 947 | $reply_button = create_button('im_reply.png', 'reply', 'reply', 'class="centericon"'); |
902 | 948 | // You can only reply if they are not a guest... |
903 | - if (!$message['member']['is_guest']) |
|
904 | - echo ' |
|
949 | + if (!$message['member']['is_guest']) { |
|
950 | + echo ' |
|
905 | 951 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
906 | 952 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
953 | + } |
|
907 | 954 | // This is for "forwarding" - even if the member is gone. |
908 | - else |
|
909 | - echo ' |
|
955 | + else { |
|
956 | + echo ' |
|
910 | 957 | <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
958 | + } |
|
911 | 959 | } |
912 | 960 | |
913 | 961 | echo ' |
@@ -928,17 +976,19 @@ discard block |
||
928 | 976 | } |
929 | 977 | |
930 | 978 | // Finish off the page... |
931 | - if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) |
|
932 | - echo ' |
|
979 | + if (empty($context['search_params']['show_complete']) && !empty($context['personal_messages'])) { |
|
980 | + echo ' |
|
933 | 981 | </tbody> |
934 | 982 | </table>'; |
983 | + } |
|
935 | 984 | |
936 | 985 | // No results? |
937 | - if (empty($context['personal_messages'])) |
|
938 | - echo ' |
|
986 | + if (empty($context['personal_messages'])) { |
|
987 | + echo ' |
|
939 | 988 | <div class="windowbg"> |
940 | 989 | <p class="centertext">', $txt['pm_search_none_found'], '</p> |
941 | 990 | </div>'; |
991 | + } |
|
942 | 992 | |
943 | 993 | echo ' |
944 | 994 | <div class="pagesection"> |
@@ -962,12 +1012,14 @@ discard block |
||
962 | 1012 | <h3 class="catbg">', $txt['pm_send_report'], '</h3> |
963 | 1013 | </div> |
964 | 1014 | <div class="windowbg">'; |
965 | - if (!empty($context['send_log']['sent'])) |
|
966 | - foreach ($context['send_log']['sent'] as $log_entry) |
|
1015 | + if (!empty($context['send_log']['sent'])) { |
|
1016 | + foreach ($context['send_log']['sent'] as $log_entry) |
|
967 | 1017 | echo '<span class="error">', $log_entry, '</span><br>'; |
968 | - if (!empty($context['send_log']['failed'])) |
|
969 | - foreach ($context['send_log']['failed'] as $log_entry) |
|
1018 | + } |
|
1019 | + if (!empty($context['send_log']['failed'])) { |
|
1020 | + foreach ($context['send_log']['failed'] as $log_entry) |
|
970 | 1021 | echo '<span class="error">', $log_entry, '</span><br>'; |
1022 | + } |
|
971 | 1023 | echo ' |
972 | 1024 | </div> |
973 | 1025 | <br>'; |
@@ -1015,12 +1067,13 @@ discard block |
||
1015 | 1067 | </dl> |
1016 | 1068 | </div>'; |
1017 | 1069 | |
1018 | - if (!empty($modSettings['drafts_pm_enabled'])) |
|
1019 | - echo ' |
|
1070 | + if (!empty($modSettings['drafts_pm_enabled'])) { |
|
1071 | + echo ' |
|
1020 | 1072 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
1021 | 1073 | sprintf($txt['draft_pm_saved'], $scripturl . '?action=pm;sa=showpmdrafts'), ' |
1022 | 1074 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
1023 | 1075 | </div>'; |
1076 | + } |
|
1024 | 1077 | |
1025 | 1078 | echo ' |
1026 | 1079 | <dl id="post_header">'; |
@@ -1075,9 +1128,10 @@ discard block |
||
1075 | 1128 | } |
1076 | 1129 | |
1077 | 1130 | // What about smileys? |
1078 | - if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) |
|
1079 | - echo ' |
|
1131 | + if (!empty($context['smileys']['postform']) || !empty($context['smileys']['popup'])) { |
|
1132 | + echo ' |
|
1080 | 1133 | <div id="smileyBox_message"></div>'; |
1134 | + } |
|
1081 | 1135 | |
1082 | 1136 | // Show BBC buttons, smileys and textbox. |
1083 | 1137 | echo ' |
@@ -1124,10 +1178,11 @@ discard block |
||
1124 | 1178 | <dt><strong>', $txt['subject'], '</strong></dt> |
1125 | 1179 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
1126 | 1180 | |
1127 | - foreach ($context['drafts'] as $draft) |
|
1128 | - echo ' |
|
1181 | + foreach ($context['drafts'] as $draft) { |
|
1182 | + echo ' |
|
1129 | 1183 | <dt>', $draft['link'], '</dt> |
1130 | 1184 | <dd>', $draft['poster_time'], '</dd>'; |
1185 | + } |
|
1131 | 1186 | echo ' |
1132 | 1187 | </dl> |
1133 | 1188 | </div>'; |
@@ -1233,8 +1288,8 @@ discard block |
||
1233 | 1288 | }'; |
1234 | 1289 | |
1235 | 1290 | // Code for showing and hiding drafts |
1236 | - if (!empty($context['drafts'])) |
|
1237 | - echo ' |
|
1291 | + if (!empty($context['drafts'])) { |
|
1292 | + echo ' |
|
1238 | 1293 | var oSwapDraftOptions = new smc_Toggle({ |
1239 | 1294 | bToggleEnabled: true, |
1240 | 1295 | bCurrentlyCollapsed: true, |
@@ -1256,13 +1311,14 @@ discard block |
||
1256 | 1311 | } |
1257 | 1312 | ] |
1258 | 1313 | });'; |
1314 | + } |
|
1259 | 1315 | |
1260 | 1316 | echo ' |
1261 | 1317 | </script>'; |
1262 | 1318 | |
1263 | 1319 | // Show the message you're replying to. |
1264 | - if ($context['reply']) |
|
1265 | - echo ' |
|
1320 | + if ($context['reply']) { |
|
1321 | + echo ' |
|
1266 | 1322 | <br> |
1267 | 1323 | <br> |
1268 | 1324 | <div class="cat_bar"> |
@@ -1276,6 +1332,7 @@ discard block |
||
1276 | 1332 | <hr> |
1277 | 1333 | ', $context['quoted_message']['body'], ' |
1278 | 1334 | </div><br class="clear">'; |
1335 | + } |
|
1279 | 1336 | |
1280 | 1337 | echo ' |
1281 | 1338 | <script> |
@@ -1286,22 +1343,24 @@ discard block |
||
1286 | 1343 | sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\', |
1287 | 1344 | sToControlId: \'to_control\', |
1288 | 1345 | aToRecipients: ['; |
1289 | - foreach ($context['recipients']['to'] as $i => $member) |
|
1290 | - echo ' |
|
1346 | + foreach ($context['recipients']['to'] as $i => $member) { |
|
1347 | + echo ' |
|
1291 | 1348 | { |
1292 | 1349 | sItemId: ', JavaScriptEscape($member['id']), ', |
1293 | 1350 | sItemName: ', JavaScriptEscape($member['name']), ' |
1294 | 1351 | }', $i == count($context['recipients']['to']) - 1 ? '' : ','; |
1352 | + } |
|
1295 | 1353 | |
1296 | 1354 | echo ' |
1297 | 1355 | ], |
1298 | 1356 | aBccRecipients: ['; |
1299 | - foreach ($context['recipients']['bcc'] as $i => $member) |
|
1300 | - echo ' |
|
1357 | + foreach ($context['recipients']['bcc'] as $i => $member) { |
|
1358 | + echo ' |
|
1301 | 1359 | { |
1302 | 1360 | sItemId: ', JavaScriptEscape($member['id']), ', |
1303 | 1361 | sItemName: ', JavaScriptEscape($member['name']), ' |
1304 | 1362 | }', $i == count($context['recipients']['bcc']) - 1 ? '' : ','; |
1363 | + } |
|
1305 | 1364 | |
1306 | 1365 | echo ' |
1307 | 1366 | ], |
@@ -1388,26 +1447,28 @@ discard block |
||
1388 | 1447 | </th> |
1389 | 1448 | <th class="centertext table_icon">'; |
1390 | 1449 | |
1391 | - if (count($context['labels']) > 2) |
|
1392 | - echo ' |
|
1450 | + if (count($context['labels']) > 2) { |
|
1451 | + echo ' |
|
1393 | 1452 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
1453 | + } |
|
1394 | 1454 | |
1395 | 1455 | echo ' |
1396 | 1456 | </th> |
1397 | 1457 | </tr> |
1398 | 1458 | </thead> |
1399 | 1459 | <tbody>'; |
1400 | - if (count($context['labels']) < 2) |
|
1401 | - echo ' |
|
1460 | + if (count($context['labels']) < 2) { |
|
1461 | + echo ' |
|
1402 | 1462 | <tr class="windowbg"> |
1403 | 1463 | <td colspan="2">', $txt['pm_labels_no_exist'], '</td> |
1404 | 1464 | </tr>'; |
1405 | - else |
|
1465 | + } else |
|
1406 | 1466 | { |
1407 | 1467 | foreach ($context['labels'] as $label) |
1408 | 1468 | { |
1409 | - if ($label['id'] == -1) |
|
1410 | - continue; |
|
1469 | + if ($label['id'] == -1) { |
|
1470 | + continue; |
|
1471 | + } |
|
1411 | 1472 | |
1412 | 1473 | echo ' |
1413 | 1474 | <tr class="windowbg"> |
@@ -1422,12 +1483,13 @@ discard block |
||
1422 | 1483 | </tbody> |
1423 | 1484 | </table>'; |
1424 | 1485 | |
1425 | - if (!count($context['labels']) < 2) |
|
1426 | - echo ' |
|
1486 | + if (!count($context['labels']) < 2) { |
|
1487 | + echo ' |
|
1427 | 1488 | <div class="padding"> |
1428 | 1489 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit"> |
1429 | 1490 | <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button_submit you_sure"> |
1430 | 1491 | </div>'; |
1492 | + } |
|
1431 | 1493 | |
1432 | 1494 | echo ' |
1433 | 1495 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -1482,9 +1544,10 @@ discard block |
||
1482 | 1544 | <dd> |
1483 | 1545 | <select name="id_admin"> |
1484 | 1546 | <option value="0">', $txt['pm_report_all_admins'], '</option>'; |
1485 | - foreach ($context['admins'] as $id => $name) |
|
1486 | - echo ' |
|
1547 | + foreach ($context['admins'] as $id => $name) { |
|
1548 | + echo ' |
|
1487 | 1549 | <option value="', $id, '">', $name, '</option>'; |
1550 | + } |
|
1488 | 1551 | echo ' |
1489 | 1552 | </select> |
1490 | 1553 | </dd>'; |
@@ -1546,9 +1609,10 @@ discard block |
||
1546 | 1609 | </th> |
1547 | 1610 | <th class="centertext table_icon">'; |
1548 | 1611 | |
1549 | - if (!empty($context['rules'])) |
|
1550 | - echo ' |
|
1612 | + if (!empty($context['rules'])) { |
|
1613 | + echo ' |
|
1551 | 1614 | <input type="checkbox" onclick="invertAll(this, this.form);">'; |
1615 | + } |
|
1552 | 1616 | |
1553 | 1617 | echo ' |
1554 | 1618 | </th> |
@@ -1556,13 +1620,14 @@ discard block |
||
1556 | 1620 | </thead> |
1557 | 1621 | <tbody>'; |
1558 | 1622 | |
1559 | - if (empty($context['rules'])) |
|
1560 | - echo ' |
|
1623 | + if (empty($context['rules'])) { |
|
1624 | + echo ' |
|
1561 | 1625 | <tr class="windowbg"> |
1562 | 1626 | <td colspan="2"> |
1563 | 1627 | ', $txt['pm_rules_none'], ' |
1564 | 1628 | </td> |
1565 | 1629 | </tr>'; |
1630 | + } |
|
1566 | 1631 | |
1567 | 1632 | foreach ($context['rules'] as $rule) |
1568 | 1633 | { |
@@ -1583,14 +1648,16 @@ discard block |
||
1583 | 1648 | <div class="righttext"> |
1584 | 1649 | <a class="button_link" href="', $scripturl, '?action=pm;sa=manrules;add;rid=0">', $txt['pm_add_rule'], '</a>'; |
1585 | 1650 | |
1586 | - if (!empty($context['rules'])) |
|
1587 | - echo ' |
|
1651 | + if (!empty($context['rules'])) { |
|
1652 | + echo ' |
|
1588 | 1653 | [<a href="', $scripturl, '?action=pm;sa=manrules;apply;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['pm_js_apply_rules_confirm'], '\');">', $txt['pm_apply_rules'], '</a>]'; |
1654 | + } |
|
1589 | 1655 | |
1590 | - if (!empty($context['rules'])) |
|
1591 | - echo ' |
|
1656 | + if (!empty($context['rules'])) { |
|
1657 | + echo ' |
|
1592 | 1658 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1593 | 1659 | <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button_submit smalltext you_sure">'; |
1660 | + } |
|
1594 | 1661 | |
1595 | 1662 | echo ' |
1596 | 1663 | </div> |
@@ -1612,14 +1679,16 @@ discard block |
||
1612 | 1679 | var groups = new Array() |
1613 | 1680 | var labels = new Array()'; |
1614 | 1681 | |
1615 | - foreach ($context['groups'] as $id => $title) |
|
1616 | - echo ' |
|
1682 | + foreach ($context['groups'] as $id => $title) { |
|
1683 | + echo ' |
|
1617 | 1684 | groups[', $id, '] = "', addslashes($title), '";'; |
1685 | + } |
|
1618 | 1686 | |
1619 | - foreach ($context['labels'] as $label) |
|
1620 | - if ($label['id'] != -1) |
|
1687 | + foreach ($context['labels'] as $label) { |
|
1688 | + if ($label['id'] != -1) |
|
1621 | 1689 | echo ' |
1622 | 1690 | labels[', ($label['id']), '] = "', addslashes($label['name']), '";'; |
1691 | + } |
|
1623 | 1692 | |
1624 | 1693 | echo ' |
1625 | 1694 | function addCriteriaOption() |
@@ -1634,8 +1703,9 @@ discard block |
||
1634 | 1703 | |
1635 | 1704 | setOuterHTML(document.getElementById("criteriaAddHere"), \'<br><select name="ruletype[\' + criteriaNum + \']" id="ruletype\' + criteriaNum + \'" onchange="updateRuleDef(\' + criteriaNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_criteria_pick']), ':<\' + \'/option><option value="mid">', addslashes($txt['pm_rule_mid']), '<\' + \'/option><option value="gid">', addslashes($txt['pm_rule_gid']), '<\' + \'/option><option value="sub">', addslashes($txt['pm_rule_sub']), '<\' + \'/option><option value="msg">', addslashes($txt['pm_rule_msg']), '<\' + \'/option><option value="bud">', addslashes($txt['pm_rule_bud']), '<\' + \'/option><\' + \'/select> <span id="defdiv\' + criteriaNum + \'" style="display: none;"><input type="text" name="ruledef[\' + criteriaNum + \']" id="ruledef\' + criteriaNum + \'" onkeyup="rebuildRuleDesc();" value=""><\' + \'/span><span id="defseldiv\' + criteriaNum + \'" style="display: none;"><select name="ruledefgroup[\' + criteriaNum + \']" id="ruledefgroup\' + criteriaNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_group']), '<\' + \'/option>'; |
1636 | 1705 | |
1637 | - foreach ($context['groups'] as $id => $group) |
|
1638 | - echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
1706 | + foreach ($context['groups'] as $id => $group) { |
|
1707 | + echo '<option value="', $id, '">', strtr($group, array("'" => "\'")), '<\' + \'/option>'; |
|
1708 | + } |
|
1639 | 1709 | |
1640 | 1710 | echo '<\' + \'/select><\' + \'/span><span id="criteriaAddHere"><\' + \'/span>\'); |
1641 | 1711 | } |
@@ -1652,9 +1722,10 @@ discard block |
||
1652 | 1722 | |
1653 | 1723 | setOuterHTML(document.getElementById("actionAddHere"), \'<br><select name="acttype[\' + actionNum + \']" id="acttype\' + actionNum + \'" onchange="updateActionDef(\' + actionNum + \'); rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_action']), ':<\' + \'/option><option value="lab">', addslashes($txt['pm_rule_label']), '<\' + \'/option><option value="del">', addslashes($txt['pm_rule_delete']), '<\' + \'/option><\' + \'/select> <span id="labdiv\' + actionNum + \'" style="display: none;"><select name="labdef[\' + actionNum + \']" id="labdef\' + actionNum + \'" onchange="rebuildRuleDesc();"><option value="">', addslashes($txt['pm_rule_sel_label']), '<\' + \'/option>'; |
1654 | 1724 | |
1655 | - foreach ($context['labels'] as $label) |
|
1656 | - if ($label['id'] != -1) |
|
1725 | + foreach ($context['labels'] as $label) { |
|
1726 | + if ($label['id'] != -1) |
|
1657 | 1727 | echo '<option value="', ($label['id']), '">', addslashes($label['name']), '<\' + \'/option>'; |
1728 | + } |
|
1658 | 1729 | |
1659 | 1730 | echo '<\' + \'/select><\' + \'/span><span id="actionAddHere"><\' + \'/span>\'); |
1660 | 1731 | } |
@@ -1768,18 +1839,20 @@ discard block |
||
1768 | 1839 | $isFirst = true; |
1769 | 1840 | foreach ($context['rule']['criteria'] as $k => $criteria) |
1770 | 1841 | { |
1771 | - if (!$isFirst && $criteria['t'] == '') |
|
1772 | - echo '<div id="removeonjs1">'; |
|
1773 | - elseif (!$isFirst) |
|
1774 | - echo '<br>'; |
|
1842 | + if (!$isFirst && $criteria['t'] == '') { |
|
1843 | + echo '<div id="removeonjs1">'; |
|
1844 | + } elseif (!$isFirst) { |
|
1845 | + echo '<br>'; |
|
1846 | + } |
|
1775 | 1847 | |
1776 | 1848 | echo ' |
1777 | 1849 | <select name="ruletype[', $k, ']" id="ruletype', $k, '" onchange="updateRuleDef(', $k, '); rebuildRuleDesc();"> |
1778 | 1850 | <option value="">', $txt['pm_rule_criteria_pick'], ':</option>'; |
1779 | 1851 | |
1780 | - foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) |
|
1781 | - echo ' |
|
1852 | + foreach (array('mid', 'gid', 'sub', 'msg', 'bud') as $cr) { |
|
1853 | + echo ' |
|
1782 | 1854 | <option value="', $cr, '"', $criteria['t'] == $cr ? ' selected' : '', '>', $txt['pm_rule_' . $cr], '</option>'; |
1855 | + } |
|
1783 | 1856 | |
1784 | 1857 | echo ' |
1785 | 1858 | </select> |
@@ -1790,18 +1863,20 @@ discard block |
||
1790 | 1863 | <select name="ruledefgroup[', $k, ']" id="ruledefgroup', $k, '" onchange="rebuildRuleDesc();"> |
1791 | 1864 | <option value="">', $txt['pm_rule_sel_group'], '</option>'; |
1792 | 1865 | |
1793 | - foreach ($context['groups'] as $id => $group) |
|
1794 | - echo ' |
|
1866 | + foreach ($context['groups'] as $id => $group) { |
|
1867 | + echo ' |
|
1795 | 1868 | <option value="', $id, '"', $criteria['t'] == 'gid' && $criteria['v'] == $id ? ' selected' : '', '>', $group, '</option>'; |
1869 | + } |
|
1796 | 1870 | echo ' |
1797 | 1871 | </select> |
1798 | 1872 | </span>'; |
1799 | 1873 | |
1800 | 1874 | // If this is the dummy we add a means to hide for non js users. |
1801 | - if ($isFirst) |
|
1802 | - $isFirst = false; |
|
1803 | - elseif ($criteria['t'] == '') |
|
1804 | - echo '</div>'; |
|
1875 | + if ($isFirst) { |
|
1876 | + $isFirst = false; |
|
1877 | + } elseif ($criteria['t'] == '') { |
|
1878 | + echo '</div>'; |
|
1879 | + } |
|
1805 | 1880 | } |
1806 | 1881 | |
1807 | 1882 | echo ' |
@@ -1824,10 +1899,11 @@ discard block |
||
1824 | 1899 | $isFirst = true; |
1825 | 1900 | foreach ($context['rule']['actions'] as $k => $action) |
1826 | 1901 | { |
1827 | - if (!$isFirst && $action['t'] == '') |
|
1828 | - echo '<div id="removeonjs2">'; |
|
1829 | - elseif (!$isFirst) |
|
1830 | - echo '<br>'; |
|
1902 | + if (!$isFirst && $action['t'] == '') { |
|
1903 | + echo '<div id="removeonjs2">'; |
|
1904 | + } elseif (!$isFirst) { |
|
1905 | + echo '<br>'; |
|
1906 | + } |
|
1831 | 1907 | |
1832 | 1908 | echo ' |
1833 | 1909 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
@@ -1838,20 +1914,22 @@ discard block |
||
1838 | 1914 | <span id="labdiv', $k, '"> |
1839 | 1915 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
1840 | 1916 | <option value="">', $txt['pm_rule_sel_label'], '</option>'; |
1841 | - foreach ($context['labels'] as $label) |
|
1842 | - if ($label['id'] != -1) |
|
1917 | + foreach ($context['labels'] as $label) { |
|
1918 | + if ($label['id'] != -1) |
|
1843 | 1919 | echo ' |
1844 | 1920 | <option value="', ($label['id']), '"', $action['t'] == 'lab' && $action['v'] == $label['id'] ? ' selected' : '', '>', $label['name'], '</option>'; |
1921 | + } |
|
1845 | 1922 | |
1846 | 1923 | echo ' |
1847 | 1924 | </select> |
1848 | 1925 | </span>'; |
1849 | 1926 | |
1850 | - if ($isFirst) |
|
1851 | - $isFirst = false; |
|
1852 | - elseif ($action['t'] == '') |
|
1853 | - echo ' |
|
1927 | + if ($isFirst) { |
|
1928 | + $isFirst = false; |
|
1929 | + } elseif ($action['t'] == '') { |
|
1930 | + echo ' |
|
1854 | 1931 | </div>'; |
1932 | + } |
|
1855 | 1933 | } |
1856 | 1934 | |
1857 | 1935 | echo ' |
@@ -1875,22 +1953,25 @@ discard block |
||
1875 | 1953 | echo ' |
1876 | 1954 | <script>'; |
1877 | 1955 | |
1878 | - foreach ($context['rule']['criteria'] as $k => $c) |
|
1879 | - echo ' |
|
1956 | + foreach ($context['rule']['criteria'] as $k => $c) { |
|
1957 | + echo ' |
|
1880 | 1958 | updateRuleDef(', $k, ');'; |
1959 | + } |
|
1881 | 1960 | |
1882 | - foreach ($context['rule']['actions'] as $k => $c) |
|
1883 | - echo ' |
|
1961 | + foreach ($context['rule']['actions'] as $k => $c) { |
|
1962 | + echo ' |
|
1884 | 1963 | updateActionDef(', $k, ');'; |
1964 | + } |
|
1885 | 1965 | |
1886 | 1966 | echo ' |
1887 | 1967 | rebuildRuleDesc();'; |
1888 | 1968 | |
1889 | 1969 | // If this isn't a new rule and we have JS enabled remove the JS compatibility stuff. |
1890 | - if ($context['rid']) |
|
1891 | - echo ' |
|
1970 | + if ($context['rid']) { |
|
1971 | + echo ' |
|
1892 | 1972 | document.getElementById("removeonjs1").style.display = "none"; |
1893 | 1973 | document.getElementById("removeonjs2").style.display = "none";'; |
1974 | + } |
|
1894 | 1975 | |
1895 | 1976 | echo ' |
1896 | 1977 | document.getElementById("addonjs1").style.display = ""; |
@@ -1918,12 +1999,12 @@ discard block |
||
1918 | 1999 | </div>'; |
1919 | 2000 | |
1920 | 2001 | // No drafts? Just show an informative message. |
1921 | - if (empty($context['drafts'])) |
|
1922 | - echo ' |
|
2002 | + if (empty($context['drafts'])) { |
|
2003 | + echo ' |
|
1923 | 2004 | <div class="windowbg2 centertext"> |
1924 | 2005 | ', $txt['draft_none'], ' |
1925 | 2006 | </div>'; |
1926 | - else |
|
2007 | + } else |
|
1927 | 2008 | { |
1928 | 2009 | // For every draft to be displayed, give it its own div, and show the important details of the draft. |
1929 | 2010 | foreach ($context['drafts'] as $draft) |
@@ -55,18 +55,20 @@ discard block |
||
55 | 55 | <div class="modbox"> |
56 | 56 | <ul>'; |
57 | 57 | |
58 | - foreach ($context['group_requests'] as $request) |
|
59 | - echo ' |
|
58 | + foreach ($context['group_requests'] as $request) { |
|
59 | + echo ' |
|
60 | 60 | <li class="smalltext"> |
61 | 61 | <a href="', $request['request_href'], '">', $request['group']['name'], '</a> ', $txt['mc_groupr_by'], ' ', $request['member']['link'], ' |
62 | 62 | </li>'; |
63 | + } |
|
63 | 64 | |
64 | 65 | // Don't have any watched users right now? |
65 | - if (empty($context['group_requests'])) |
|
66 | - echo ' |
|
66 | + if (empty($context['group_requests'])) { |
|
67 | + echo ' |
|
67 | 68 | <li> |
68 | 69 | <strong class="smalltext">', $txt['mc_group_requests_none'], '</strong> |
69 | 70 | </li>'; |
71 | + } |
|
70 | 72 | |
71 | 73 | echo ' |
72 | 74 | </ul> |
@@ -124,18 +126,20 @@ discard block |
||
124 | 126 | <div class="modbox"> |
125 | 127 | <ul>'; |
126 | 128 | |
127 | - foreach ($context['watched_users'] as $user) |
|
128 | - echo ' |
|
129 | + foreach ($context['watched_users'] as $user) { |
|
130 | + echo ' |
|
129 | 131 | <li> |
130 | 132 | <span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span> |
131 | 133 | </li>'; |
134 | + } |
|
132 | 135 | |
133 | 136 | // Don't have any watched users right now? |
134 | - if (empty($context['watched_users'])) |
|
135 | - echo ' |
|
137 | + if (empty($context['watched_users'])) { |
|
138 | + echo ' |
|
136 | 139 | <li> |
137 | 140 | <strong class="smalltext">', $txt['mc_watched_users_none'], '</strong> |
138 | 141 | </li>'; |
142 | + } |
|
139 | 143 | |
140 | 144 | echo ' |
141 | 145 | </ul> |
@@ -193,18 +197,20 @@ discard block |
||
193 | 197 | <div class="modbox"> |
194 | 198 | <ul>'; |
195 | 199 | |
196 | - foreach ($context['reported_posts'] as $post) |
|
197 | - echo ' |
|
200 | + foreach ($context['reported_posts'] as $post) { |
|
201 | + echo ' |
|
198 | 202 | <li> |
199 | 203 | <span class="smalltext">', sprintf($txt['mc_post_report'], $post['report_link'], $post['author']['link']), '</span> |
200 | 204 | </li>'; |
205 | + } |
|
201 | 206 | |
202 | 207 | // Don't have any watched users right now? |
203 | - if (empty($context['reported_posts'])) |
|
204 | - echo ' |
|
208 | + if (empty($context['reported_posts'])) { |
|
209 | + echo ' |
|
205 | 210 | <li> |
206 | 211 | <strong class="smalltext">', $txt['mc_recent_reports_none'], '</strong> |
207 | 212 | </li>'; |
213 | + } |
|
208 | 214 | |
209 | 215 | echo ' |
210 | 216 | </ul> |
@@ -262,18 +268,20 @@ discard block |
||
262 | 268 | <div class="modbox"> |
263 | 269 | <ul>'; |
264 | 270 | |
265 | - foreach ($context['reported_users'] as $user) |
|
266 | - echo ' |
|
271 | + foreach ($context['reported_users'] as $user) { |
|
272 | + echo ' |
|
267 | 273 | <li> |
268 | 274 | <span class="smalltext">', $user['user']['link'], '</span> |
269 | 275 | </li>'; |
276 | + } |
|
270 | 277 | |
271 | 278 | // Don't have any watched users right now? |
272 | - if (empty($context['reported_users'])) |
|
273 | - echo ' |
|
279 | + if (empty($context['reported_users'])) { |
|
280 | + echo ' |
|
274 | 281 | <li> |
275 | 282 | <strong class="smalltext">', $txt['mc_reported_users_none'], '</strong> |
276 | 283 | </li>'; |
284 | + } |
|
277 | 285 | |
278 | 286 | echo ' |
279 | 287 | </ul> |
@@ -344,9 +352,10 @@ discard block |
||
344 | 352 | <ul class="moderation_notes">'; |
345 | 353 | |
346 | 354 | // Cycle through the notes. |
347 | - foreach ($context['notes'] as $note) |
|
348 | - echo ' |
|
355 | + foreach ($context['notes'] as $note) { |
|
356 | + echo ' |
|
349 | 357 | <li class="smalltext">', ($note['can_delete'] ? '<a href="' . $note['delete_href'] . ';' . $context['mod-modnote-del_token_var'] . '=' . $context['mod-modnote-del_token'] . '" data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '" class="you_sure"><span class="generic_icons delete"></span></a>' : ''), $note['time'], ' <strong>', $note['author']['link'], ':</strong> ', $note['text'], '</li>'; |
358 | + } |
|
350 | 359 | |
351 | 360 | echo ' |
352 | 361 | </ul> |
@@ -388,16 +397,17 @@ discard block |
||
388 | 397 | $remove_button = create_button('delete', 'remove_message', 'remove'); |
389 | 398 | |
390 | 399 | // No posts? |
391 | - if (empty($context['unapproved_items'])) |
|
392 | - echo ' |
|
400 | + if (empty($context['unapproved_items'])) { |
|
401 | + echo ' |
|
393 | 402 | <div class="windowbg2"> |
394 | 403 | <p class="centertext">', $txt['mc_unapproved_' . $context['current_view'] . '_none_found'], '</p> |
395 | 404 | </div>'; |
396 | - else |
|
397 | - echo ' |
|
405 | + } else { |
|
406 | + echo ' |
|
398 | 407 | <div class="pagesection floatleft"> |
399 | 408 | ', $context['page_index'], ' |
400 | 409 | </div>'; |
410 | + } |
|
401 | 411 | |
402 | 412 | foreach ($context['unapproved_items'] as $item) |
403 | 413 | { |
@@ -414,14 +424,16 @@ discard block |
||
414 | 424 | <span class="floatright"> |
415 | 425 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';approve=', $item['id'], '">', $approve_button, '</a>'; |
416 | 426 | |
417 | - if ($item['can_delete']) |
|
418 | - echo ' |
|
427 | + if ($item['can_delete']) { |
|
428 | + echo ' |
|
419 | 429 | ', $context['menu_separator'], ' |
420 | 430 | <a href="', $scripturl, '?action=moderate;area=postmod;sa=', $context['current_view'], ';start=', $context['start'], ';', $context['session_var'], '=', $context['session_id'], ';delete=', $item['id'], '">', $remove_button, '</a>'; |
431 | + } |
|
421 | 432 | |
422 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
423 | - echo ' |
|
433 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
434 | + echo ' |
|
424 | 435 | <input type="checkbox" name="item[]" value="', $item['id'], '" checked> '; |
436 | + } |
|
425 | 437 | |
426 | 438 | echo ' |
427 | 439 | </span> |
@@ -431,8 +443,8 @@ discard block |
||
431 | 443 | echo ' |
432 | 444 | <div class="pagesection">'; |
433 | 445 | |
434 | - if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) |
|
435 | - echo ' |
|
446 | + if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) { |
|
447 | + echo ' |
|
436 | 448 | <div class="floatright"> |
437 | 449 | <select name="do" onchange="if (this.value != 0 && confirm(\'', $txt['mc_unapproved_sure'], '\')) submit();"> |
438 | 450 | <option value="0">', $txt['with_selected'], ':</option> |
@@ -442,12 +454,14 @@ discard block |
||
442 | 454 | </select> |
443 | 455 | <noscript><input type="submit" name="mc_go" value="', $txt['go'], '" class="button_submit"></noscript> |
444 | 456 | </div>'; |
457 | + } |
|
445 | 458 | |
446 | - if (!empty($context['unapproved_items'])) |
|
447 | - echo ' |
|
459 | + if (!empty($context['unapproved_items'])) { |
|
460 | + echo ' |
|
448 | 461 | <div class="floatleft"> |
449 | 462 | <div class="pagelinks">', $context['page_index'], '</div> |
450 | 463 | </div>'; |
464 | + } |
|
451 | 465 | |
452 | 466 | echo ' |
453 | 467 | </div> |
@@ -467,8 +481,9 @@ discard block |
||
467 | 481 | global $scripturl, $context, $txt, $delete_button; |
468 | 482 | |
469 | 483 | // We'll have a delete please bob. |
470 | - if (empty($delete_button)) |
|
471 | - $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
484 | + if (empty($delete_button)) { |
|
485 | + $delete_button = create_button('delete', 'remove_message', 'remove', 'class="centericon"'); |
|
486 | + } |
|
472 | 487 | |
473 | 488 | $output_html = ' |
474 | 489 | <div> |
@@ -477,10 +492,11 @@ discard block |
||
477 | 492 | </div> |
478 | 493 | <div class="floatright">'; |
479 | 494 | |
480 | - if ($post['can_delete']) |
|
481 | - $output_html .= ' |
|
495 | + if ($post['can_delete']) { |
|
496 | + $output_html .= ' |
|
482 | 497 | <a href="' . $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" data-confirm="' . $txt['mc_watched_users_delete_post'] . '" class="you_sure">' . $delete_button . '</a> |
483 | 498 | <input type="checkbox" name="delete[]" value="' . $post['id'] . '">'; |
499 | + } |
|
484 | 500 | |
485 | 501 | $output_html .= ' |
486 | 502 | </div> |
@@ -522,12 +538,12 @@ discard block |
||
522 | 538 | <input type="submit" name="save" value="', $txt['save'], '" class="button_submit"> |
523 | 539 | </div> |
524 | 540 | </form>'; |
525 | - } |
|
526 | - else |
|
527 | - echo ' |
|
541 | + } else { |
|
542 | + echo ' |
|
528 | 543 | <div class="windowbg"> |
529 | 544 | <div class="centertext">', $txt['mc_no_settings'], '</div> |
530 | 545 | </div>'; |
546 | + } |
|
531 | 547 | |
532 | 548 | echo ' |
533 | 549 | </div>'; |
@@ -623,8 +639,8 @@ discard block |
||
623 | 639 | </dd> |
624 | 640 | </dl>'; |
625 | 641 | |
626 | - if ($context['template_data']['can_edit_personal']) |
|
627 | - echo ' |
|
642 | + if ($context['template_data']['can_edit_personal']) { |
|
643 | + echo ' |
|
628 | 644 | <input type="checkbox" name="make_personal" id="make_personal"', $context['template_data']['personal'] ? ' checked' : '', '> |
629 | 645 | <label for="make_personal"> |
630 | 646 | <strong>', $txt['mc_warning_template_personal'], '</strong> |
@@ -632,6 +648,7 @@ discard block |
||
632 | 648 | <br> |
633 | 649 | <span class="smalltext">', $txt['mc_warning_template_personal_desc'], '</span> |
634 | 650 | <br>'; |
651 | + } |
|
635 | 652 | |
636 | 653 | echo ' |
637 | 654 | <hr> |
@@ -18,11 +18,12 @@ discard block |
||
18 | 18 | global $context, $txt, $scripturl, $modSettings; |
19 | 19 | |
20 | 20 | // If maintenance has finished tell the user. |
21 | - if (!empty($context['maintenance_finished'])) |
|
22 | - echo ' |
|
21 | + if (!empty($context['maintenance_finished'])) { |
|
22 | + echo ' |
|
23 | 23 | <div class="infobox"> |
24 | 24 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
25 | 25 | </div>'; |
26 | + } |
|
26 | 27 | |
27 | 28 | echo ' |
28 | 29 | <div id="manage_maintenance"> |
@@ -107,11 +108,12 @@ discard block |
||
107 | 108 | <div id="manage_maintenance">'; |
108 | 109 | |
109 | 110 | // If maintenance has finished tell the user. |
110 | - if (!empty($context['maintenance_finished'])) |
|
111 | - echo ' |
|
111 | + if (!empty($context['maintenance_finished'])) { |
|
112 | + echo ' |
|
112 | 113 | <div class="infobox"> |
113 | 114 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
114 | 115 | </div>'; |
116 | + } |
|
115 | 117 | |
116 | 118 | echo ' |
117 | 119 | <div class="cat_bar"> |
@@ -238,11 +240,12 @@ discard block |
||
238 | 240 | <div id="manage_maintenance">'; |
239 | 241 | |
240 | 242 | // If maintenance has finished tell the user. |
241 | - if (!empty($context['maintenance_finished'])) |
|
242 | - echo ' |
|
243 | + if (!empty($context['maintenance_finished'])) { |
|
244 | + echo ' |
|
243 | 245 | <div class="infobox"> |
244 | 246 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
245 | 247 | </div>'; |
248 | + } |
|
246 | 249 | |
247 | 250 | echo ' |
248 | 251 | <div class="cat_bar"> |
@@ -300,9 +303,10 @@ discard block |
||
300 | 303 | <p><a href="#membersLink" onclick="swapMembers();"><img src="', $settings['images_url'], '/selected.png" alt="+" id="membersIcon"></a> <a href="#membersLink" onclick="swapMembers();" id="membersText" style="font-weight: bold;">', $txt['maintain_members_all'], '</a></p> |
301 | 304 | <div style="display: none; padding: 3px" id="membersPanel">'; |
302 | 305 | |
303 | - foreach ($context['membergroups'] as $group) |
|
304 | - echo ' |
|
306 | + foreach ($context['membergroups'] as $group) { |
|
307 | + echo ' |
|
305 | 308 | <label for="groups', $group['id'], '"><input type="checkbox" name="groups[', $group['id'], ']" id="groups', $group['id'], '" checked> ', $group['name'], '</label><br>'; |
309 | + } |
|
306 | 310 | |
307 | 311 | echo ' |
308 | 312 | </div> |
@@ -346,11 +350,12 @@ discard block |
||
346 | 350 | global $scripturl, $txt, $context, $settings, $modSettings; |
347 | 351 | |
348 | 352 | // If maintenance has finished tell the user. |
349 | - if (!empty($context['maintenance_finished'])) |
|
350 | - echo ' |
|
353 | + if (!empty($context['maintenance_finished'])) { |
|
354 | + echo ' |
|
351 | 355 | <div class="infobox"> |
352 | 356 | ', sprintf($txt['maintain_done'], $context['maintenance_finished']), ' |
353 | 357 | </div>'; |
358 | + } |
|
354 | 359 | |
355 | 360 | // Bit of javascript for showing which boards to prune in an otherwise hidden list. |
356 | 361 | echo ' |
@@ -418,19 +423,21 @@ discard block |
||
418 | 423 | <ul>'; |
419 | 424 | |
420 | 425 | // Display a checkbox with every board. |
421 | - foreach ($category['boards'] as $board) |
|
422 | - echo ' |
|
426 | + foreach ($category['boards'] as $board) { |
|
427 | + echo ' |
|
423 | 428 | <li style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'] * 1.5, 'em;"><label for="boards_', $board['id'], '"><input type="checkbox" name="boards[', $board['id'], ']" id="boards_', $board['id'], '" checked>', $board['name'], '</label></li>'; |
429 | + } |
|
424 | 430 | |
425 | 431 | echo ' |
426 | 432 | </ul> |
427 | 433 | </fieldset>'; |
428 | 434 | |
429 | 435 | // Increase $i, and check if we're at the middle yet. |
430 | - if (++$i == $middle) |
|
431 | - echo ' |
|
436 | + if (++$i == $middle) { |
|
437 | + echo ' |
|
432 | 438 | </div> |
433 | 439 | <div class="floatright" style="width: 49%;">'; |
440 | + } |
|
434 | 441 | } |
435 | 442 | |
436 | 443 | echo ' |
@@ -469,9 +476,10 @@ discard block |
||
469 | 476 | echo ' |
470 | 477 | <optgroup label="', $category['name'], '">'; |
471 | 478 | |
472 | - foreach ($category['boards'] as $board) |
|
473 | - echo ' |
|
479 | + foreach ($category['boards'] as $board) { |
|
480 | + echo ' |
|
474 | 481 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
482 | + } |
|
475 | 483 | |
476 | 484 | echo ' |
477 | 485 | </optgroup>'; |
@@ -489,9 +497,10 @@ discard block |
||
489 | 497 | echo ' |
490 | 498 | <optgroup label="', $category['name'], '">'; |
491 | 499 | |
492 | - foreach ($category['boards'] as $board) |
|
493 | - echo ' |
|
500 | + foreach ($category['boards'] as $board) { |
|
501 | + echo ' |
|
494 | 502 | <option value="', $board['id'], '"> ', str_repeat('==', $board['child_level']), '=> ', $board['name'], '</option>'; |
503 | + } |
|
495 | 504 | |
496 | 505 | echo ' |
497 | 506 | </optgroup>'; |
@@ -531,9 +540,10 @@ discard block |
||
531 | 540 | ', $txt['database_optimize_attempt'], '<br>'; |
532 | 541 | |
533 | 542 | // List each table being optimized... |
534 | - foreach ($context['optimized_tables'] as $table) |
|
535 | - echo ' |
|
543 | + foreach ($context['optimized_tables'] as $table) { |
|
544 | + echo ' |
|
536 | 545 | ', sprintf($txt['database_optimizing'], $table['name'], $table['data_freed']), '<br>'; |
546 | + } |
|
537 | 547 | |
538 | 548 | // How did we go? |
539 | 549 | echo ' |
@@ -590,13 +600,14 @@ discard block |
||
590 | 600 | ', implode('</li><li>', $context['exceeding_messages']), ' |
591 | 601 | </li> |
592 | 602 | </ul>'; |
593 | - if (!empty($context['exceeding_messages_morethan'])) |
|
594 | - echo ' |
|
603 | + if (!empty($context['exceeding_messages_morethan'])) { |
|
604 | + echo ' |
|
595 | 605 | <p>', $context['exceeding_messages_morethan'], '</p>'; |
596 | - } |
|
597 | - else |
|
598 | - echo ' |
|
606 | + } |
|
607 | + } else { |
|
608 | + echo ' |
|
599 | 609 | <p class="infobox">', $txt['convert_to_text'], '</p>'; |
610 | + } |
|
600 | 611 | |
601 | 612 | echo ' |
602 | 613 | <form action="', $scripturl, '?action=admin;area=maintain;sa=database;activity=convertmsgbody" method="post" accept-charset="', $context['character_set'], '"> |
@@ -29,9 +29,10 @@ discard block |
||
29 | 29 | // Go through each type of report they can run. |
30 | 30 | foreach ($context['report_types'] as $type) |
31 | 31 | { |
32 | - if (isset($type['description'])) |
|
33 | - echo ' |
|
32 | + if (isset($type['description'])) { |
|
33 | + echo ' |
|
34 | 34 | <dt>', $type['description'], '</dt>'; |
35 | + } |
|
35 | 36 | echo ' |
36 | 37 | <dd> |
37 | 38 | <input type="radio" id="rt_', $type['id'], '" name="rt" value="', $type['id'], '"', $type['is_first'] ? ' checked' : '', '> |
@@ -61,8 +62,9 @@ discard block |
||
61 | 62 | </div> |
62 | 63 | <div id="report_buttons">'; |
63 | 64 | |
64 | - if (!empty($context['report_buttons'])) |
|
65 | - template_button_strip($context['report_buttons'], 'right'); |
|
65 | + if (!empty($context['report_buttons'])) { |
|
66 | + template_button_strip($context['report_buttons'], 'right'); |
|
67 | + } |
|
66 | 68 | |
67 | 69 | echo ' |
68 | 70 | </div>'; |
@@ -73,25 +75,27 @@ discard block |
||
73 | 75 | echo ' |
74 | 76 | <table class="table_grid report_results">'; |
75 | 77 | |
76 | - if (!empty($table['title'])) |
|
77 | - echo ' |
|
78 | + if (!empty($table['title'])) { |
|
79 | + echo ' |
|
78 | 80 | <thead> |
79 | 81 | <tr class="title_bar"> |
80 | 82 | <th scope="col" colspan="', $table['column_count'], '">', $table['title'], '</th> |
81 | 83 | </tr> |
82 | 84 | </thead> |
83 | 85 | <tbody>'; |
86 | + } |
|
84 | 87 | |
85 | 88 | // Now do each row! |
86 | 89 | $row_number = 0; |
87 | 90 | foreach ($table['data'] as $row) |
88 | 91 | { |
89 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
90 | - echo ' |
|
92 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
93 | + echo ' |
|
91 | 94 | <tr class="windowbg table_caption">'; |
92 | - else |
|
93 | - echo ' |
|
95 | + } else { |
|
96 | + echo ' |
|
94 | 97 | <tr class="', !empty($row[0]['separator']) ? 'title_bar' : 'windowbg', '">'; |
98 | + } |
|
95 | 99 | |
96 | 100 | // Now do each column. |
97 | 101 | $column_number = 0; |
@@ -109,16 +113,17 @@ discard block |
||
109 | 113 | } |
110 | 114 | |
111 | 115 | // Shaded? |
112 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
113 | - echo ' |
|
116 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
117 | + echo ' |
|
114 | 118 | <td class="table_caption ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
115 | 119 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
116 | 120 | </td>'; |
117 | - else |
|
118 | - echo ' |
|
121 | + } else { |
|
122 | + echo ' |
|
119 | 123 | <td class="smalltext centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
120 | 124 | ', $data['v'], ' |
121 | 125 | </td>'; |
126 | + } |
|
122 | 127 | |
123 | 128 | $column_number++; |
124 | 129 | } |
@@ -167,24 +172,26 @@ discard block |
||
167 | 172 | <div style="overflow: visible;', $table['max_width'] != 'auto' ? ' width: ' . $table['max_width'] . 'px;' : '', '"> |
168 | 173 | <table class="bordercolor">'; |
169 | 174 | |
170 | - if (!empty($table['title'])) |
|
171 | - echo ' |
|
175 | + if (!empty($table['title'])) { |
|
176 | + echo ' |
|
172 | 177 | <tr class="title_bar"> |
173 | 178 | <td colspan="', $table['column_count'], '"> |
174 | 179 | ', $table['title'], ' |
175 | 180 | </td> |
176 | 181 | </tr>'; |
182 | + } |
|
177 | 183 | |
178 | 184 | // Now do each row! |
179 | 185 | $row_number = 0; |
180 | 186 | foreach ($table['data'] as $row) |
181 | 187 | { |
182 | - if ($row_number == 0 && !empty($table['shading']['top'])) |
|
183 | - echo ' |
|
188 | + if ($row_number == 0 && !empty($table['shading']['top'])) { |
|
189 | + echo ' |
|
184 | 190 | <tr class="titlebg">'; |
185 | - else |
|
186 | - echo ' |
|
191 | + } else { |
|
192 | + echo ' |
|
187 | 193 | <tr class="windowbg">'; |
194 | + } |
|
188 | 195 | |
189 | 196 | // Now do each column!! |
190 | 197 | $column_number = 0; |
@@ -201,16 +208,17 @@ discard block |
||
201 | 208 | } |
202 | 209 | |
203 | 210 | // Shaded? |
204 | - if ($column_number == 0 && !empty($table['shading']['left'])) |
|
205 | - echo ' |
|
211 | + if ($column_number == 0 && !empty($table['shading']['left'])) { |
|
212 | + echo ' |
|
206 | 213 | <td class="titlebg ', $table['align']['shaded'], 'text"', $table['width']['shaded'] != 'auto' ? ' width="' . $table['width']['shaded'] . '"' : '', '> |
207 | 214 | ', $data['v'] == $table['default_value'] ? '' : ($data['v'] . (empty($data['v']) ? '' : ':')), ' |
208 | 215 | </td>'; |
209 | - else |
|
210 | - echo ' |
|
216 | + } else { |
|
217 | + echo ' |
|
211 | 218 | <td class="centertext" ', $table['width']['normal'] != 'auto' ? ' width="' . $table['width']['normal'] . '"' : '', !empty($data['style']) ? ' style="' . $data['style'] . '"' : '', '> |
212 | 219 | ', $data['v'], ' |
213 | 220 | </td>'; |
221 | + } |
|
214 | 222 | |
215 | 223 | $column_number++; |
216 | 224 | } |
@@ -28,13 +28,14 @@ discard block |
||
28 | 28 | <div id="confirm_buttons">'; |
29 | 29 | |
30 | 30 | // Age restriction in effect? |
31 | - if ($context['show_coppa']) |
|
32 | - echo ' |
|
31 | + if ($context['show_coppa']) { |
|
32 | + echo ' |
|
33 | 33 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br> |
34 | 34 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">'; |
35 | - else |
|
36 | - echo ' |
|
35 | + } else { |
|
36 | + echo ' |
|
37 | 37 | <input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button_submit">'; |
38 | + } |
|
38 | 39 | |
39 | 40 | echo ' |
40 | 41 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -77,9 +78,10 @@ discard block |
||
77 | 78 | <ul>'; |
78 | 79 | |
79 | 80 | // Cycle through each error and display an error message. |
80 | - foreach ($context['registration_errors'] as $error) |
|
81 | - echo ' |
|
81 | + foreach ($context['registration_errors'] as $error) { |
|
82 | + echo ' |
|
82 | 83 | <li>', $error, '</li>'; |
84 | + } |
|
83 | 85 | |
84 | 86 | echo ' |
85 | 87 | </ul> |
@@ -143,14 +145,15 @@ discard block |
||
143 | 145 | |
144 | 146 | <dl class="register_form">'; |
145 | 147 | |
146 | - foreach ($context['custom_fields'] as $field) |
|
147 | - if ($field['show_reg'] > 1) |
|
148 | + foreach ($context['custom_fields'] as $field) { |
|
149 | + if ($field['show_reg'] > 1) |
|
148 | 150 | echo ' |
149 | 151 | <dt> |
150 | 152 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
151 | 153 | <span class="smalltext">', $field['desc'], '</span> |
152 | 154 | </dt> |
153 | 155 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
156 | + } |
|
154 | 157 | |
155 | 158 | echo ' |
156 | 159 | </dl>'; |
@@ -184,41 +187,45 @@ discard block |
||
184 | 187 | $callback_func = 'template_profile_' . $field['callback_func']; |
185 | 188 | $callback_func(); |
186 | 189 | } |
187 | - } |
|
188 | - else |
|
190 | + } else |
|
189 | 191 | { |
190 | 192 | echo ' |
191 | 193 | <dt> |
192 | 194 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['label'], ':</strong>'; |
193 | 195 | |
194 | 196 | // Does it have any subtext to show? |
195 | - if (!empty($field['subtext'])) |
|
196 | - echo ' |
|
197 | + if (!empty($field['subtext'])) { |
|
198 | + echo ' |
|
197 | 199 | <span class="smalltext">', $field['subtext'], '</span>'; |
200 | + } |
|
198 | 201 | |
199 | 202 | echo ' |
200 | 203 | </dt> |
201 | 204 | <dd>'; |
202 | 205 | |
203 | 206 | // Want to put something infront of the box? |
204 | - if (!empty($field['preinput'])) |
|
205 | - echo ' |
|
207 | + if (!empty($field['preinput'])) { |
|
208 | + echo ' |
|
206 | 209 | ', $field['preinput']; |
210 | + } |
|
207 | 211 | |
208 | 212 | // What type of data are we showing? |
209 | - if ($field['type'] == 'label') |
|
210 | - echo ' |
|
213 | + if ($field['type'] == 'label') { |
|
214 | + echo ' |
|
211 | 215 | ', $field['value']; |
216 | + } |
|
212 | 217 | |
213 | 218 | // Maybe it's a text box - very likely! |
214 | - elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) |
|
215 | - echo ' |
|
219 | + elseif (in_array($field['type'], array('int', 'float', 'text', 'password'))) { |
|
220 | + echo ' |
|
216 | 221 | <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>'; |
222 | + } |
|
217 | 223 | |
218 | 224 | // You "checking" me out? ;) |
219 | - elseif ($field['type'] == 'check') |
|
220 | - echo ' |
|
225 | + elseif ($field['type'] == 'check') { |
|
226 | + echo ' |
|
221 | 227 | <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], '>'; |
228 | + } |
|
222 | 229 | |
223 | 230 | // Always fun - select boxes! |
224 | 231 | elseif ($field['type'] == 'select') |
@@ -229,13 +236,15 @@ discard block |
||
229 | 236 | if (isset($field['options'])) |
230 | 237 | { |
231 | 238 | // Is this some code to generate the options? |
232 | - if (!is_array($field['options'])) |
|
233 | - $field['options'] = eval($field['options']); |
|
239 | + if (!is_array($field['options'])) { |
|
240 | + $field['options'] = eval($field['options']); |
|
241 | + } |
|
234 | 242 | // Assuming we now have some! |
235 | - if (is_array($field['options'])) |
|
236 | - foreach ($field['options'] as $value => $name) |
|
243 | + if (is_array($field['options'])) { |
|
244 | + foreach ($field['options'] as $value => $name) |
|
237 | 245 | echo ' |
238 | 246 | <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>'; |
247 | + } |
|
239 | 248 | } |
240 | 249 | |
241 | 250 | echo ' |
@@ -243,9 +252,10 @@ discard block |
||
243 | 252 | } |
244 | 253 | |
245 | 254 | // Something to end with? |
246 | - if (!empty($field['postinput'])) |
|
247 | - echo ' |
|
255 | + if (!empty($field['postinput'])) { |
|
256 | + echo ' |
|
248 | 257 | ', $field['postinput']; |
258 | + } |
|
249 | 259 | |
250 | 260 | echo ' |
251 | 261 | </dd>'; |
@@ -258,13 +268,14 @@ discard block |
||
258 | 268 | { |
259 | 269 | foreach ($context['custom_fields'] as $field) |
260 | 270 | { |
261 | - if ($field['show_reg'] < 2) |
|
262 | - echo ' |
|
271 | + if ($field['show_reg'] < 2) { |
|
272 | + echo ' |
|
263 | 273 | <dt> |
264 | 274 | <strong', !empty($field['is_error']) ? ' class="red"' : '', '>', $field['name'], ':</strong> |
265 | 275 | <span class="smalltext">', $field['desc'], '</span> |
266 | 276 | </dt> |
267 | 277 | <dd>', $field['input_html'], '</dd>'; |
278 | + } |
|
268 | 279 | } |
269 | 280 | } |
270 | 281 | |
@@ -294,13 +305,14 @@ discard block |
||
294 | 305 | <div id="confirm_buttons" class="flow_auto">'; |
295 | 306 | |
296 | 307 | // Age restriction in effect? |
297 | - if (!$context['require_agreement'] && $context['show_coppa']) |
|
298 | - echo ' |
|
308 | + if (!$context['require_agreement'] && $context['show_coppa']) { |
|
309 | + echo ' |
|
299 | 310 | <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br> |
300 | 311 | <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">'; |
301 | - else |
|
302 | - echo ' |
|
312 | + } else { |
|
313 | + echo ' |
|
303 | 314 | <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit">'; |
315 | + } |
|
304 | 316 | echo ' |
305 | 317 | </div> |
306 | 318 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
@@ -445,19 +457,20 @@ discard block |
||
445 | 457 | </head> |
446 | 458 | <body style="margin: 1ex;"> |
447 | 459 | <div class="windowbg description" style="text-align: center;">'; |
448 | - if (isBrowser('is_ie') || isBrowser('is_ie11')) |
|
449 | - echo ' |
|
460 | + if (isBrowser('is_ie') || isBrowser('is_ie11')) { |
|
461 | + echo ' |
|
450 | 462 | <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav"> |
451 | 463 | <param name="AutoStart" value="1"> |
452 | 464 | <param name="FileName" value="', $context['verification_sound_href'], '"> |
453 | 465 | </object>'; |
454 | - else |
|
455 | - echo ' |
|
466 | + } else { |
|
467 | + echo ' |
|
456 | 468 | <audio src="', $context['verification_sound_href'], '" controls> |
457 | 469 | <object type="audio/x-wav" data="', $context['verification_sound_href'], '"> |
458 | 470 | <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a> |
459 | 471 | </object> |
460 | 472 | </audio>'; |
473 | + } |
|
461 | 474 | echo ' |
462 | 475 | <br> |
463 | 476 | <a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br> |
@@ -484,11 +497,12 @@ discard block |
||
484 | 497 | </div> |
485 | 498 | <div id="register_screen" class="windowbg2 noup">'; |
486 | 499 | |
487 | - if (!empty($context['registration_done'])) |
|
488 | - echo ' |
|
500 | + if (!empty($context['registration_done'])) { |
|
501 | + echo ' |
|
489 | 502 | <div class="infobox"> |
490 | 503 | ', $context['registration_done'], ' |
491 | 504 | </div>'; |
505 | + } |
|
492 | 506 | |
493 | 507 | echo ' |
494 | 508 | <dl class="register_form" id="admin_register_form"> |
@@ -524,9 +538,10 @@ discard block |
||
524 | 538 | <dd> |
525 | 539 | <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">'; |
526 | 540 | |
527 | - foreach ($context['member_groups'] as $id => $name) |
|
528 | - echo ' |
|
541 | + foreach ($context['member_groups'] as $id => $name) { |
|
542 | + echo ' |
|
529 | 543 | <option value="', $id, '">', $name, '</option>'; |
544 | + } |
|
530 | 545 | |
531 | 546 | echo ' |
532 | 547 | </select> |
@@ -534,8 +549,8 @@ discard block |
||
534 | 549 | } |
535 | 550 | |
536 | 551 | // If there is any field marked as required, show it here! |
537 | - if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) |
|
538 | - foreach ($context['custom_fields'] as $field) |
|
552 | + if (!empty($context['custom_fields_required']) && !empty($context['custom_fields'])) { |
|
553 | + foreach ($context['custom_fields'] as $field) |
|
539 | 554 | if ($field['show_reg'] > 1) |
540 | 555 | echo ' |
541 | 556 | <dt> |
@@ -543,6 +558,7 @@ discard block |
||
543 | 558 | <span class="smalltext">', $field['desc'], '</span> |
544 | 559 | </dt> |
545 | 560 | <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ . '" name="', $field['input_html']), '</dd>'; |
561 | + } |
|
546 | 562 | |
547 | 563 | echo ' |
548 | 564 | <dt> |
@@ -579,12 +595,13 @@ discard block |
||
579 | 595 | { |
580 | 596 | global $context, $scripturl, $txt; |
581 | 597 | |
582 | - if (!empty($context['saved_successful'])) |
|
583 | - echo ' |
|
598 | + if (!empty($context['saved_successful'])) { |
|
599 | + echo ' |
|
584 | 600 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
585 | - elseif (!empty($context['could_not_save'])) |
|
586 | - echo ' |
|
601 | + } elseif (!empty($context['could_not_save'])) { |
|
602 | + echo ' |
|
587 | 603 | <div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>'; |
604 | + } |
|
588 | 605 | |
589 | 606 | // Just a big box to edit the text file ;). |
590 | 607 | echo ' |
@@ -594,9 +611,10 @@ discard block |
||
594 | 611 | </div>'; |
595 | 612 | |
596 | 613 | // Warning for if the file isn't writable. |
597 | - if (!empty($context['warning'])) |
|
598 | - echo ' |
|
614 | + if (!empty($context['warning'])) { |
|
615 | + echo ' |
|
599 | 616 | <p class="error">', $context['warning'], '</p>'; |
617 | + } |
|
600 | 618 | |
601 | 619 | echo ' |
602 | 620 | <div class="windowbg2 noup" id="registration_agreement">'; |
@@ -613,9 +631,10 @@ discard block |
||
613 | 631 | <strong>', $txt['admin_agreement_select_language'], ':</strong> |
614 | 632 | <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">'; |
615 | 633 | |
616 | - foreach ($context['editable_agreements'] as $file => $name) |
|
617 | - echo ' |
|
634 | + foreach ($context['editable_agreements'] as $file => $name) { |
|
635 | + echo ' |
|
618 | 636 | <option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>'; |
637 | + } |
|
619 | 638 | |
620 | 639 | echo ' |
621 | 640 | </select> |
@@ -655,9 +674,10 @@ discard block |
||
655 | 674 | { |
656 | 675 | global $context, $scripturl, $txt; |
657 | 676 | |
658 | - if (!empty($context['saved_successful'])) |
|
659 | - echo ' |
|
677 | + if (!empty($context['saved_successful'])) { |
|
678 | + echo ' |
|
660 | 679 | <div class="infobox">', $txt['settings_saved'], '</div>'; |
680 | + } |
|
661 | 681 | |
662 | 682 | echo ' |
663 | 683 | <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '"> |