@@ -13,8 +13,9 @@ discard block |
||
13 | 13 | * @version 2.1 Beta 4 |
14 | 14 | */ |
15 | 15 | |
16 | -if (!defined('SMF')) |
|
16 | +if (!defined('SMF')) { |
|
17 | 17 | die('No direct access...'); |
18 | +} |
|
18 | 19 | |
19 | 20 | /** |
20 | 21 | * Downloads an avatar or attachment based on $_GET['attach'], and increments the download count. |
@@ -40,11 +41,11 @@ discard block |
||
40 | 41 | |
41 | 42 | if (!empty($modSettings['enableCompressedOutput']) && !headers_sent() && ob_get_length() == 0) |
42 | 43 | { |
43 | - if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler') |
|
44 | - $modSettings['enableCompressedOutput'] = 0; |
|
45 | - |
|
46 | - else |
|
47 | - ob_start('ob_gzhandler'); |
|
44 | + if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler') { |
|
45 | + $modSettings['enableCompressedOutput'] = 0; |
|
46 | + } else { |
|
47 | + ob_start('ob_gzhandler'); |
|
48 | + } |
|
48 | 49 | } |
49 | 50 | |
50 | 51 | if (empty($modSettings['enableCompressedOutput'])) |
@@ -76,8 +77,9 @@ discard block |
||
76 | 77 | } |
77 | 78 | |
78 | 79 | // Use cache when possible. |
79 | - if (($cache = cache_get_data('attachment_lookup_id-' . $attachId)) != null) |
|
80 | - list($file, $thumbFile) = $cache; |
|
80 | + if (($cache = cache_get_data('attachment_lookup_id-' . $attachId)) != null) { |
|
81 | + list($file, $thumbFile) = $cache; |
|
82 | + } |
|
81 | 83 | |
82 | 84 | // Get the info from the DB. |
83 | 85 | if (empty($file) || empty($thumbFile) && !empty($file['id_thumb'])) |
@@ -85,10 +87,9 @@ discard block |
||
85 | 87 | // Do we have a hook wanting to use our attachment system? We use $attachRequest to prevent accidental usage of $request. |
86 | 88 | $attachRequest = null; |
87 | 89 | call_integration_hook('integrate_download_request', array(&$attachRequest)); |
88 | - if (!is_null($attachRequest) && $smcFunc['db_is_resource']($attachRequest)) |
|
89 | - $request = $attachRequest; |
|
90 | - |
|
91 | - else |
|
90 | + if (!is_null($attachRequest) && $smcFunc['db_is_resource']($attachRequest)) { |
|
91 | + $request = $attachRequest; |
|
92 | + } else |
|
92 | 93 | { |
93 | 94 | // Make sure this attachment is on this board and load its info while we are at it. |
94 | 95 | $request = $smcFunc['db_query']('', ' |
@@ -181,13 +182,15 @@ discard block |
||
181 | 182 | } |
182 | 183 | |
183 | 184 | // Cache it. |
184 | - if (!empty($file) || !empty($thumbFile)) |
|
185 | - cache_put_data('attachment_lookup_id-' . $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900)); |
|
185 | + if (!empty($file) || !empty($thumbFile)) { |
|
186 | + cache_put_data('attachment_lookup_id-' . $file['id_attach'], array($file, $thumbFile), mt_rand(850, 900)); |
|
187 | + } |
|
186 | 188 | } |
187 | 189 | |
188 | 190 | // Replace the normal file with its thumbnail if it has one! |
189 | - if (!empty($showThumb) && !empty($thumbFile)) |
|
190 | - $file = $thumbFile; |
|
191 | + if (!empty($showThumb) && !empty($thumbFile)) { |
|
192 | + $file = $thumbFile; |
|
193 | + } |
|
191 | 194 | |
192 | 195 | // No point in a nicer message, because this is supposed to be an attachment anyway... |
193 | 196 | if (!file_exists($file['filePath'])) |
@@ -237,8 +240,8 @@ discard block |
||
237 | 240 | } |
238 | 241 | |
239 | 242 | // Update the download counter (unless it's a thumbnail or resuming an incomplete download). |
240 | - if ($file['attachment_type'] != 3 && empty($showThumb) && $range === 0) |
|
241 | - $smcFunc['db_query']('', ' |
|
243 | + if ($file['attachment_type'] != 3 && empty($showThumb) && $range === 0) { |
|
244 | + $smcFunc['db_query']('', ' |
|
242 | 245 | UPDATE {db_prefix}attachments |
243 | 246 | SET downloads = downloads + 1 |
244 | 247 | WHERE id_attach = {int:id_attach}', |
@@ -246,12 +249,14 @@ discard block |
||
246 | 249 | 'id_attach' => $attachId, |
247 | 250 | ) |
248 | 251 | ); |
252 | + } |
|
249 | 253 | |
250 | 254 | // Send the attachment headers. |
251 | 255 | header('Pragma: '); |
252 | 256 | |
253 | - if (!isBrowser('gecko')) |
|
254 | - header('Content-Transfer-Encoding: binary'); |
|
257 | + if (!isBrowser('gecko')) { |
|
258 | + header('Content-Transfer-Encoding: binary'); |
|
259 | + } |
|
255 | 260 | |
256 | 261 | header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT'); |
257 | 262 | header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($file['filePath'])) . ' GMT'); |
@@ -260,18 +265,19 @@ discard block |
||
260 | 265 | header('ETag: ' . $eTag); |
261 | 266 | |
262 | 267 | // Make sure the mime type warrants an inline display. |
263 | - if (isset($_REQUEST['image']) && !empty($file['mime_type']) && strpos($file['mime_type'], 'image/') !== 0) |
|
264 | - unset($_REQUEST['image']); |
|
268 | + if (isset($_REQUEST['image']) && !empty($file['mime_type']) && strpos($file['mime_type'], 'image/') !== 0) { |
|
269 | + unset($_REQUEST['image']); |
|
270 | + } |
|
265 | 271 | |
266 | 272 | // Does this have a mime type? |
267 | - elseif (!empty($file['mime_type']) && (isset($_REQUEST['image']) || !in_array($file['fileext'], array('jpg', 'gif', 'jpeg', 'x-ms-bmp', 'png', 'psd', 'tiff', 'iff')))) |
|
268 | - header('Content-Type: ' . strtr($file['mime_type'], array('image/bmp' => 'image/x-ms-bmp'))); |
|
269 | - |
|
270 | - else |
|
273 | + elseif (!empty($file['mime_type']) && (isset($_REQUEST['image']) || !in_array($file['fileext'], array('jpg', 'gif', 'jpeg', 'x-ms-bmp', 'png', 'psd', 'tiff', 'iff')))) { |
|
274 | + header('Content-Type: ' . strtr($file['mime_type'], array('image/bmp' => 'image/x-ms-bmp'))); |
|
275 | + } else |
|
271 | 276 | { |
272 | 277 | header('Content-Type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream')); |
273 | - if (isset($_REQUEST['image'])) |
|
274 | - unset($_REQUEST['image']); |
|
278 | + if (isset($_REQUEST['image'])) { |
|
279 | + unset($_REQUEST['image']); |
|
280 | + } |
|
275 | 281 | } |
276 | 282 | |
277 | 283 | // Convert the file to UTF-8, cuz most browsers dig that. |
@@ -279,24 +285,22 @@ discard block |
||
279 | 285 | $disposition = !isset($_REQUEST['image']) ? 'attachment' : 'inline'; |
280 | 286 | |
281 | 287 | // Different browsers like different standards... |
282 | - if (isBrowser('firefox')) |
|
283 | - header('Content-Disposition: ' . $disposition . '; filename*=UTF-8\'\'' . rawurlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name))); |
|
284 | - |
|
285 | - elseif (isBrowser('opera')) |
|
286 | - header('Content-Disposition: ' . $disposition . '; filename="' . preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name) . '"'); |
|
287 | - |
|
288 | - elseif (isBrowser('ie')) |
|
289 | - header('Content-Disposition: ' . $disposition . '; filename="' . urlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)) . '"'); |
|
290 | - |
|
291 | - else |
|
292 | - header('Content-Disposition: ' . $disposition . '; filename="' . $utf8name . '"'); |
|
288 | + if (isBrowser('firefox')) { |
|
289 | + header('Content-Disposition: ' . $disposition . '; filename*=UTF-8\'\'' . rawurlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name))); |
|
290 | + } elseif (isBrowser('opera')) { |
|
291 | + header('Content-Disposition: ' . $disposition . '; filename="' . preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name) . '"'); |
|
292 | + } elseif (isBrowser('ie')) { |
|
293 | + header('Content-Disposition: ' . $disposition . '; filename="' . urlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)) . '"'); |
|
294 | + } else { |
|
295 | + header('Content-Disposition: ' . $disposition . '; filename="' . $utf8name . '"'); |
|
296 | + } |
|
293 | 297 | |
294 | 298 | // If this has an "image extension" - but isn't actually an image - then ensure it isn't cached cause of silly IE. |
295 | - if (!isset($_REQUEST['image']) && in_array($file['fileext'], array('gif', 'jpg', 'bmp', 'png', 'jpeg', 'tiff'))) |
|
296 | - header('Cache-Control: no-cache'); |
|
297 | - |
|
298 | - else |
|
299 | - header('Cache-Control: max-age=' . (525600 * 60) . ', private'); |
|
299 | + if (!isset($_REQUEST['image']) && in_array($file['fileext'], array('gif', 'jpg', 'bmp', 'png', 'jpeg', 'tiff'))) { |
|
300 | + header('Cache-Control: no-cache'); |
|
301 | + } else { |
|
302 | + header('Cache-Control: max-age=' . (525600 * 60) . ', private'); |
|
303 | + } |
|
300 | 304 | |
301 | 305 | // Multipart and resuming support |
302 | 306 | if (isset($_SERVER['HTTP_RANGE'])) |
@@ -304,9 +308,9 @@ discard block |
||
304 | 308 | header("HTTP/1.1 206 Partial Content"); |
305 | 309 | header("Content-Length: $new_length"); |
306 | 310 | header("Content-Range: bytes $range-$range_end/$size"); |
311 | + } else { |
|
312 | + header("Content-Length: " . $size); |
|
307 | 313 | } |
308 | - else |
|
309 | - header("Content-Length: " . $size); |
|
310 | 314 | |
311 | 315 | |
312 | 316 | // Try to buy some time... |
@@ -315,8 +319,9 @@ discard block |
||
315 | 319 | // For multipart/resumable downloads, send the requested chunk(s) of the file |
316 | 320 | if (isset($_SERVER['HTTP_RANGE'])) |
317 | 321 | { |
318 | - while (@ob_get_level() > 0) |
|
319 | - @ob_end_clean(); |
|
322 | + while (@ob_get_level() > 0) { |
|
323 | + @ob_end_clean(); |
|
324 | + } |
|
320 | 325 | |
321 | 326 | // 40 kilobytes is a good-ish amount |
322 | 327 | $chunksize = 40 * 1024; |
@@ -340,8 +345,9 @@ discard block |
||
340 | 345 | elseif ($size > 4194304) |
341 | 346 | { |
342 | 347 | // Forcibly end any output buffering going on. |
343 | - while (@ob_get_level() > 0) |
|
344 | - @ob_end_clean(); |
|
348 | + while (@ob_get_level() > 0) { |
|
349 | + @ob_end_clean(); |
|
350 | + } |
|
345 | 351 | |
346 | 352 | $fp = fopen($file['filePath'], 'rb'); |
347 | 353 | while (!feof($fp)) |
@@ -353,8 +359,9 @@ discard block |
||
353 | 359 | } |
354 | 360 | |
355 | 361 | // On some of the less-bright hosts, readfile() is disabled. It's just a faster, more byte safe, version of what's in the if. |
356 | - elseif (@readfile($file['filePath']) === null) |
|
357 | - echo file_get_contents($file['filePath']); |
|
362 | + elseif (@readfile($file['filePath']) === null) { |
|
363 | + echo file_get_contents($file['filePath']); |
|
364 | + } |
|
358 | 365 | |
359 | 366 | die(); |
360 | 367 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | <subject is_first="', $context['message']['first_in_topic'] ? '1' : '0', '"><![CDATA[', cleanXml($context['message']['subject']), ']]></subject> |
74 | 74 | <body><![CDATA[', $context['message']['body'], ']]></body> |
75 | 75 | <success><![CDATA[', $txt['quick_modify_message'], ']]></success>'; |
76 | - } |
|
77 | - else |
|
78 | - echo ' |
|
76 | + } else { |
|
77 | + echo ' |
|
79 | 78 | <error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '" in_body="', cleanXml($context['message']['error_in_body']) ? '1' : '0', '"><![CDATA[', implode('<br />', $context['message']['errors']), ']]></error>'; |
79 | + } |
|
80 | 80 | echo ' |
81 | 81 | </message> |
82 | 82 | </smf>'; |
@@ -101,13 +101,14 @@ discard block |
||
101 | 101 | echo ' |
102 | 102 | <modified><![CDATA[', empty($modified) ? '' : cleanXml('« <em>' . $modified . '</em>»'), ']]></modified>'; |
103 | 103 | |
104 | - if (!empty($context['message']['subject'])) |
|
105 | - echo ' |
|
104 | + if (!empty($context['message']['subject'])) { |
|
105 | + echo ' |
|
106 | 106 | <subject><![CDATA[', cleanXml($context['message']['subject']), ']]></subject>'; |
107 | - } |
|
108 | - else |
|
109 | - echo ' |
|
107 | + } |
|
108 | + } else { |
|
109 | + echo ' |
|
110 | 110 | <error in_subject="', $context['message']['error_in_subject'] ? '1' : '0', '"><![CDATA[', cleanXml(implode('<br />', $context['message']['errors'])), ']]></error>'; |
111 | + } |
|
111 | 112 | echo ' |
112 | 113 | </message> |
113 | 114 | </smf>'; |
@@ -128,10 +129,11 @@ discard block |
||
128 | 129 | </preview> |
129 | 130 | <errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '" topic_locked="', $context['locked'] ? '1' : '0', '">'; |
130 | 131 | |
131 | - if (!empty($context['post_error'])) |
|
132 | - foreach ($context['post_error'] as $message) |
|
132 | + if (!empty($context['post_error'])) { |
|
133 | + foreach ($context['post_error'] as $message) |
|
133 | 134 | echo ' |
134 | 135 | <error><![CDATA[', cleanXml($message), ']]></error>'; |
136 | + } |
|
135 | 137 | |
136 | 138 | echo ' |
137 | 139 | <caption name="guestname" class="', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? 'error' : '', '" /> |
@@ -148,14 +150,15 @@ discard block |
||
148 | 150 | echo ' |
149 | 151 | <new_posts>'; |
150 | 152 | |
151 | - foreach ($context['previous_posts'] as $post) |
|
152 | - echo ' |
|
153 | + foreach ($context['previous_posts'] as $post) { |
|
154 | + echo ' |
|
153 | 155 | <post id="', $post['id'], '"> |
154 | 156 | <time><![CDATA[', $post['time'], ']]></time> |
155 | 157 | <poster><![CDATA[', cleanXml($post['poster']), ']]></poster> |
156 | 158 | <message><![CDATA[', cleanXml($post['message']), ']]></message> |
157 | 159 | <is_ignored>', $post['is_ignored'] ? '1' : '0', '</is_ignored> |
158 | 160 | </post>'; |
161 | + } |
|
159 | 162 | |
160 | 163 | echo ' |
161 | 164 | </new_posts>'; |
@@ -181,10 +184,11 @@ discard block |
||
181 | 184 | </preview> |
182 | 185 | <errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">'; |
183 | 186 | |
184 | - if (!empty($context['post_error']['messages'])) |
|
185 | - foreach ($context['post_error']['messages'] as $message) |
|
187 | + if (!empty($context['post_error']['messages'])) { |
|
188 | + foreach ($context['post_error']['messages'] as $message) |
|
186 | 189 | echo ' |
187 | 190 | <error><![CDATA[', cleanXml($message), ']]></error>'; |
191 | + } |
|
188 | 192 | |
189 | 193 | echo ' |
190 | 194 | <caption name="to" class="', isset($context['post_error']['no_to']) ? 'error' : '', '" /> |
@@ -214,10 +218,11 @@ discard block |
||
214 | 218 | </preview> |
215 | 219 | <errors serious="', empty($context['error_type']) || $context['error_type'] != 'serious' ? '0' : '1', '">'; |
216 | 220 | |
217 | - if (!empty($context['post_error']['messages'])) |
|
218 | - foreach ($context['post_error']['messages'] as $message) |
|
221 | + if (!empty($context['post_error']['messages'])) { |
|
222 | + foreach ($context['post_error']['messages'] as $message) |
|
219 | 223 | echo ' |
220 | 224 | <error><![CDATA[', cleanXml($message), ']]></error>'; |
225 | + } |
|
221 | 226 | |
222 | 227 | echo ' |
223 | 228 | </errors>'; |
@@ -233,20 +238,23 @@ discard block |
||
233 | 238 | { |
234 | 239 | global $context, $modSettings; |
235 | 240 | |
236 | - if (empty($context['yearly'])) |
|
237 | - return; |
|
241 | + if (empty($context['yearly'])) { |
|
242 | + return; |
|
243 | + } |
|
238 | 244 | |
239 | 245 | echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '> |
240 | 246 | <smf>'; |
241 | - foreach ($context['yearly'] as $year) |
|
242 | - foreach ($year['months'] as $month) |
|
247 | + foreach ($context['yearly'] as $year) { |
|
248 | + foreach ($year['months'] as $month) |
|
243 | 249 | { |
244 | 250 | echo ' |
245 | 251 | <month id="', $month['date']['year'], $month['date']['month'], '">'; |
252 | + } |
|
246 | 253 | |
247 | - foreach ($month['days'] as $day) |
|
248 | - echo ' |
|
254 | + foreach ($month['days'] as $day) { |
|
255 | + echo ' |
|
249 | 256 | <day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />'; |
257 | + } |
|
250 | 258 | |
251 | 259 | echo ' |
252 | 260 | </month>'; |
@@ -269,17 +277,18 @@ discard block |
||
269 | 277 | <pageIndex section="selected" startFrom="', $context['selected']['start'], '"><![CDATA[', $context['selected']['page_index'], ']]></pageIndex>'; |
270 | 278 | foreach ($context['changes'] as $change) |
271 | 279 | { |
272 | - if ($change['type'] == 'remove') |
|
273 | - echo ' |
|
280 | + if ($change['type'] == 'remove') { |
|
281 | + echo ' |
|
274 | 282 | <change id="', $change['id'], '" curAction="remove" section="', $change['section'], '" />'; |
275 | - else |
|
276 | - echo ' |
|
283 | + } else { |
|
284 | + echo ' |
|
277 | 285 | <change id="', $change['id'], '" curAction="insert" section="', $change['section'], '"> |
278 | 286 | <subject><![CDATA[', cleanXml($change['insert_value']['subject']), ']]></subject> |
279 | 287 | <time><![CDATA[', cleanXml($change['insert_value']['time']), ']]></time> |
280 | 288 | <body><![CDATA[', cleanXml($change['insert_value']['body']), ']]></body> |
281 | 289 | <poster><![CDATA[', cleanXml($change['insert_value']['poster']), ']]></poster> |
282 | 290 | </change>'; |
291 | + } |
|
283 | 292 | } |
284 | 293 | echo ' |
285 | 294 | </smf>'; |
@@ -310,10 +319,10 @@ discard block |
||
310 | 319 | echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '> |
311 | 320 | <smf>'; |
312 | 321 | |
313 | - if (empty($context['topics'])) |
|
314 | - echo ' |
|
322 | + if (empty($context['topics'])) { |
|
323 | + echo ' |
|
315 | 324 | <noresults>', $txt['search_no_results'], '</noresults>'; |
316 | - else |
|
325 | + } else |
|
317 | 326 | { |
318 | 327 | echo ' |
319 | 328 | <results>'; |
@@ -382,9 +391,10 @@ discard block |
||
382 | 391 | echo ' |
383 | 392 | <item type="category" id="', $category['id'], '"><![CDATA[', cleanXml($category['name']), ']]></item>'; |
384 | 393 | |
385 | - foreach ($category['boards'] as $board) |
|
386 | - echo ' |
|
394 | + foreach ($category['boards'] as $board) { |
|
395 | + echo ' |
|
387 | 396 | <item type="board" id="', $board['id'], '" childlevel="', $board['child_level'], '"><![CDATA[', cleanXml($board['name']), ']]></item>'; |
397 | + } |
|
388 | 398 | } |
389 | 399 | echo ' |
390 | 400 | </smf>'; |
@@ -400,9 +410,10 @@ discard block |
||
400 | 410 | echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '> |
401 | 411 | <smf>'; |
402 | 412 | |
403 | - foreach ($context['icons'] as $icon) |
|
404 | - echo ' |
|
413 | + foreach ($context['icons'] as $icon) { |
|
414 | + echo ' |
|
405 | 415 | <icon value="', $icon['value'], '" url="', $icon['url'], '"><![CDATA[', cleanXml($icon['name']), ']]></icon>'; |
416 | + } |
|
406 | 417 | |
407 | 418 | echo ' |
408 | 419 | </smf>'; |
@@ -452,16 +463,18 @@ discard block |
||
452 | 463 | foreach ($xml_data as $key => $data) |
453 | 464 | { |
454 | 465 | // A group? |
455 | - if (is_array($data) && isset($data['identifier'])) |
|
456 | - template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level); |
|
466 | + if (is_array($data) && isset($data['identifier'])) { |
|
467 | + template_generic_xml_recursive($data['children'], $key, $data['identifier'], $level); |
|
468 | + } |
|
457 | 469 | // An item... |
458 | 470 | elseif (is_array($data) && isset($data['value'])) |
459 | 471 | { |
460 | 472 | echo "\n", str_repeat("\t", $level), '<', $child_ident; |
461 | 473 | |
462 | - if (!empty($data['attributes'])) |
|
463 | - foreach ($data['attributes'] as $k => $v) |
|
474 | + if (!empty($data['attributes'])) { |
|
475 | + foreach ($data['attributes'] as $k => $v) |
|
464 | 476 | echo ' ' . $k . '="' . $v . '"'; |
477 | + } |
|
465 | 478 | echo '><![CDATA[', cleanXml($data['value']), ']]></', $child_ident, '>'; |
466 | 479 | } |
467 | 480 |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | <div class="windowbg"> |
32 | 32 | <ul id="likes">'; |
33 | 33 | |
34 | - foreach ($context['likers'] as $liker => $like_details) |
|
35 | - echo ' |
|
34 | + foreach ($context['likers'] as $liker => $like_details) { |
|
35 | + echo ' |
|
36 | 36 | <li> |
37 | 37 | ', $like_details['profile']['avatar']['image'], ' |
38 | 38 | <span> |
@@ -41,6 +41,7 @@ discard block |
||
41 | 41 | </span> |
42 | 42 | <span class="floatright">', $like_details['time'], '</span> |
43 | 43 | </li>'; |
44 | + } |
|
44 | 45 | |
45 | 46 | echo ' |
46 | 47 | </ul> |
@@ -61,11 +62,12 @@ discard block |
||
61 | 62 | echo ' |
62 | 63 | <ul class="floatleft">'; |
63 | 64 | |
64 | - if (!empty($context['data']['can_like'])) |
|
65 | - echo ' |
|
65 | + if (!empty($context['data']['can_like'])) { |
|
66 | + echo ' |
|
66 | 67 | <li class="like_button" id="', $context['data']['type'], '_', $context['data']['id_content'], '_likes"', '> |
67 | 68 | <a href="', $scripturl, '?action=likes;ltype=', $context['data']['type'], ';sa=like;like=', $context['data']['id_content'], ';', $context['session_var'], '=', $context['session_id'], '" class="', $context['data']['type'], '_like"><span class="generic_icons ', $context['data']['already_liked'] ? 'unlike' : 'like', '"></span> ', $context['data']['already_liked'] ? $txt['unlike'] : $txt['like'], '</a> |
68 | 69 | </li>'; |
70 | + } |
|
69 | 71 | |
70 | 72 | if (!empty($context['data']['count'])) |
71 | 73 | { |
@@ -26,9 +26,10 @@ discard block |
||
26 | 26 | </h3> |
27 | 27 | </div>'; |
28 | 28 | |
29 | - if ($context['ban']['is_new']) |
|
30 | - echo ' |
|
29 | + if ($context['ban']['is_new']) { |
|
30 | + echo ' |
|
31 | 31 | <div class="information noup">', $txt['ban_add_notes'], '</div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | // If there were errors creating the ban, show them. |
34 | 35 | if (!empty($context['error_messages'])) |
@@ -38,9 +39,10 @@ discard block |
||
38 | 39 | <strong>', $txt['ban_errors_detected'], '</strong> |
39 | 40 | <ul>'; |
40 | 41 | |
41 | - foreach ($context['error_messages'] as $error) |
|
42 | - echo ' |
|
42 | + foreach ($context['error_messages'] as $error) { |
|
43 | + echo ' |
|
43 | 44 | <li class="error">', $error, '</li>'; |
45 | + } |
|
44 | 46 | |
45 | 47 | echo ' |
46 | 48 | </ul> |
@@ -57,8 +59,8 @@ discard block |
||
57 | 59 | <input type="text" id="ban_name" name="ban_name" value="', $context['ban']['name'], '" size="45" maxlength="60"> |
58 | 60 | </dd>'; |
59 | 61 | |
60 | - if (isset($context['ban']['reason'])) |
|
61 | - echo ' |
|
62 | + if (isset($context['ban']['reason'])) { |
|
63 | + echo ' |
|
62 | 64 | <dt> |
63 | 65 | <strong><label for="reason">', $txt['ban_reason'], ':</label></strong><br> |
64 | 66 | <span class="smalltext">', $txt['ban_reason_desc'], '</span> |
@@ -66,9 +68,10 @@ discard block |
||
66 | 68 | <dd> |
67 | 69 | <textarea name="reason" id="reason" cols="40" rows="3">', $context['ban']['reason'], '</textarea> |
68 | 70 | </dd>'; |
71 | + } |
|
69 | 72 | |
70 | - if (isset($context['ban']['notes'])) |
|
71 | - echo ' |
|
73 | + if (isset($context['ban']['notes'])) { |
|
74 | + echo ' |
|
72 | 75 | <dt> |
73 | 76 | <strong><label for="ban_notes">', $txt['ban_notes'], ':</label></strong><br> |
74 | 77 | <span class="smalltext">', $txt['ban_notes_desc'], '</span> |
@@ -76,6 +79,7 @@ discard block |
||
76 | 79 | <dd> |
77 | 80 | <textarea name="notes" id="ban_notes" cols="40" rows="3">', $context['ban']['notes'], '</textarea> |
78 | 81 | </dd>'; |
82 | + } |
|
79 | 83 | |
80 | 84 | echo ' |
81 | 85 | </dl> |
@@ -115,8 +119,8 @@ discard block |
||
115 | 119 | <input type="text" name="main_ip" value="', $context['ban_suggestions']['main_ip'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
116 | 120 | </dd>'; |
117 | 121 | |
118 | - if (empty($modSettings['disableHostnameLookup'])) |
|
119 | - echo ' |
|
122 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
123 | + echo ' |
|
120 | 124 | <dt> |
121 | 125 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', !empty($context['ban_suggestions']['hostname']) ? ' checked' : '', '> |
122 | 126 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -124,6 +128,7 @@ discard block |
||
124 | 128 | <dd> |
125 | 129 | <input type="text" name="hostname" value="', $context['ban_suggestions']['hostname'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
126 | 130 | </dd>'; |
131 | + } |
|
127 | 132 | |
128 | 133 | echo ' |
129 | 134 | <dt> |
@@ -153,14 +158,15 @@ discard block |
||
153 | 158 | <dl class="settings">'; |
154 | 159 | |
155 | 160 | $count = 0; |
156 | - foreach ($ban_ips as $ip) |
|
157 | - echo ' |
|
161 | + foreach ($ban_ips as $ip) { |
|
162 | + echo ' |
|
158 | 163 | <dt> |
159 | 164 | <input type="checkbox" id="suggestions_', $key, '_', $count, '" name="ban_suggestions[', $key, '][]"', !empty($context['ban_suggestions']['saved_triggers'][$key]) && in_array($ip, $context['ban_suggestions']['saved_triggers'][$key]) ? ' checked' : '', ' value="', $ip, '"> |
160 | 165 | </dt> |
161 | 166 | <dd> |
162 | 167 | <label for="suggestions_', $key, '_', $count++, '">', $ip, '</label> |
163 | 168 | </dd>'; |
169 | + } |
|
164 | 170 | |
165 | 171 | echo ' |
166 | 172 | </dl>'; |
@@ -202,8 +208,8 @@ discard block |
||
202 | 208 | addLoadEvent(fUpdateStatus);'; |
203 | 209 | |
204 | 210 | // Auto suggest only needed for adding new bans, not editing |
205 | - if ($context['ban']['is_new'] && empty($_REQUEST['u'])) |
|
206 | - echo ' |
|
211 | + if ($context['ban']['is_new'] && empty($_REQUEST['u'])) { |
|
212 | + echo ' |
|
207 | 213 | var oAddMemberSuggest = new smc_AutoSuggest({ |
208 | 214 | sSelf: \'oAddMemberSuggest\', |
209 | 215 | sSessionId: smf_session_id, |
@@ -221,6 +227,7 @@ discard block |
||
221 | 227 | return true; |
222 | 228 | } |
223 | 229 | oAddMemberSuggest.registerCallback(\'onBeforeUpdate\', \'onUpdateName\');'; |
230 | + } |
|
224 | 231 | |
225 | 232 | echo ' |
226 | 233 | function confirmBan(aForm) |
@@ -269,8 +276,8 @@ discard block |
||
269 | 276 | <input type="text" name="main_ip" value="', $context['ban_trigger']['ip']['value'], '" size="44" onfocus="document.getElementById(\'main_ip_check\').checked = true;"> |
270 | 277 | </dd>'; |
271 | 278 | |
272 | - if (empty($modSettings['disableHostnameLookup'])) |
|
273 | - echo ' |
|
279 | + if (empty($modSettings['disableHostnameLookup'])) { |
|
280 | + echo ' |
|
274 | 281 | <dt> |
275 | 282 | <input type="checkbox" name="ban_suggestions[]" id="hostname_check" value="hostname"', $context['ban_trigger']['hostname']['selected'] ? ' checked' : '', '> |
276 | 283 | <label for="hostname_check">', $txt['ban_on_hostname'], '</label> |
@@ -278,6 +285,7 @@ discard block |
||
278 | 285 | <dd> |
279 | 286 | <input type="text" name="hostname" value="', $context['ban_trigger']['hostname']['value'], '" size="44" onfocus="document.getElementById(\'hostname_check\').checked = true;"> |
280 | 287 | </dd>'; |
288 | + } |
|
281 | 289 | |
282 | 290 | echo ' |
283 | 291 | <dt> |
@@ -20,13 +20,12 @@ discard block |
||
20 | 20 | // We completed some tasks? |
21 | 21 | if (!empty($context['tasks_were_run'])) |
22 | 22 | { |
23 | - if (empty($context['scheduled_errors'])) |
|
24 | - echo ' |
|
23 | + if (empty($context['scheduled_errors'])) { |
|
24 | + echo ' |
|
25 | 25 | <div class="infobox"> |
26 | 26 | ', $txt['scheduled_tasks_were_run'], ' |
27 | 27 | </div>'; |
28 | - |
|
29 | - else |
|
28 | + } else |
|
30 | 29 | { |
31 | 30 | echo ' |
32 | 31 | <div class="errorbox" id="errors"> |
@@ -35,14 +34,15 @@ discard block |
||
35 | 34 | <strong id="error_serious">', $txt['scheduled_tasks_were_run_errors'], '</strong> |
36 | 35 | </dt>'; |
37 | 36 | |
38 | - foreach ($context['scheduled_errors'] as $task => $errors) |
|
39 | - echo ' |
|
37 | + foreach ($context['scheduled_errors'] as $task => $errors) { |
|
38 | + echo ' |
|
40 | 39 | <dd class="error"> |
41 | 40 | <strong>', isset($txt['scheduled_task_' . $task]) ? $txt['scheduled_task_' . $task] : $task, '</strong> |
42 | 41 | <ul> |
43 | 42 | <li>', implode('</li><li>', $errors), '</li> |
44 | 43 | </ul> |
45 | 44 | </dd>'; |
45 | + } |
|
46 | 46 | |
47 | 47 | echo ' |
48 | 48 | </dl> |
@@ -36,11 +36,12 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | // An error? |
39 | - if (!empty($context['error_message'])) |
|
40 | - echo ' |
|
39 | + if (!empty($context['error_message'])) { |
|
40 | + echo ' |
|
41 | 41 | <div class="errorbox"> |
42 | 42 | ', $context['error_message'], ' |
43 | 43 | </div>'; |
44 | + } |
|
44 | 45 | |
45 | 46 | // Provide something of an introduction... |
46 | 47 | echo ' |
@@ -67,11 +68,12 @@ discard block |
||
67 | 68 | // If the files are not writable, we might! |
68 | 69 | if (!empty($context['still_not_writable'])) |
69 | 70 | { |
70 | - if (!empty($context['package_ftp']['error'])) |
|
71 | - echo ' |
|
71 | + if (!empty($context['package_ftp']['error'])) { |
|
72 | + echo ' |
|
72 | 73 | <div class="errorbox"> |
73 | 74 | ', $context['package_ftp']['error'], ' |
74 | 75 | </div>'; |
76 | + } |
|
75 | 77 | |
76 | 78 | echo ' |
77 | 79 | <div class="cat_bar"> |
@@ -150,11 +152,12 @@ discard block |
||
150 | 152 | </div>'; |
151 | 153 | |
152 | 154 | // Not writable? Oops, show an error for ya. |
153 | - if (!empty($context['lang_file_not_writable_message'])) |
|
154 | - echo ' |
|
155 | + if (!empty($context['lang_file_not_writable_message'])) { |
|
156 | + echo ' |
|
155 | 157 | <div class="errorbox"> |
156 | 158 | ', $context['lang_file_not_writable_message'], ' |
157 | 159 | </div>'; |
160 | + } |
|
158 | 161 | |
159 | 162 | // Show the language entries |
160 | 163 | echo ' |
@@ -199,9 +202,10 @@ discard block |
||
199 | 202 | <input type="submit" name="save_main" value="', $txt['save'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled' : '', ' class="button">'; |
200 | 203 | |
201 | 204 | // Allow deleting entries. English can't be deleted though. |
202 | - if ($context['lang_id'] != 'english') |
|
203 | - echo ' |
|
205 | + if ($context['lang_id'] != 'english') { |
|
206 | + echo ' |
|
204 | 207 | <input type="submit" name="delete_main" value="', $txt['delete'], '"', $context['lang_file_not_writable_message'] || !empty($context['file_entries']) ? ' disabled' : '', ' onclick="confirm(\'', $txt['languages_delete_confirm'], '\');" class="button">'; |
208 | + } |
|
205 | 209 | |
206 | 210 | echo ' |
207 | 211 | </div><!-- .windowbg --> |
@@ -223,9 +227,10 @@ discard block |
||
223 | 227 | echo ' |
224 | 228 | <optgroup label="', $theme['name'], '">'; |
225 | 229 | |
226 | - foreach ($theme['files'] as $file) |
|
227 | - echo ' |
|
230 | + foreach ($theme['files'] as $file) { |
|
231 | + echo ' |
|
228 | 232 | <option value="', $id_theme, '+', $file['id'], '"', $file['selected'] ? ' selected' : '', '> => ', $file['name'], '</option>'; |
233 | + } |
|
229 | 234 | |
230 | 235 | echo ' |
231 | 236 | </optgroup>'; |
@@ -240,11 +245,12 @@ discard block |
||
240 | 245 | <br class="clear">'; |
241 | 246 | |
242 | 247 | // Is it not writable? Show an error. |
243 | - if (!empty($context['entries_not_writable_message'])) |
|
244 | - echo ' |
|
248 | + if (!empty($context['entries_not_writable_message'])) { |
|
249 | + echo ' |
|
245 | 250 | <div class="errorbox"> |
246 | 251 | ', $context['entries_not_writable_message'], ' |
247 | 252 | </div>'; |
253 | + } |
|
248 | 254 | |
249 | 255 | // Already have some file entries? |
250 | 256 | if (!empty($context['file_entries'])) |
@@ -283,8 +289,8 @@ discard block |
||
283 | 289 | } |
284 | 290 | |
285 | 291 | // Odd number? |
286 | - if (!empty($cached)) |
|
287 | - echo ' |
|
292 | + if (!empty($cached)) { |
|
293 | + echo ' |
|
288 | 294 | |
289 | 295 | <dt> |
290 | 296 | <span class="smalltext">', $cached['key'], '</span> |
@@ -297,6 +303,7 @@ discard block |
||
297 | 303 | </dt> |
298 | 304 | <dd> |
299 | 305 | </dd>'; |
306 | + } |
|
300 | 307 | |
301 | 308 | echo ' |
302 | 309 | </dl> |
@@ -331,12 +338,13 @@ discard block |
||
331 | 338 | <input type="text" name="smf_add" size="40" value="', !empty($context['smf_search_term']) ? $context['smf_search_term'] : '', '">'; |
332 | 339 | |
333 | 340 | // Do we have some errors? Too bad. Display a little error box. |
334 | - if (!empty($context['smf_error'])) |
|
335 | - echo ' |
|
341 | + if (!empty($context['smf_error'])) { |
|
342 | + echo ' |
|
336 | 343 | <div> |
337 | 344 | <br> |
338 | 345 | <p class="errorbox">', $txt['add_language_error_' . $context['smf_error']], '</p> |
339 | 346 | </div>'; |
347 | + } |
|
340 | 348 | |
341 | 349 | echo ' |
342 | 350 | </fieldset> |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | </div><!-- .attached_BBC --> |
418 | 418 | <div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
419 | 419 | <div class="attach-ui"> |
420 | - <a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a> |
|
421 | - <a class="button upload">', $txt['upload'] ,'</a> |
|
420 | + <a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a> |
|
421 | + <a class="button upload">', $txt['upload'], '</a> |
|
422 | 422 | </div> |
423 | 423 | </div><!-- .attach-info --> |
424 | 424 | </div><!-- #au-template --> |
@@ -433,10 +433,10 @@ discard block |
||
433 | 433 | </dt> |
434 | 434 | <dd class="smalltext fallback"> |
435 | 435 | <div id="attachUpload" class="descbox"> |
436 | - <h5>', $txt['attach_drop_zone'] ,'</h5> |
|
437 | - <a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a> |
|
438 | - <a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a> |
|
439 | - <a class="button fileinput-button">', $txt['attach_add'] ,'</a> |
|
436 | + <h5>', $txt['attach_drop_zone'], '</h5> |
|
437 | + <a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a> |
|
438 | + <a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a> |
|
439 | + <a class="button fileinput-button">', $txt['attach_add'], '</a> |
|
440 | 440 | <div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
441 | 441 | <div class="fallback"> |
442 | 442 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | // Option to delete an event if user is editing one. |
542 | 542 | if ($context['make_event'] && !$context['event']['new']) |
543 | 543 | echo ' |
544 | - <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
|
544 | + <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">'; |
|
545 | 545 | |
546 | 546 | echo ' |
547 | 547 | </span> |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | });'; |
796 | 796 | |
797 | 797 | echo ' |
798 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
798 | + var oEditorID = "', $context['post_box_name'], '"; |
|
799 | 799 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
800 | 800 | </script>'; |
801 | 801 | |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | if ($context['can_quote']) |
828 | 828 | echo ' |
829 | 829 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
830 | - <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> |
|
830 | + <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> |
|
831 | 831 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
832 | 832 | </ul>'; |
833 | 833 | |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | <head> |
912 | 912 | <meta charset="', $context['character_set'], '"> |
913 | 913 | <title>', $txt['spell_check'], '</title> |
914 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
914 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
915 | 915 | <style> |
916 | 916 | body, td { |
917 | 917 | font-size: small; |
@@ -941,8 +941,8 @@ discard block |
||
941 | 941 | var spell_formname = window.opener.spell_formname; |
942 | 942 | var spell_fieldname = window.opener.spell_fieldname; |
943 | 943 | </script> |
944 | - <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script> |
|
945 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
944 | + <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script> |
|
945 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
946 | 946 | <script> |
947 | 947 | ', $context['spell_js'], ' |
948 | 948 | </script> |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | <head> |
987 | 987 | <meta charset="', $context['character_set'], '"> |
988 | 988 | <title>', $txt['retrieving_quote'], '</title> |
989 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
989 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
990 | 990 | </head> |
991 | 991 | <body> |
992 | 992 | ', $txt['retrieving_quote'], ' |
@@ -22,24 +22,26 @@ 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 | 33 | |
33 | - foreach ($context['icons'] as $icon) |
|
34 | - echo ' |
|
34 | + foreach ($context['icons'] as $icon) { |
|
35 | + echo ' |
|
35 | 36 | \'', $icon['value'], '\': \'', $icon['url'], '\'', $icon['is_last'] ? '' : ','; |
37 | + } |
|
36 | 38 | |
37 | 39 | echo ' |
38 | 40 | };'; |
39 | 41 | |
40 | 42 | // If this is a poll - use some javascript to ensure the user doesn't create a poll with illegal option combinations. |
41 | - if ($context['make_poll']) |
|
42 | - echo ' |
|
43 | + if ($context['make_poll']) { |
|
44 | + echo ' |
|
43 | 45 | var pollOptionNum = 0, pollTabIndex; |
44 | 46 | var pollOptionId = ', $context['last_choice_id'], '; |
45 | 47 | function addPollOption() |
@@ -58,11 +60,13 @@ discard block |
||
58 | 60 | |
59 | 61 | 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>'), '); |
60 | 62 | }'; |
63 | + } |
|
61 | 64 | |
62 | 65 | // If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here. |
63 | - if ($context['make_event']) |
|
64 | - echo ' |
|
66 | + if ($context['make_event']) { |
|
67 | + echo ' |
|
65 | 68 | var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];'; |
69 | + } |
|
66 | 70 | |
67 | 71 | // End of the javascript, start the form and display the link tree. |
68 | 72 | echo ' |
@@ -83,9 +87,10 @@ discard block |
||
83 | 87 | </div> |
84 | 88 | <br>'; |
85 | 89 | |
86 | - if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) |
|
87 | - echo ' |
|
90 | + if ($context['make_event'] && (!$context['event']['new'] || !empty($context['current_board']))) { |
|
91 | + echo ' |
|
88 | 92 | <input type="hidden" name="eventid" value="', $context['event']['id'], '">'; |
93 | + } |
|
89 | 94 | |
90 | 95 | // Start the main table. |
91 | 96 | echo ' |
@@ -110,26 +115,29 @@ discard block |
||
110 | 115 | </div>'; |
111 | 116 | |
112 | 117 | // If this won't be approved let them know! |
113 | - if (!$context['becomes_approved']) |
|
114 | - echo ' |
|
118 | + if (!$context['becomes_approved']) { |
|
119 | + echo ' |
|
115 | 120 | <div class="noticebox"> |
116 | 121 | <em>', $txt['wait_for_approval'], '</em> |
117 | 122 | <input type="hidden" name="not_approved" value="1"> |
118 | 123 | </div>'; |
124 | + } |
|
119 | 125 | |
120 | 126 | // If it's locked, show a message to warn the replier. |
121 | - if (!empty($context['locked'])) |
|
122 | - echo ' |
|
127 | + if (!empty($context['locked'])) { |
|
128 | + echo ' |
|
123 | 129 | <div class="errorbox"> |
124 | 130 | ', $txt['topic_locked_no_reply'], ' |
125 | 131 | </div>'; |
132 | + } |
|
126 | 133 | |
127 | - if (!empty($modSettings['drafts_post_enabled'])) |
|
128 | - echo ' |
|
134 | + if (!empty($modSettings['drafts_post_enabled'])) { |
|
135 | + echo ' |
|
129 | 136 | <div id="draft_section" class="infobox"', isset($context['draft_saved']) ? '' : ' style="display: none;"', '>', |
130 | 137 | sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), ' |
131 | 138 | ', (!empty($modSettings['drafts_keep_days']) ? ' <strong>' . sprintf($txt['draft_save_warning'], $modSettings['drafts_keep_days']) . '</strong>' : ''), ' |
132 | 139 | </div>'; |
140 | + } |
|
133 | 141 | |
134 | 142 | // The post header... important stuff |
135 | 143 | echo ' |
@@ -139,14 +147,15 @@ discard block |
||
139 | 147 | // Mod & theme authors can use the 'integrate_post_end' hook to modify or add to these (see Post.php) |
140 | 148 | if (!empty($context['posting_fields']) && is_array($context['posting_fields'])) |
141 | 149 | { |
142 | - foreach ($context['posting_fields'] as $pfid => $pf) |
|
143 | - echo ' |
|
150 | + foreach ($context['posting_fields'] as $pfid => $pf) { |
|
151 | + echo ' |
|
144 | 152 | <dt class="clear', !is_numeric($pfid) ? ' pf_' . $pfid : '', '"> |
145 | 153 | ', $pf['dt'], ' |
146 | 154 | </dt> |
147 | 155 | <dd', !is_numeric($pfid) ? ' class="pf_' . $pfid . '"' : '', '> |
148 | 156 | ', preg_replace('~<(input|select|textarea|button|area|a|object)\b~', '<$1 tabindex="' . $context['tabindex']++ . '"', $pf['dd']), ' |
149 | 157 | </dd>'; |
158 | + } |
|
150 | 159 | } |
151 | 160 | |
152 | 161 | echo ' |
@@ -180,9 +189,10 @@ discard block |
||
180 | 189 | echo ' |
181 | 190 | <optgroup label="', $category['name'], '">'; |
182 | 191 | |
183 | - foreach ($category['boards'] as $board) |
|
184 | - echo ' |
|
192 | + foreach ($category['boards'] as $board) { |
|
193 | + echo ' |
|
185 | 194 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
195 | + } |
|
186 | 196 | echo ' |
187 | 197 | </optgroup>'; |
188 | 198 | } |
@@ -218,9 +228,10 @@ discard block |
||
218 | 228 | <span class="label">', $txt['calendar_timezone'], '</span> |
219 | 229 | <select name="tz" id="tz"', !empty($context['event']['allday']) ? ' disabled' : '', '>'; |
220 | 230 | |
221 | - foreach ($context['all_timezones'] as $tz => $tzname) |
|
222 | - echo ' |
|
231 | + foreach ($context['all_timezones'] as $tz => $tzname) { |
|
232 | + echo ' |
|
223 | 233 | <option value="', $tz, '"', $tz == $context['event']['tz'] ? ' selected' : '', '>', $tzname, '</option>'; |
234 | + } |
|
224 | 235 | |
225 | 236 | echo ' |
226 | 237 | </select> |
@@ -249,14 +260,15 @@ discard block |
||
249 | 260 | </dd>'; |
250 | 261 | |
251 | 262 | // Loop through all the choices and print them out. |
252 | - foreach ($context['choices'] as $choice) |
|
253 | - echo ' |
|
263 | + foreach ($context['choices'] as $choice) { |
|
264 | + echo ' |
|
254 | 265 | <dt> |
255 | 266 | <label for="options-', $choice['id'], '">', $txt['option'], ' ', $choice['number'], '</label>: |
256 | 267 | </dt> |
257 | 268 | <dd> |
258 | 269 | <input type="text" name="options[', $choice['id'], ']" id="options-', $choice['id'], '" value="', $choice['label'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="255"> |
259 | 270 | </dd>'; |
271 | + } |
|
260 | 272 | |
261 | 273 | echo ' |
262 | 274 | <p id="pollMoreOptions"></p> |
@@ -286,14 +298,15 @@ discard block |
||
286 | 298 | <input type="checkbox" id="poll_change_vote" name="poll_change_vote"', !empty($context['poll']['change_vote']) ? ' checked' : '', '> |
287 | 299 | </dd>'; |
288 | 300 | |
289 | - if ($context['poll_options']['guest_vote_enabled']) |
|
290 | - echo ' |
|
301 | + if ($context['poll_options']['guest_vote_enabled']) { |
|
302 | + echo ' |
|
291 | 303 | <dt> |
292 | 304 | <label for="poll_guest_vote">', $txt['poll_guest_vote'], ':</label> |
293 | 305 | </dt> |
294 | 306 | <dd> |
295 | 307 | <input type="checkbox" id="poll_guest_vote" name="poll_guest_vote"', !empty($context['poll_options']['guest_vote']) ? ' checked' : '', '> |
296 | 308 | </dd>'; |
309 | + } |
|
297 | 310 | |
298 | 311 | echo ' |
299 | 312 | <dt> |
@@ -314,8 +327,8 @@ discard block |
||
314 | 327 | ', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'); |
315 | 328 | |
316 | 329 | // 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 ' |
|
330 | + if (isset($context['editing']) && $modSettings['show_modify']) { |
|
331 | + echo ' |
|
319 | 332 | <dl> |
320 | 333 | <dt class="clear"> |
321 | 334 | <span id="caption_edit_reason">', $txt['reason_for_edit'], ':</span> |
@@ -324,20 +337,23 @@ discard block |
||
324 | 337 | <input type="text" name="modify_reason"', isset($context['last_modified_reason']) ? ' value="' . $context['last_modified_reason'] . '"' : '', ' tabindex="', $context['tabindex']++, '" size="80" maxlength="80"> |
325 | 338 | </dd> |
326 | 339 | </dl>'; |
340 | + } |
|
327 | 341 | |
328 | 342 | // If this message has been edited in the past - display when it was. |
329 | - if (isset($context['last_modified'])) |
|
330 | - echo ' |
|
343 | + if (isset($context['last_modified'])) { |
|
344 | + echo ' |
|
331 | 345 | <div class="padding smalltext"> |
332 | 346 | ', $context['last_modified_text'], ' |
333 | 347 | </div>'; |
348 | + } |
|
334 | 349 | |
335 | 350 | // 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 ' |
|
351 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
352 | + echo ' |
|
338 | 353 | <div id="postAdditionalOptionsHeader"> |
339 | 354 | <strong><a href="#" id="postMoreExpandLink"> ', $context['can_post_attachment'] ? $txt['post_additionalopt_attach'] : $txt['post_additionalopt'], '</a></strong> |
340 | 355 | </div>'; |
356 | + } |
|
341 | 357 | |
342 | 358 | echo ' |
343 | 359 | <div id="postAdditionalOptions">'; |
@@ -370,19 +386,21 @@ discard block |
||
370 | 386 | ', $txt['uncheck_unwatchd_attach'], ': |
371 | 387 | </dd>'; |
372 | 388 | |
373 | - foreach ($context['current_attachments'] as $attachment) |
|
374 | - echo ' |
|
389 | + foreach ($context['current_attachments'] as $attachment) { |
|
390 | + echo ' |
|
375 | 391 | <dd class="smalltext"> |
376 | 392 | <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'] . ')' : ''), |
377 | 393 | !empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1024) / 1024), 0)) : '', '</label> |
378 | 394 | </dd>'; |
395 | + } |
|
379 | 396 | |
380 | 397 | echo ' |
381 | 398 | </dl>'; |
382 | 399 | |
383 | - if (!empty($context['files_in_session_warning'])) |
|
384 | - echo ' |
|
400 | + if (!empty($context['files_in_session_warning'])) { |
|
401 | + echo ' |
|
385 | 402 | <div class="smalltext">', $context['files_in_session_warning'], '</div>'; |
403 | + } |
|
386 | 404 | } |
387 | 405 | |
388 | 406 | // Is the user allowed to post any additional ones? If so give them the boxes to do it! |
@@ -443,8 +461,8 @@ discard block |
||
443 | 461 | ', empty($modSettings['attachmentSizeLimit']) ? '' : ('<input type="hidden" name="MAX_FILE_SIZE" value="' . $modSettings['attachmentSizeLimit'] * 1024 . '">'); |
444 | 462 | |
445 | 463 | // Show more boxes if they aren't approaching that limit. |
446 | - if ($context['num_allowed_attachments'] > 1) |
|
447 | - echo ' |
|
464 | + if ($context['num_allowed_attachments'] > 1) { |
|
465 | + echo ' |
|
448 | 466 | <script> |
449 | 467 | var allowed_attachments = ', $context['num_allowed_attachments'], '; |
450 | 468 | var current_attachment = 1; |
@@ -464,6 +482,7 @@ discard block |
||
464 | 482 | <a href="#" onclick="addAttachment(); return false;">(', $txt['more_attachments'], ')</a> |
465 | 483 | </div><!-- .fallback --> |
466 | 484 | </div><!-- #attachUpload -->'; |
485 | + } |
|
467 | 486 | |
468 | 487 | echo ' |
469 | 488 | </dd>'; |
@@ -475,21 +494,25 @@ discard block |
||
475 | 494 | <dd class="smalltext">'; |
476 | 495 | |
477 | 496 | // Show some useful information such as allowed extensions, maximum size and amount of attachments allowed. |
478 | - if (!empty($modSettings['attachmentCheckExtensions'])) |
|
479 | - echo ' |
|
497 | + if (!empty($modSettings['attachmentCheckExtensions'])) { |
|
498 | + echo ' |
|
480 | 499 | ', $txt['allowed_types'], ': ', $context['allowed_extensions'], '<br>'; |
500 | + } |
|
481 | 501 | |
482 | - if (!empty($context['attachment_restrictions'])) |
|
483 | - echo ' |
|
502 | + if (!empty($context['attachment_restrictions'])) { |
|
503 | + echo ' |
|
484 | 504 | ', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), '<br>'; |
505 | + } |
|
485 | 506 | |
486 | - if ($context['num_allowed_attachments'] == 0) |
|
487 | - echo ' |
|
507 | + if ($context['num_allowed_attachments'] == 0) { |
|
508 | + echo ' |
|
488 | 509 | ', $txt['attach_limit_nag'], '<br>'; |
510 | + } |
|
489 | 511 | |
490 | - if (!$context['can_post_attachment_unapproved']) |
|
491 | - echo ' |
|
512 | + if (!$context['can_post_attachment_unapproved']) { |
|
513 | + echo ' |
|
492 | 514 | <span class="alert">', $txt['attachment_requires_approval'], '</span>', '<br>'; |
515 | + } |
|
493 | 516 | |
494 | 517 | echo ' |
495 | 518 | </dd> |
@@ -513,24 +536,26 @@ discard block |
||
513 | 536 | <dt><strong>', $txt['subject'], '</strong></dt> |
514 | 537 | <dd><strong>', $txt['draft_saved_on'], '</strong></dd>'; |
515 | 538 | |
516 | - foreach ($context['drafts'] as $draft) |
|
517 | - echo ' |
|
539 | + foreach ($context['drafts'] as $draft) { |
|
540 | + echo ' |
|
518 | 541 | <dt>', $draft['link'], '</dt> |
519 | 542 | <dd>', $draft['poster_time'], '</dd>'; |
543 | + } |
|
520 | 544 | echo ' |
521 | 545 | </dl> |
522 | 546 | </div>'; |
523 | 547 | } |
524 | 548 | |
525 | 549 | // Is visual verification enabled? |
526 | - if ($context['require_verification']) |
|
527 | - echo ' |
|
550 | + if ($context['require_verification']) { |
|
551 | + echo ' |
|
528 | 552 | <div class="post_verification"> |
529 | 553 | <span', !empty($context['post_error']['need_qr_verification']) ? ' class="error"' : '', '> |
530 | 554 | <strong>', $txt['verification'], ':</strong> |
531 | 555 | </span> |
532 | 556 | ', template_control_verification($context['visual_verification_id'], 'all'), ' |
533 | 557 | </div>'; |
558 | + } |
|
534 | 559 | |
535 | 560 | // Finally, the submit buttons. |
536 | 561 | echo ' |
@@ -539,9 +564,10 @@ discard block |
||
539 | 564 | ', template_control_richedit_buttons($context['post_box_name']); |
540 | 565 | |
541 | 566 | // Option to delete an event if user is editing one. |
542 | - if ($context['make_event'] && !$context['event']['new']) |
|
543 | - echo ' |
|
567 | + if ($context['make_event'] && !$context['event']['new']) { |
|
568 | + echo ' |
|
544 | 569 | <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
570 | + } |
|
545 | 571 | |
546 | 572 | echo ' |
547 | 573 | </span> |
@@ -550,9 +576,10 @@ discard block |
||
550 | 576 | <br class="clear">'; |
551 | 577 | |
552 | 578 | // Assuming this isn't a new topic pass across the last message id. |
553 | - if (isset($context['topic_last_message'])) |
|
554 | - echo ' |
|
579 | + if (isset($context['topic_last_message'])) { |
|
580 | + echo ' |
|
555 | 581 | <input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">'; |
582 | + } |
|
556 | 583 | |
557 | 584 | echo ' |
558 | 585 | <input type="hidden" name="additional_options" id="additional_options" value="', $context['show_additional_options'] ? '1' : '0', '"> |
@@ -694,9 +721,10 @@ discard block |
||
694 | 721 | |
695 | 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>\';'; |
696 | 723 | |
697 | - if ($context['can_quote']) |
|
698 | - echo ' |
|
724 | + if ($context['can_quote']) { |
|
725 | + echo ' |
|
699 | 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 | + } |
|
700 | 728 | |
701 | 729 | echo ' |
702 | 730 | newPostsHTML += \'<br class="clear">\'; |
@@ -739,8 +767,8 @@ discard block |
||
739 | 767 | }'; |
740 | 768 | |
741 | 769 | // Code for showing and hiding additional options. |
742 | - if (!empty($modSettings['additional_options_collapsable'])) |
|
743 | - echo ' |
|
770 | + if (!empty($modSettings['additional_options_collapsable'])) { |
|
771 | + echo ' |
|
744 | 772 | var oSwapAdditionalOptions = new smc_Toggle({ |
745 | 773 | bToggleEnabled: true, |
746 | 774 | bCurrentlyCollapsed: ', $context['show_additional_options'] ? 'false' : 'true', ', |
@@ -768,10 +796,11 @@ discard block |
||
768 | 796 | } |
769 | 797 | ] |
770 | 798 | });'; |
799 | + } |
|
771 | 800 | |
772 | 801 | // Code for showing and hiding drafts |
773 | - if (!empty($context['drafts'])) |
|
774 | - echo ' |
|
802 | + if (!empty($context['drafts'])) { |
|
803 | + echo ' |
|
775 | 804 | var oSwapDraftOptions = new smc_Toggle({ |
776 | 805 | bToggleEnabled: true, |
777 | 806 | bCurrentlyCollapsed: true, |
@@ -793,6 +822,7 @@ discard block |
||
793 | 822 | } |
794 | 823 | ] |
795 | 824 | });'; |
825 | + } |
|
796 | 826 | |
797 | 827 | echo ' |
798 | 828 | var oEditorID = "', $context['post_box_name'] ,'"; |
@@ -813,8 +843,9 @@ discard block |
||
813 | 843 | foreach ($context['previous_posts'] as $post) |
814 | 844 | { |
815 | 845 | $ignoring = false; |
816 | - if (!empty($post['is_ignored'])) |
|
817 | - $ignored_posts[] = $ignoring = $post['id']; |
|
846 | + if (!empty($post['is_ignored'])) { |
|
847 | + $ignored_posts[] = $ignoring = $post['id']; |
|
848 | + } |
|
818 | 849 | |
819 | 850 | echo ' |
820 | 851 | <div class="windowbg"> |
@@ -824,22 +855,24 @@ discard block |
||
824 | 855 | </h5> |
825 | 856 | - ', $post['time']; |
826 | 857 | |
827 | - if ($context['can_quote']) |
|
828 | - echo ' |
|
858 | + if ($context['can_quote']) { |
|
859 | + echo ' |
|
829 | 860 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
830 | 861 | <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> |
831 | 862 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
832 | 863 | </ul>'; |
864 | + } |
|
833 | 865 | |
834 | 866 | echo ' |
835 | 867 | <br class="clear">'; |
836 | 868 | |
837 | - if ($ignoring) |
|
838 | - echo ' |
|
869 | + if ($ignoring) { |
|
870 | + echo ' |
|
839 | 871 | <div id="msg_', $post['id'], '_ignored_prompt" class="smalltext"> |
840 | 872 | ', $txt['ignoring_user'], ' |
841 | 873 | <a href="#" id="msg_', $post['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a> |
842 | 874 | </div>'; |
875 | + } |
|
843 | 876 | |
844 | 877 | echo ' |
845 | 878 | <div class="list_posts smalltext" id="msg_', $post['id'], '_body" data-msgid="', $post['id'], '">', $post['message'], '</div> |
@@ -993,10 +1026,10 @@ discard block |
||
993 | 1026 | <div id="temporary_posting_area" style="display: none;"></div> |
994 | 1027 | <script>'; |
995 | 1028 | |
996 | - if ($context['close_window']) |
|
997 | - echo ' |
|
1029 | + if ($context['close_window']) { |
|
1030 | + echo ' |
|
998 | 1031 | window.close();'; |
999 | - else |
|
1032 | + } else |
|
1000 | 1033 | { |
1001 | 1034 | // Lucky for us, Internet Explorer has an "innerText" feature which basically converts entities <--> text. Use it if possible ;) |
1002 | 1035 | echo ' |
@@ -1050,11 +1083,12 @@ discard block |
||
1050 | 1083 | </p> |
1051 | 1084 | <ul>'; |
1052 | 1085 | |
1053 | - foreach ($context['groups'] as $group) |
|
1054 | - echo ' |
|
1086 | + foreach ($context['groups'] as $group) { |
|
1087 | + echo ' |
|
1055 | 1088 | <li> |
1056 | 1089 | <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> |
1057 | 1090 | </li>'; |
1091 | + } |
|
1058 | 1092 | |
1059 | 1093 | echo ' |
1060 | 1094 | <li> |
@@ -41,11 +41,12 @@ discard block |
||
41 | 41 | </div>'; |
42 | 42 | |
43 | 43 | // If this is an existing set, and there are still un-added smileys - offer an import opportunity. |
44 | - if (!empty($context['current_set']['can_import'])) |
|
45 | - echo ' |
|
44 | + if (!empty($context['current_set']['can_import'])) { |
|
45 | + echo ' |
|
46 | 46 | <div class="information"> |
47 | 47 | ', $context['current_set']['can_import'] == 1 ? sprintf($txt['smiley_set_import_single'], $context['current_set']['import_url']) : sprintf($txt['smiley_set_import_multiple'], $context['current_set']['can_import'], $context['current_set']['import_url']), ' |
48 | 48 | </div>'; |
49 | + } |
|
49 | 50 | |
50 | 51 | echo ' |
51 | 52 | <div class="windowbg2 noup"> |
@@ -62,20 +63,20 @@ discard block |
||
62 | 63 | <dd> |
63 | 64 | ', $modSettings['smileys_url'], '/'; |
64 | 65 | |
65 | - if ($context['current_set']['id'] == 'default') |
|
66 | - echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
67 | - |
|
68 | - elseif (empty($context['smiley_set_dirs'])) |
|
69 | - echo ' |
|
66 | + if ($context['current_set']['id'] == 'default') { |
|
67 | + echo '<strong>default</strong><input type="hidden" name="smiley_sets_path" id="smiley_sets_path" value="default">'; |
|
68 | + } elseif (empty($context['smiley_set_dirs'])) { |
|
69 | + echo ' |
|
70 | 70 | <input type="text" name="smiley_sets_path" id="smiley_sets_path" value="', $context['current_set']['path'], '"> '; |
71 | - else |
|
71 | + } else |
|
72 | 72 | { |
73 | 73 | echo ' |
74 | 74 | <select name="smiley_sets_path" id="smiley_sets_path">'; |
75 | 75 | |
76 | - foreach ($context['smiley_set_dirs'] as $smiley_set_dir) |
|
77 | - echo ' |
|
76 | + foreach ($context['smiley_set_dirs'] as $smiley_set_dir) { |
|
77 | + echo ' |
|
78 | 78 | <option value="', $smiley_set_dir['id'], '"', $smiley_set_dir['current'] ? ' selected' : '', $smiley_set_dir['selectable'] ? '' : ' disabled', '>', $smiley_set_dir['id'], '</option>'; |
79 | + } |
|
79 | 80 | echo ' |
80 | 81 | </select> '; |
81 | 82 | } |
@@ -90,14 +91,15 @@ discard block |
||
90 | 91 | </dd>'; |
91 | 92 | |
92 | 93 | // If this is a new smiley set they have the option to import smileys already in the directory. |
93 | - if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) |
|
94 | - echo ' |
|
94 | + if ($context['current_set']['is_new'] && !empty($modSettings['smiley_enable'])) { |
|
95 | + echo ' |
|
95 | 96 | <dt> |
96 | 97 | <strong><label for="smiley_sets_import">', $txt['smiley_set_import_directory'], '</label>: </strong> |
97 | 98 | </dt> |
98 | 99 | <dd> |
99 | 100 | <input type="checkbox" name="smiley_sets_import" id="smiley_sets_import" value="1"> |
100 | 101 | </dd>'; |
102 | + } |
|
101 | 103 | |
102 | 104 | echo ' |
103 | 105 | </dl> |
@@ -131,9 +133,10 @@ discard block |
||
131 | 133 | <dd> |
132 | 134 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $context['current_smiley']['filename'], '" id="preview" alt=""> (', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();">'; |
133 | 135 | |
134 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
135 | - echo ' |
|
136 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
137 | + echo ' |
|
136 | 138 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
139 | + } |
|
137 | 140 | |
138 | 141 | echo ' |
139 | 142 | </select>) |
@@ -149,17 +152,18 @@ discard block |
||
149 | 152 | </dt> |
150 | 153 | <dd>'; |
151 | 154 | |
152 | - if (empty($context['filenames'])) |
|
153 | - echo ' |
|
155 | + if (empty($context['filenames'])) { |
|
156 | + echo ' |
|
154 | 157 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '">'; |
155 | - else |
|
158 | + } else |
|
156 | 159 | { |
157 | 160 | echo ' |
158 | 161 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();">'; |
159 | 162 | |
160 | - foreach ($context['filenames'] as $filename) |
|
161 | - echo ' |
|
163 | + foreach ($context['filenames'] as $filename) { |
|
164 | + echo ' |
|
162 | 165 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
166 | + } |
|
163 | 167 | echo ' |
164 | 168 | </select>'; |
165 | 169 | } |
@@ -228,9 +232,10 @@ discard block |
||
228 | 232 | <dd> |
229 | 233 | ', $txt['smiley_preview_using'], ': <select name="set" onchange="updatePreview();selectMethod(\'existing\');">'; |
230 | 234 | |
231 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
232 | - echo ' |
|
235 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
236 | + echo ' |
|
233 | 237 | <option value="', $smiley_set['path'], '"', $context['selected_set'] == $smiley_set['path'] ? ' selected' : '', '>', $smiley_set['name'], '</option>'; |
238 | + } |
|
234 | 239 | |
235 | 240 | echo ' |
236 | 241 | </select> |
@@ -240,17 +245,18 @@ discard block |
||
240 | 245 | </dt> |
241 | 246 | <dd>'; |
242 | 247 | |
243 | - if (empty($context['filenames'])) |
|
244 | - echo ' |
|
248 | + if (empty($context['filenames'])) { |
|
249 | + echo ' |
|
245 | 250 | <input type="text" name="smiley_filename" id="smiley_filename" value="', $context['current_smiley']['filename'], '" onchange="selectMethod(\'existing\');">'; |
246 | - else |
|
251 | + } else |
|
247 | 252 | { |
248 | 253 | echo ' |
249 | 254 | <select name="smiley_filename" id="smiley_filename" onchange="updatePreview();selectMethod(\'existing\');">'; |
250 | 255 | |
251 | - foreach ($context['filenames'] as $filename) |
|
252 | - echo ' |
|
256 | + foreach ($context['filenames'] as $filename) { |
|
257 | + echo ' |
|
253 | 258 | <option value="', $filename['id'], '"', $filename['selected'] ? ' selected' : '', '>', $filename['id'], '</option>'; |
259 | + } |
|
254 | 260 | echo ' |
255 | 261 | </select>'; |
256 | 262 | } |
@@ -279,14 +285,15 @@ discard block |
||
279 | 285 | |
280 | 286 | <dl id="uploadMore" style="display: none;" class="settings">'; |
281 | 287 | |
282 | - foreach ($context['smiley_sets'] as $smiley_set) |
|
283 | - echo ' |
|
288 | + foreach ($context['smiley_sets'] as $smiley_set) { |
|
289 | + echo ' |
|
284 | 290 | <dt> |
285 | 291 | ', sprintf($txt['smileys_add_upload_for'], '<strong>' . $smiley_set['name'] . '</strong>'), ': |
286 | 292 | </dt> |
287 | 293 | <dd> |
288 | 294 | <input type="file" name="individual_', $smiley_set['name'], '" onchange="selectMethod(\'upload\');"> |
289 | 295 | </dd>'; |
296 | + } |
|
290 | 297 | |
291 | 298 | echo ' |
292 | 299 | </dl> |
@@ -357,27 +364,30 @@ discard block |
||
357 | 364 | |
358 | 365 | foreach ($location['rows'] as $row) |
359 | 366 | { |
360 | - if (!empty($context['move_smiley'])) |
|
361 | - echo ' |
|
367 | + if (!empty($context['move_smiley'])) { |
|
368 | + echo ' |
|
362 | 369 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $row[0]['row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
370 | + } |
|
363 | 371 | |
364 | 372 | foreach ($row as $smiley) |
365 | 373 | { |
366 | - if (empty($context['move_smiley'])) |
|
367 | - echo ' |
|
374 | + if (empty($context['move_smiley'])) { |
|
375 | + echo ' |
|
368 | 376 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;move=', $smiley['id'], '"><img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '"></a>'; |
369 | - else |
|
370 | - echo ' |
|
377 | + } else { |
|
378 | + echo ' |
|
371 | 379 | <img src="', $modSettings['smileys_url'], '/', $modSettings['smiley_sets_default'], '/', $smiley['filename'], '" alt="', $smiley['description'], '" ', $smiley['selected'] ? 'class="selected_item"' : '', '> |
372 | 380 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';after=', $smiley['id'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '" title="', $txt['smileys_move_here'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
381 | + } |
|
373 | 382 | } |
374 | 383 | |
375 | 384 | echo ' |
376 | 385 | <br>'; |
377 | 386 | } |
378 | - if (!empty($context['move_smiley'])) |
|
379 | - echo ' |
|
387 | + if (!empty($context['move_smiley'])) { |
|
388 | + echo ' |
|
380 | 389 | <a href="', $scripturl, '?action=admin;area=smileys;sa=setorder;location=', $location['id'], ';source=', $context['move_smiley'], ';row=', $location['last_row'], ';reorder=1;', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons select_below" title="', $txt['smileys_move_here'], '"></span></a>'; |
390 | + } |
|
381 | 391 | echo ' |
382 | 392 | </div><!-- .windowbg2 --> |
383 | 393 | <input type="hidden" name="reorder" value="1"> |
@@ -414,14 +424,15 @@ discard block |
||
414 | 424 | <div class="windowbg2"> |
415 | 425 | <dl class="settings">'; |
416 | 426 | |
417 | - if (!$context['new_icon']) |
|
418 | - echo ' |
|
427 | + if (!$context['new_icon']) { |
|
428 | + echo ' |
|
419 | 429 | <dt> |
420 | 430 | <strong>', $txt['smiley_preview'], ': </strong> |
421 | 431 | </dt> |
422 | 432 | <dd> |
423 | 433 | <img src="', $context['icon']['image_url'], '" alt="', $context['icon']['title'], '"> |
424 | 434 | </dd>'; |
435 | + } |
|
425 | 436 | |
426 | 437 | echo ' |
427 | 438 | <dt> |
@@ -448,9 +459,10 @@ discard block |
||
448 | 459 | echo ' |
449 | 460 | <optgroup label="', $category['name'], '">'; |
450 | 461 | |
451 | - foreach ($category['boards'] as $board) |
|
452 | - echo ' |
|
462 | + foreach ($category['boards'] as $board) { |
|
463 | + echo ' |
|
453 | 464 | <option value="', $board['id'], '"', $board['selected'] ? ' selected' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], '</option>'; |
465 | + } |
|
454 | 466 | |
455 | 467 | echo ' |
456 | 468 | </optgroup>'; |
@@ -467,19 +479,21 @@ discard block |
||
467 | 479 | <option value="0"', empty($context['icon']['after']) ? ' selected' : '', '>', $txt['icons_location_first_icon'], '</option>'; |
468 | 480 | |
469 | 481 | // Print the list of all the icons it can be put after... |
470 | - foreach ($context['icons'] as $id => $data) |
|
471 | - if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
482 | + foreach ($context['icons'] as $id => $data) { |
|
483 | + if (empty($context['icon']['id']) || $id != $context['icon']['id']) |
|
472 | 484 | echo ' |
473 | 485 | <option value="', $id, '"', !empty($context['icon']['after']) && $id == $context['icon']['after'] ? ' selected' : '', '>', $txt['icons_location_after'], ': ', $data['title'], '</option>'; |
486 | + } |
|
474 | 487 | |
475 | 488 | echo ' |
476 | 489 | </select> |
477 | 490 | </dd> |
478 | 491 | </dl>'; |
479 | 492 | |
480 | - if (!$context['new_icon']) |
|
481 | - echo ' |
|
493 | + if (!$context['new_icon']) { |
|
494 | + echo ' |
|
482 | 495 | <input type="hidden" name="icon" value="', $context['icon']['id'], '">'; |
496 | + } |
|
483 | 497 | |
484 | 498 | echo ' |
485 | 499 | <input type="submit" name="icons_save" value="', $txt['smileys_save'], '" class="button"> |
@@ -62,16 +62,17 @@ |
||
62 | 62 | <div id="error_box" class="errorbox"> |
63 | 63 | <ul id="error_list">'; |
64 | 64 | |
65 | - foreach ($context['post_errors'] as $key => $error) |
|
66 | - echo ' |
|
65 | + foreach ($context['post_errors'] as $key => $error) { |
|
66 | + echo ' |
|
67 | 67 | <li id="error_', $key, '" class="error">', $error, '</li>'; |
68 | + } |
|
68 | 69 | |
69 | 70 | echo ' |
70 | 71 | </ul>'; |
71 | - } |
|
72 | - else |
|
73 | - echo ' |
|
72 | + } else { |
|
73 | + echo ' |
|
74 | 74 | <div style="display:none" id="error_box" class="errorbox">'; |
75 | + } |
|
75 | 76 | |
76 | 77 | echo ' |
77 | 78 | </div>'; |