Issues (1061)

Themes/default/Display.template.php (9 issues)

Labels
Severity
1
<?php
2
/**
3
 * Simple Machines Forum (SMF)
4
 *
5
 * @package SMF
6
 * @author Simple Machines https://www.simplemachines.org
7
 * @copyright 2020 Simple Machines and individual contributors
8
 * @license https://www.simplemachines.org/about/smf/license.php BSD
9
 *
10
 * @version 2.1 RC2
11
 */
12
13
/**
14
 * This template handles displaying a topic
15
 */
16
function template_main()
17
{
18
	global $context, $settings, $options, $txt, $scripturl, $modSettings;
19
20
	// Let them know, if their report was a success!
21
	if ($context['report_sent'])
22
		echo '
23
		<div class="infobox">
24
			', $txt['report_sent'], '
25
		</div>';
26
27
	// Let them know why their message became unapproved.
28
	if ($context['becomesUnapproved'])
29
		echo '
30
		<div class="noticebox">
31
			', $txt['post_becomes_unapproved'], '
32
		</div>';
33
34
	// Show new topic info here?
35
	echo '
36
		<div id="display_head" class="information">
37
			<h2 class="display_title">
38
				<span id="top_subject">', $context['subject'], '</span>', ($context['is_locked']) ? ' <span class="main_icons lock"></span>' : '', ($context['is_sticky']) ? ' <span class="main_icons sticky"></span>' : '', '
39
			</h2>
40
			<p>', $txt['started_by'], ' ', $context['topic_poster_name'], ', ', $context['topic_started_time'], '</p>';
41
42
	// Next - Prev
43
	echo '
44
			<span class="nextlinks floatright">', $context['previous_next'], '</span>';
45
46
	if (!empty($settings['display_who_viewing']))
47
	{
48
		echo '
49
			<p>';
50
51
		// Show just numbers...?
52
		if ($settings['display_who_viewing'] == 1)
53
			echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
54
		// Or show the actual people viewing the topic?
55
		else
56
			echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
57
58
		// Now show how many guests are here too.
59
		echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
60
			</p>';
61
	}
62
63
	// Show the anchor for the top and for the first message. If the first message is new, say so.
64
	echo '
65
		</div><!-- #display_head -->
66
		<a id="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a id="new"></a>' : '';
67
68
	// Is this topic also a poll?
69
	if ($context['is_poll'])
70
	{
71
		echo '
72
		<div id="poll">
73
			<div class="cat_bar">
74
				<h3 class="catbg">
75
					<span class="main_icons poll"></span>', $context['poll']['is_locked'] ? '<span class="main_icons lock"></span>' : '', ' ', $context['poll']['question'], '
76
				</h3>
77
			</div>
78
			<div class="windowbg">
79
				<div id="poll_options">';
80
81
		// Are they not allowed to vote but allowed to view the options?
82
		if ($context['poll']['show_results'] || !$context['allow_vote'])
83
		{
84
			echo '
85
					<dl class="options">';
86
87
			// Show each option with its corresponding percentage bar.
88
			foreach ($context['poll']['options'] as $option)
89
			{
90
				echo '
91
						<dt class="', $option['voted_this'] ? ' voted' : '', '">', $option['option'], '</dt>
92
						<dd class="statsbar generic_bar', $option['voted_this'] ? ' voted' : '', '">';
93
94
				if ($context['allow_results_view'])
95
					echo '
96
							', $option['bar_ndt'], '
97
							<span class="percentage">', $option['votes'], ' (', $option['percent'], '%)</span>';
98
99
				echo '
100
						</dd>';
101
			}
102
103
			echo '
104
					</dl>';
105
106
			if ($context['allow_results_view'])
107
				echo '
108
					<p><strong>', $txt['poll_total_voters'], ':</strong> ', $context['poll']['total_votes'], '</p>';
109
		}
110
		// They are allowed to vote! Go to it!
111
		else
112
		{
113
			echo '
114
					<form action="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], '" method="post" accept-charset="', $context['character_set'], '">';
115
116
			// Show a warning if they are allowed more than one option.
117
			if ($context['poll']['allowed_warning'])
118
				echo '
119
						<p class="smallpadding">', $context['poll']['allowed_warning'], '</p>';
120
121
			echo '
122
						<ul class="options">';
123
124
			// Show each option with its button - a radio likely.
125
			foreach ($context['poll']['options'] as $option)
126
				echo '
127
							<li>', $option['vote_button'], ' <label for="', $option['id'], '">', $option['option'], '</label></li>';
128
129
			echo '
130
						</ul>
131
						<div class="submitbutton">
132
							<input type="submit" value="', $txt['poll_vote'], '" class="button">
133
							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
134
						</div>
135
					</form>';
136
		}
137
138
		// Is the clock ticking?
139
		if (!empty($context['poll']['expire_time']))
140
			echo '
141
					<p><strong>', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ':</strong> ', $context['poll']['expire_time'], '</p>';
142
143
		echo '
144
				</div><!-- #poll_options -->
145
			</div><!-- .windowbg -->
146
		</div><!-- #poll -->
147
		<div id="pollmoderation">';
148
149
		template_button_strip($context['poll_buttons']);
150
151
		echo '
152
		</div>';
153
	}
154
155
	// Does this topic have some events linked to it?
156
	if (!empty($context['linked_calendar_events']))
157
	{
158
		echo '
159
		<div class="title_bar">
160
			<h3 class="titlebg">', $txt['calendar_linked_events'], '</h3>
161
		</div>
162
		<div class="information">
163
			<ul>';
164
165
		foreach ($context['linked_calendar_events'] as $event)
166
		{
167
			echo '
168
				<li>
169
					<strong class="event_title"><a href="', $scripturl, '?action=calendar;event=', $event['id'], '">', $event['title'], '</a></strong>';
170
171
			if ($event['can_edit'])
172
				echo ' <a href="' . $event['modify_href'] . '"><span class="main_icons calendar_modify" title="', $txt['calendar_edit'], '"></span></a>';
173
174
			if ($event['can_export'])
175
				echo ' <a href="' . $event['export_href'] . '"><span class="main_icons calendar_export" title="', $txt['calendar_export'], '"></span></a>';
176
177
			echo '
178
					<br>';
179
180
			if (!empty($event['allday']))
181
			{
182
				echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), '</time>', ($event['start_date'] != $event['end_date']) ? ' &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">' . trim($event['end_date_local']) . '</time>' : '';
183
			}
184
			else
185
			{
186
				// Display event info relative to user's local timezone
187
				echo '<time datetime="' . $event['start_iso_gmdate'] . '">', trim($event['start_date_local']), ', ', trim($event['start_time_local']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
188
189
				if ($event['start_date_local'] != $event['end_date_local'])
190
					echo trim($event['end_date_local']) . ', ';
191
192
				echo trim($event['end_time_local']);
193
194
				// Display event info relative to original timezone
195
				if ($event['start_date_local'] . $event['start_time_local'] != $event['start_date_orig'] . $event['start_time_orig'])
196
				{
197
					echo '</time> (<time datetime="' . $event['start_iso_gmdate'] . '">';
198
199
					if ($event['start_date_orig'] != $event['start_date_local'] || $event['end_date_orig'] != $event['end_date_local'] || $event['start_date_orig'] != $event['end_date_orig'])
200
						echo trim($event['start_date_orig']), ', ';
201
202
					echo trim($event['start_time_orig']), '</time> &ndash; <time datetime="' . $event['end_iso_gmdate'] . '">';
203
204
					if ($event['start_date_orig'] != $event['end_date_orig'])
205
						echo trim($event['end_date_orig']) . ', ';
206
207
					echo trim($event['end_time_orig']), ' ', $event['tz_abbrev'], '</time>)';
208
				}
209
				// Event is scheduled in the user's own timezone? Let 'em know, just to avoid confusion
210
				else
211
					echo ' ', $event['tz_abbrev'], '</time>';
212
			}
213
214
			if (!empty($event['location']))
215
				echo '
216
					<br>', $event['location'];
217
218
			echo '
219
				</li>';
220
		}
221
		echo '
222
			</ul>
223
		</div><!-- .information -->';
224
	}
225
226
	// Show the page index... "Pages: [1]".
227
	echo '
228
		<div class="pagesection top">
229
			', template_button_strip($context['normal_buttons'], 'right'), '
0 ignored issues
show
Are you sure the usage of template_button_strip($c...mal_buttons'], 'right') is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
230
			', $context['menu_separator'], '
231
			<div class="pagelinks floatleft">
232
				<a href="#bot" class="button">', $txt['go_down'], '</a>
233
				', $context['page_index'], '
234
			</div>
235
		</div>';
236
237
	// Mobile action - moderation buttons (top)
238
	if (!empty($context['normal_buttons']))
239
		echo '
240
		<div class="mobile_buttons floatright">
241
			<a class="button mobile_act">', $txt['mobile_action'], '</a>
242
			', !empty($context['mod_buttons']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
243
		</div>';
244
245
	// Show the topic information - icon, subject, etc.
246
	echo '
247
		<div id="forumposts">
248
			<form action="', $scripturl, '?action=quickmod2;topic=', $context['current_topic'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" onsubmit="return oQuickModify.bInEditMode ? oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\') : false">';
249
250
	$context['ignoredMsgs'] = array();
251
	$context['removableMessageIDs'] = array();
252
253
	// Get all the messages...
254
	while ($message = $context['get_message']())
255
		template_single_post($message);
256
257
	echo '
258
			</form>
259
		</div><!-- #forumposts -->';
260
261
	// Mobile action - moderation buttons (bottom)
262
	if (!empty($context['normal_buttons']))
263
		echo '
264
		<div class="mobile_buttons floatright">
265
			<a class="button mobile_act">', $txt['mobile_action'], '</a>
266
			', !empty($context['mod_buttons']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
267
		</div>';
268
269
	// Show the page index... "Pages: [1]".
270
	echo '
271
		<div class="pagesection">
272
			', template_button_strip($context['normal_buttons'], 'right'), '
0 ignored issues
show
Are you sure the usage of template_button_strip($c...mal_buttons'], 'right') is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
273
			', $context['menu_separator'], '
274
			<div class="pagelinks floatleft">
275
				<a href="#main_content_section" class="button" id="bot">', $txt['go_up'], '</a>
276
				', $context['page_index'], '
277
			</div>
278
		</div>';
279
280
	// Show the lower breadcrumbs.
281
	theme_linktree();
282
283
	// Moderation buttons
284
	echo '
285
		<div id="moderationbuttons">
286
			', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip')), '
0 ignored issues
show
Are you sure the usage of template_button_strip($c...erationbuttons_strip')) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
287
		</div>';
288
289
	// Show the jumpto box, or actually...let Javascript do it.
290
	echo '
291
		<div id="display_jump_to"></div>';
292
293
	// Show quickreply
294
	if ($context['can_reply'])
295
		template_quickreply();
296
297
	// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
298
	echo '
299
		<div id="mobile_action" class="popup_container">
300
			<div class="popup_window description">
301
				<div class="popup_heading">
302
					', $txt['mobile_action'], '
303
					<a href="javascript:void(0);" class="main_icons hide_popup"></a>
304
				</div>
305
				', template_button_strip($context['normal_buttons']), '
0 ignored issues
show
Are you sure the usage of template_button_strip($context['normal_buttons']) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
306
			</div>
307
		</div>';
308
309
	// Show the moderation button & pop (if there is anything to show)
310
	if (!empty($context['mod_buttons']))
311
		echo '
312
		<div id="mobile_moderation" class="popup_container">
313
			<div class="popup_window description">
314
				<div class="popup_heading">
315
					', $txt['mobile_moderation'], '
316
					<a href="javascript:void(0);" class="main_icons hide_popup"></a>
317
				</div>
318
				<div id="moderationbuttons_mobile">
319
					', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip_mobile')), '
0 ignored issues
show
Are you sure the usage of template_button_strip($c...buttons_strip_mobile')) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
320
				</div>
321
			</div>
322
		</div>';
323
324
	echo '
325
		<script>';
326
327
	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
328
	{
329
		echo '
330
			var oInTopicModeration = new InTopicModeration({
331
				sSelf: \'oInTopicModeration\',
332
				sCheckboxContainerMask: \'in_topic_mod_check_\',
333
				aMessageIds: [\'', implode('\', \'', $context['removableMessageIDs']), '\'],
334
				sSessionId: smf_session_id,
335
				sSessionVar: smf_session_var,
336
				sButtonStrip: \'moderationbuttons\',
337
				sButtonStripDisplay: \'moderationbuttons_strip\',
338
				bUseImageButton: false,
339
				bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
340
				sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
341
				sRemoveButtonImage: \'delete_selected.png\',
342
				sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
343
				bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
344
				sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
345
				sRestoreButtonImage: \'restore_selected.png\',
346
				sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
347
				bCanSplit: ', $context['can_split'] ? 'true' : 'false', ',
348
				sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\',
349
				sSplitButtonImage: \'split_selected.png\',
350
				sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\',
351
				sFormId: \'quickModForm\'
352
			});';
353
354
		// Add it to the mobile button strip as well
355
		echo '
356
			var oInTopicModerationMobile = new InTopicModeration({
357
				sSelf: \'oInTopicModerationMobile\',
358
				sCheckboxContainerMask: \'in_topic_mod_check_\',
359
				aMessageIds: [\'', implode('\', \'', $context['removableMessageIDs']), '\'],
360
				sSessionId: smf_session_id,
361
				sSessionVar: smf_session_var,
362
				sButtonStrip: \'moderationbuttons_mobile\',
363
				sButtonStripDisplay: \'moderationbuttons_strip_mobile\',
364
				bUseImageButton: false,
365
				bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
366
				sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
367
				sRemoveButtonImage: \'delete_selected.png\',
368
				sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
369
				bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
370
				sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
371
				sRestoreButtonImage: \'restore_selected.png\',
372
				sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
373
				bCanSplit: ', $context['can_split'] ? 'true' : 'false', ',
374
				sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\',
375
				sSplitButtonImage: \'split_selected.png\',
376
				sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\',
377
				sFormId: \'quickModForm\'
378
			});';
379
	}
380
381
	echo '
382
			if (\'XMLHttpRequest\' in window)
383
			{
384
				var oQuickModify = new QuickModify({
385
					sScriptUrl: smf_scripturl,
386
					sClassName: \'quick_edit\',
387
					bShowModify: ', $modSettings['show_modify'] ? 'true' : 'false', ',
388
					iTopicId: ', $context['current_topic'], ',
389
					sTemplateBodyEdit: ', JavaScriptEscape('
390
						<div id="quick_edit_body_container">
391
							<div id="error_box" class="error"></div>
392
							<textarea class="editor" name="message" rows="12" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br>
393
							<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
394
							<input type="hidden" name="topic" value="' . $context['current_topic'] . '">
395
							<input type="hidden" name="msg" value="%msg_id%">
396
							<div class="righttext quickModifyMargin">
397
								<input type="submit" name="post" value="' . $txt['save'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifySave(\'' . $context['session_id'] . '\', \'' . $context['session_var'] . '\');" accesskey="s" class="button">' . ($context['show_spellchecking'] ? ' <input type="button" value="' . $txt['spell_check'] . '" tabindex="' . $context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button">' : '') . ' <input type="submit" name="cancel" value="' . $txt['modify_cancel'] . '" tabindex="' . $context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button">
398
							</div>
399
						</div>'), ',
400
					sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '">'), ',
401
					sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
402
					sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
403
					sTemplateTopSubject: ', JavaScriptEscape('%subject%'), ',
404
					sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="quickModifyMargin">'), ',
405
					sTemplateReasonNormal: ', JavaScriptEscape('%modify_text'), ',
406
					sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply']) ? ',
407
					sFormRemoveAccessKeys: \'postmodify\'' : '', '
408
				});
409
410
				aJumpTo[aJumpTo.length] = new JumpTo({
411
					sContainerId: "display_jump_to",
412
					sJumpToTemplate: "<label class=\"smalltext jump_to\" for=\"%select_id%\">', $context['jump_to']['label'], '<" + "/label> %dropdown_list%",
413
					iCurBoardId: ', $context['current_board'], ',
414
					iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
415
					sCurBoardName: "', $context['jump_to']['board_name'], '",
416
					sBoardChildLevelIndicator: "==",
417
					sBoardPrefix: "=> ",
418
					sCatSeparator: "-----------------------------",
419
					sCatPrefix: "",
420
					sGoButtonLabel: "', $txt['go'], '"
421
				});
422
423
				aIconLists[aIconLists.length] = new IconList({
424
					sBackReference: "aIconLists[" + aIconLists.length + "]",
425
					sIconIdPrefix: "msg_icon_",
426
					sScriptUrl: smf_scripturl,
427
					bShowModify: ', !empty($modSettings['show_modify']) ? 'true' : 'false', ',
428
					iBoardId: ', $context['current_board'], ',
429
					iTopicId: ', $context['current_topic'], ',
430
					sSessionId: smf_session_id,
431
					sSessionVar: smf_session_var,
432
					sLabelIconList: "', $txt['message_icon'], '",
433
					sBoxBackground: "transparent",
434
					sBoxBackgroundHover: "#ffffff",
435
					iBoxBorderWidthHover: 1,
436
					sBoxBorderColorHover: "#adadad" ,
437
					sContainerBackground: "#ffffff",
438
					sContainerBorder: "1px solid #adadad",
439
					sItemBorder: "1px solid #ffffff",
440
					sItemBorderHover: "1px dotted gray",
441
					sItemBackground: "transparent",
442
					sItemBackgroundHover: "#e0e0f0"
443
				});
444
			}';
445
446
	if (!empty($context['ignoredMsgs']))
447
		echo '
448
			ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');';
449
450
	echo '
451
		</script>';
452
}
453
454
/**
455
 * Template for displaying a single post.
456
 *
457
 * @param array $message An array of information about the message to display. Should have 'id' and 'member'. Can also have 'first_new', 'is_ignored' and 'css_class'.
458
 */
459
function template_single_post($message)
460
{
461
	global $context, $settings, $options, $txt, $scripturl, $modSettings;
462
463
	$ignoring = false;
464
465
	if ($message['can_remove'])
466
		$context['removableMessageIDs'][] = $message['id'];
467
468
	// Are we ignoring this message?
469
	if (!empty($message['is_ignored']))
470
	{
471
		$ignoring = true;
472
		$context['ignoredMsgs'][] = $message['id'];
473
	}
474
475
	// Show the message anchor and a "new" anchor if this message is new.
476
	echo '
477
				<div class="', $message['css_class'], '">
478
					', $message['id'] != $context['first_message'] ? '
479
					<a id="msg' . $message['id'] . '"></a>' . ($message['first_new'] ? '<a id="new"></a>' : '') : '', '
480
					<div class="post_wrapper">';
481
482
	// Show information about the poster of this message.
483
	echo '
484
						<div class="poster">';
485
486
	// Are there any custom fields above the member name?
487
	if (!empty($message['custom_fields']['above_member']))
488
	{
489
		echo '
490
							<div class="custom_fields_above_member">
491
								<ul class="nolist">';
492
493
		foreach ($message['custom_fields']['above_member'] as $custom)
494
			echo '
495
									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
496
497
		echo '
498
								</ul>
499
							</div>';
500
	}
501
502
	echo '
503
							<h4>';
504
505
	// Show online and offline buttons?
506
	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
507
		echo '
508
								', $context['can_send_pm'] ? '<a href="' . $message['member']['online']['href'] . '" title="' . $message['member']['online']['label'] . '">' : '', '<span class="' . ($message['member']['online']['is_online'] == 1 ? 'on' : 'off') . '" title="' . $message['member']['online']['text'] . '"></span>', $context['can_send_pm'] ? '</a>' : '';
509
510
	// Custom fields BEFORE the username?
511
	if (!empty($message['custom_fields']['before_member']))
512
		foreach ($message['custom_fields']['before_member'] as $custom)
513
			echo '
514
								<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
515
516
	// Show a link to the member's profile.
517
	echo '
518
								', $message['member']['link'];
519
520
	// Custom fields AFTER the username?
521
	if (!empty($message['custom_fields']['after_member']))
522
		foreach ($message['custom_fields']['after_member'] as $custom)
523
			echo '
524
								<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
525
526
	// Begin display of user info
527
	echo '
528
							</h4>
529
							<ul class="user_info">';
530
531
	// Show the user's avatar.
532
	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
533
		echo '
534
								<li class="avatar">
535
									<a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a>
536
								</li>';
537
538
	// Are there any custom fields below the avatar?
539
	if (!empty($message['custom_fields']['below_avatar']))
540
		foreach ($message['custom_fields']['below_avatar'] as $custom)
541
			echo '
542
								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
543
544
	// Show the post group icons, but not for guests.
545
	if (!$message['member']['is_guest'])
546
		echo '
547
								<li class="icons">', $message['member']['group_icons'], '</li>';
548
549
	// Show the member's primary group (like 'Administrator') if they have one.
550
	if (!empty($message['member']['group']))
551
		echo '
552
								<li class="membergroup">', $message['member']['group'], '</li>';
553
554
	// Show the member's custom title, if they have one.
555
	if (!empty($message['member']['title']))
556
		echo '
557
								<li class="title">', $message['member']['title'], '</li>';
558
559
	// Don't show these things for guests.
560
	if (!$message['member']['is_guest'])
561
	{
562
		// 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.
563
		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group']))
564
			echo '
565
								<li class="postgroup">', $message['member']['post_group'], '</li>';
566
567
		// Show how many posts they have made.
568
		if (!isset($context['disabled_fields']['posts']))
569
			echo '
570
								<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
571
572
		// Show their personal text?
573
		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb']))
574
			echo '
575
								<li class="blurb">', $message['member']['blurb'], '</li>';
576
577
		// Any custom fields to show as icons?
578
		if (!empty($message['custom_fields']['icons']))
579
		{
580
			echo '
581
								<li class="im_icons">
582
									<ol>';
583
584
			foreach ($message['custom_fields']['icons'] as $custom)
585
				echo '
586
										<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
587
588
			echo '
589
									</ol>
590
								</li>';
591
		}
592
593
		// Show the website and email address buttons.
594
		if ($message['member']['show_profile_buttons'])
595
		{
596
			echo '
597
								<li class="profile">
598
									<ol class="profile_icons">';
599
600
			// Don't show an icon if they haven't specified a website.
601
			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website']))
602
				echo '
603
										<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" rel="noopener">', ($settings['use_image_buttons'] ? '<span class="main_icons www centericon" title="' . $message['member']['website']['title'] . '"></span>' : $txt['www']), '</a></li>';
604
605
			// Since we know this person isn't a guest, you *can* message them.
606
			if ($context['can_send_pm'])
607
				echo '
608
										<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="main_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>';
609
610
			// Show the email if necessary
611
			if (!empty($message['member']['email']) && $message['member']['show_email'])
612
				echo '
613
										<li class="email"><a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="main_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a></li>';
614
615
			echo '
616
									</ol>
617
								</li><!-- .profile -->';
618
		}
619
620
		// Any custom fields for standard placement?
621
		if (!empty($message['custom_fields']['standard']))
622
			foreach ($message['custom_fields']['standard'] as $custom)
623
				echo '
624
								<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
625
	}
626
	// Otherwise, show the guest's email.
627
	elseif (!empty($message['member']['email']) && $message['member']['show_email'])
628
		echo '
629
								<li class="email">
630
									<a href="mailto:' . $message['member']['email'] . '" rel="nofollow">', ($settings['use_image_buttons'] ? '<span class="main_icons mail centericon" title="' . $txt['email'] . '"></span>' : $txt['email']), '</a>
631
								</li>';
632
633
	// Show the IP to this user for this post - because you can moderate?
634
	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
635
		echo '
636
								<li class="poster_ip">
637
									<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>
638
								</li>';
639
640
	// Or, should we show it because this is you?
641
	elseif ($message['can_see_ip'])
642
		echo '
643
								<li class="poster_ip">
644
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a>
645
								</li>';
646
647
	// Okay, are you at least logged in? Then we can show something about why IPs are logged...
648
	elseif (!$context['user']['is_guest'])
649
		echo '
650
								<li class="poster_ip">
651
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a>
652
								</li>';
653
654
	// Otherwise, you see NOTHING!
655
	else
656
		echo '
657
								<li class="poster_ip">', $txt['logged'], '</li>';
658
659
	// Are we showing the warning status?
660
	// Don't show these things for guests.
661
	if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
662
		echo '
663
								<li class="warning">
664
									', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<span class="main_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>
665
								</li>';
666
667
	// Are there any custom fields to show at the bottom of the poster info?
668
	if (!empty($message['custom_fields']['bottom_poster']))
669
		foreach ($message['custom_fields']['bottom_poster'] as $custom)
670
			echo '
671
								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
672
673
	// Poster info ends.
674
	echo '
675
							</ul>
676
						</div><!-- .poster -->
677
						<div class="postarea">
678
							<div class="keyinfo">';
679
680
	// Some people don't want subject... The div is still required or quick edit breaks.
681
	echo '
682
								<div id="subject_', $message['id'], '" class="subject_title', (empty($modSettings['subject_toggle']) ? ' subject_hidden' : ''), '">
683
									', $message['link'], '
684
								</div>';
685
686
	echo '
687
								<h5>
688
									<span class="messageicon" ', ($message['icon_url'] === $settings['images_url'] . '/post/xx.png' && !$message['can_modify']) ? ' style="position: absolute; z-index: -1;"' : '', '>
689
										<img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', '>
690
									</span>
691
									<a href="', $message['href'], '" rel="nofollow" title="', !empty($message['counter']) ? sprintf($txt['reply_number'], $message['counter'], ' - ') : '', $message['subject'], '" class="smalltext">', $message['time'], '</a>
692
									<span class="page_number floatright">
693
										', !empty($message['counter']) ? ' #' . $message['counter'] : '', ' ', '
694
									</span>';
695
696
	// Show "<< Last Edit: Time by Person >>" if this post was edited. But we need the div even if it wasn't modified!
697
	// Because we insert into it through AJAX and we don't want to stop themers moving it around if they so wish so they can put it where they want it.
698
	echo '
699
									<span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '', '" id="modified_', $message['id'], '">';
700
701
	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
702
		echo
703
										$message['modified']['last_edit_text'];
704
705
	echo '
706
									</span>
707
								</h5>
708
								<div id="msg_', $message['id'], '_quick_mod"', $ignoring ? ' style="display:none;"' : '', '></div>
709
							</div><!-- .keyinfo -->';
710
711
	// Ignoring this user? Hide the post.
712
	if ($ignoring)
713
		echo '
714
							<div id="msg_', $message['id'], '_ignored_prompt">
715
								', $txt['ignoring_user'], '
716
								<a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
717
							</div>';
718
719
	// Show the post itself, finally!
720
	echo '
721
							<div class="post">';
722
723
	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
724
		echo '
725
								<div class="noticebox">
726
									', $txt['post_awaiting_approval'], '
727
								</div>';
728
	echo '
729
								<div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>
730
									', $message['body'], '
731
								</div>
732
							</div><!-- .post -->';
733
734
	// Assuming there are attachments...
735
	if (!empty($message['attachment']))
736
	{
737
		$last_approved_state = 1;
738
		$attachments_per_line = 5;
739
		$i = 0;
740
		// Don't output the div unless we actually have something to show...
741
		$div_output = false;
742
743
		foreach ($message['attachment'] as $attachment)
744
		{
745
			// Do we want this attachment to not be showed here?
746
			if (!empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']]))
747
				continue;
748
			elseif (!$div_output)
749
			{
750
				$div_output = true;
751
752
				echo '
753
							<div id="msg_', $message['id'], '_footer" class="attachments"', $ignoring ? ' style="display:none;"' : '', '>';
754
			}
755
756
			// Show a special box for unapproved attachments...
757
			if ($attachment['is_approved'] != $last_approved_state)
758
			{
759
				$last_approved_state = 0;
760
				echo '
761
								<fieldset>
762
									<legend>
763
										', $txt['attach_awaiting_approve'];
764
765
				if ($context['can_approve'])
766
					echo '
767
										&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
768
769
				echo '
770
									</legend>';
771
			}
772
773
			echo '
774
									<div class="attached">';
775
776
			if ($attachment['is_image'])
777
			{
778
				echo '
779
										<div class="attachments_top">';
780
781
				if ($attachment['thumbnail']['has_thumb'])
782
					echo '
783
											<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" class="atc_img"></a>';
784
				else
785
					echo '
786
											<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" class="atc_img">';
787
788
				echo '
789
										</div><!-- .attachments_top -->';
790
			}
791
792
			echo '
793
										<div class="attachments_bot">
794
											<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.png" class="centericon" alt="*">&nbsp;' . $attachment['name'] . '</a> ';
795
796
			if (!$attachment['is_approved'] && $context['can_approve'])
797
				echo '
798
											[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
799
			echo '
800
											<br>', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br>' . sprintf($txt['attach_viewed'], $attachment['downloads']) : '<br>' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '
801
										</div><!-- .attachments_bot -->';
802
803
			echo '
804
									</div><!-- .attached -->';
805
806
			// Next attachment line ?
807
			if (++$i % $attachments_per_line === 0)
808
				echo '
809
									<br>';
810
		}
811
812
		// If we had unapproved attachments clean up.
813
		if ($last_approved_state == 0)
814
			echo '
815
								</fieldset>';
816
817
		// Only do this if we output a div above - otherwise it'll break things
818
		if ($div_output)
819
			echo '
820
							</div><!-- #msg_[id]_footer -->';
821
	}
822
823
	echo '
824
							<div class="under_message">';
825
826
	// What about likes?
827
	if (!empty($modSettings['enable_likes']))
828
	{
829
		echo '
830
								<ul class="floatleft">';
831
832
		if (!empty($message['likes']['can_like']))
833
		{
834
			echo '
835
									<li class="smflikebutton" id="msg_', $message['id'], '_likes"', $ignoring ? ' style="display:none;"' : '', '>
836
										<a href="', $scripturl, '?action=likes;ltype=msg;sa=like;like=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="msg_like"><span class="main_icons ', $message['likes']['you'] ? 'unlike' : 'like', '"></span> ', $message['likes']['you'] ? $txt['unlike'] : $txt['like'], '</a>
837
									</li>';
838
		}
839
840
		if (!empty($message['likes']['count']))
841
		{
842
			$context['some_likes'] = true;
843
			$count = $message['likes']['count'];
844
			$base = 'likes_';
845
846
			if ($message['likes']['you'])
847
			{
848
				$base = 'you_' . $base;
849
				$count--;
850
			}
851
852
			$base .= (isset($txt[$base . $count])) ? $count : 'n';
853
854
			echo '
855
									<li class="like_count smalltext">
856
										', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '
857
									</li>';
858
		}
859
860
		echo '
861
								</ul>';
862
	}
863
864
	// Show the quickbuttons, for various operations on posts.
865
	template_quickbuttons($message['quickbuttons'], 'post');
866
867
	echo '
868
							</div><!-- .under_message -->
869
						</div><!-- .postarea -->
870
						<div class="moderatorbar">';
871
872
	// Are there any custom profile fields for above the signature?
873
	if (!empty($message['custom_fields']['above_signature']))
874
	{
875
		echo '
876
							<div class="custom_fields_above_signature">
877
								<ul class="nolist">';
878
879
		foreach ($message['custom_fields']['above_signature'] as $custom)
880
			echo '
881
									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
882
883
		echo '
884
								</ul>
885
							</div>';
886
	}
887
888
	// Show the member's signature?
889
	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
890
		echo '
891
							<div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>
892
								', $message['member']['signature'], '
893
							</div>';
894
895
	// Are there any custom profile fields for below the signature?
896
	if (!empty($message['custom_fields']['below_signature']))
897
	{
898
		echo '
899
							<div class="custom_fields_below_signature">
900
								<ul class="nolist">';
901
902
		foreach ($message['custom_fields']['below_signature'] as $custom)
903
			echo '
904
									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
905
906
		echo '
907
								</ul>
908
							</div>';
909
	}
910
911
	echo '
912
						</div><!-- .moderatorbar -->
913
					</div><!-- .post_wrapper -->
914
				</div><!-- $message[css_class] -->
915
				<hr class="post_separator">';
916
}
917
918
/**
919
 * The template for displaying the quick reply box.
920
 */
921
function template_quickreply()
922
{
923
	global $context, $modSettings, $scripturl, $options, $txt;
924
925
	echo '
926
		<a id="quickreply_anchor"></a>
927
		<div class="tborder" id="quickreply">
928
			<div class="cat_bar">
929
				<h3 class="catbg">
930
					', $txt['quick_reply'], '
931
				</h3>
932
			</div>
933
			<div id="quickreply_options">
934
				<div class="roundframe">';
935
936
	// Is the topic locked?
937
	if ($context['is_locked'])
938
		echo '
939
					<p class="alert smalltext">', $txt['quick_reply_warning'], '</p>';
940
941
	// Show a warning if the topic is old
942
	if (!empty($context['oldTopicError']))
943
		echo '
944
					<p class="alert smalltext">', sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']), '</p>';
945
946
	// Does the post need approval?
947
	if (!$context['can_reply_approved'])
948
		echo '
949
					<p><em>', $txt['wait_for_approval'], '</em></p>';
950
951
	echo '
952
					<form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);">
953
						<input type="hidden" name="topic" value="', $context['current_topic'], '">
954
						<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '">
955
						<input type="hidden" name="icon" value="xx">
956
						<input type="hidden" name="from_qr" value="1">
957
						<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '">
958
						<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '">
959
						<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '">
960
						<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">
961
						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
962
						<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">';
963
964
	// Guests just need more.
965
	if ($context['user']['is_guest'])
966
		echo '
967
						<dl id="post_header">
968
							<dt>
969
								', $txt['name'], ':
970
							</dt>
971
							<dd>
972
								<input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '">
973
							</dd>
974
							<dt>
975
								', $txt['email'], ':
976
							</dt>
977
							<dd>
978
								<input type="email" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" required>
979
							</dd>
980
						</dl>';
981
982
	echo '
983
						', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
0 ignored issues
show
Are you sure the usage of template_control_richedi...age', 'bbcBox_message') is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
'smileyBox_message' of type string is incompatible with the type boolean|null expected by parameter $smileyContainer of template_control_richedit(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

983
						', template_control_richedit($context['post_box_name'], /** @scrutinizer ignore-type */ 'smileyBox_message', 'bbcBox_message'), '
Loading history...
'bbcBox_message' of type string is incompatible with the type boolean|null expected by parameter $bbcContainer of template_control_richedit(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

983
						', template_control_richedit($context['post_box_name'], 'smileyBox_message', /** @scrutinizer ignore-type */ 'bbcBox_message'), '
Loading history...
984
						<script>
985
							function insertQuoteFast(messageid)
986
							{
987
								var e = document.getElementById("', $context['post_box_name'], '");
988
								sceditor.instance(e).insertQuoteFast(messageid);
989
990
								return false;
991
							}
992
						</script>';
993
994
	// Is visual verification enabled?
995
	if ($context['require_verification'])
996
		echo '
997
						<div class="post_verification">
998
							<strong>', $txt['verification'], ':</strong>
999
							', template_control_verification($context['visual_verification_id'], 'all'), '
1000
						</div>';
1001
1002
	// Finally, the submit buttons.
1003
	echo '
1004
						<span id="post_confirm_buttons">
1005
							', template_control_richedit_buttons($context['post_box_name']), '
0 ignored issues
show
Are you sure the usage of template_control_richedi...ntext['post_box_name']) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
1006
						</span>';
1007
	echo '
1008
					</form>
1009
				</div><!-- .roundframe -->
1010
			</div><!-- #quickreply_options -->
1011
		</div><!-- #quickreply -->
1012
		<br class="clear">';
1013
1014
	// Draft autosave available and the user has it enabled?
1015
	if (!empty($context['drafts_autosave']))
1016
		echo '
1017
		<script>
1018
			var oDraftAutoSave = new smf_DraftAutoSave({
1019
				sSelf: \'oDraftAutoSave\',
1020
				sLastNote: \'draft_lastautosave\',
1021
				sLastID: \'id_draft\',', !empty($context['post_box_name']) ? '
1022
				sSceditorID: \'' . $context['post_box_name'] . '\',' : '', '
1023
				sType: \'', 'quick', '\',
1024
				iBoard: ', (empty($context['current_board']) ? 0 : $context['current_board']), ',
1025
				iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
1026
			});
1027
		</script>';
1028
1029
	if ($context['show_spellchecking'])
1030
		echo '
1031
		<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow">
1032
			<input type="hidden" name="spellstring" value="">
1033
		</form>';
1034
1035
	echo '
1036
		<script>
1037
			var oQuickReply = new QuickReply({
1038
				bDefaultCollapsed: false,
1039
				iTopicId: ', $context['current_topic'], ',
1040
				iStart: ', $context['start'], ',
1041
				sScriptUrl: smf_scripturl,
1042
				sImagesUrl: smf_images_url,
1043
				sContainerId: "quickreply_options",
1044
				sImageId: "quickReplyExpand",
1045
				sClassCollapsed: "toggle_up",
1046
				sClassExpanded: "toggle_down",
1047
				sJumpAnchor: "quickreply_anchor",
1048
				bIsFull: true
1049
			});
1050
			var oEditorID = "', $context['post_box_name'], '";
1051
			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
1052
			var oJumpAnchor = "quickreply_anchor";
1053
		</script>';
1054
}
1055
1056
?>