Issues (1014)

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 2022 Simple Machines and individual contributors
8
 * @license https://www.simplemachines.org/about/smf/license.php BSD
9
 *
10
 * @version 2.1.2
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
		', $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
236
	// Mobile action - moderation buttons (top)
237
	if (!empty($context['normal_buttons']))
238
		echo '
239
		<div class="mobile_buttons floatright">
240
			<a class="button mobile_act">', $txt['mobile_action'], '</a>
241
			', !empty($context['mod_buttons']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
242
		</div>';
243
244
	echo '
245
		</div>';
246
247
	// Show the topic information - icon, subject, etc.
248
	echo '
249
		<div id="forumposts">
250
			<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">';
251
252
	$context['ignoredMsgs'] = array();
253
	$context['removableMessageIDs'] = array();
254
255
	// Get all the messages...
256
	while ($message = $context['get_message']())
257
		template_single_post($message);
258
259
	echo '
260
			</form>
261
		</div><!-- #forumposts -->';
262
263
	// Show the page index... "Pages: [1]".
264
	echo '
265
		<div class="pagesection">
266
			', 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...
267
			', $context['menu_separator'], '
268
			<div class="pagelinks floatleft">
269
				<a href="#main_content_section" class="button" id="bot">', $txt['go_up'], '</a>
270
				', $context['page_index'], '
271
			</div>';
272
273
	// Mobile action - moderation buttons (bottom)
274
	if (!empty($context['normal_buttons']))
275
		echo '
276
		<div class="mobile_buttons floatright">
277
			<a class="button mobile_act">', $txt['mobile_action'], '</a>
278
			', !empty($context['mod_buttons']) ? '<a class="button mobile_mod">' . $txt['mobile_moderation'] . '</a>' : '', '
279
		</div>';
280
281
	echo '
282
		</div>';
283
284
	// Show the lower breadcrumbs.
285
	theme_linktree();
286
287
	// Moderation buttons
288
	echo '
289
		<div id="moderationbuttons">
290
			', 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...
291
		</div>';
292
293
	// Show the jumpto box, or actually...let Javascript do it.
294
	echo '
295
		<div id="display_jump_to"></div>';
296
297
	// Show quickreply
298
	if ($context['can_reply'])
299
		template_quickreply();
300
301
	// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
302
	echo '
303
		<div id="mobile_action" class="popup_container">
304
			<div class="popup_window description">
305
				<div class="popup_heading">
306
					', $txt['mobile_action'], '
307
					<a href="javascript:void(0);" class="main_icons hide_popup"></a>
308
				</div>
309
				', 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...
310
			</div>
311
		</div>';
312
313
	// Show the moderation button & pop (if there is anything to show)
314
	if (!empty($context['mod_buttons']))
315
		echo '
316
		<div id="mobile_moderation" class="popup_container">
317
			<div class="popup_window description">
318
				<div class="popup_heading">
319
					', $txt['mobile_moderation'], '
320
					<a href="javascript:void(0);" class="main_icons hide_popup"></a>
321
				</div>
322
				<div id="moderationbuttons_mobile">
323
					', 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...
324
				</div>
325
			</div>
326
		</div>';
327
328
	echo '
329
		<script>';
330
331
	if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $context['can_remove_post'])
332
	{
333
		echo '
334
			var oInTopicModeration = new InTopicModeration({
335
				sSelf: \'oInTopicModeration\',
336
				sCheckboxContainerMask: \'in_topic_mod_check_\',
337
				aMessageIds: [\'', implode('\', \'', $context['removableMessageIDs']), '\'],
338
				sSessionId: smf_session_id,
339
				sSessionVar: smf_session_var,
340
				sButtonStrip: \'moderationbuttons\',
341
				sButtonStripDisplay: \'moderationbuttons_strip\',
342
				bUseImageButton: false,
343
				bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
344
				sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
345
				sRemoveButtonImage: \'delete_selected.png\',
346
				sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
347
				bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
348
				sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
349
				sRestoreButtonImage: \'restore_selected.png\',
350
				sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
351
				bCanSplit: ', $context['can_split'] ? 'true' : 'false', ',
352
				sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\',
353
				sSplitButtonImage: \'split_selected.png\',
354
				sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\',
355
				sFormId: \'quickModForm\'
356
			});';
357
358
		// Add it to the mobile button strip as well
359
		echo '
360
			var oInTopicModerationMobile = new InTopicModeration({
361
				sSelf: \'oInTopicModerationMobile\',
362
				sCheckboxContainerMask: \'in_topic_mod_check_\',
363
				aMessageIds: [\'', implode('\', \'', $context['removableMessageIDs']), '\'],
364
				sSessionId: smf_session_id,
365
				sSessionVar: smf_session_var,
366
				sButtonStrip: \'moderationbuttons_mobile\',
367
				sButtonStripDisplay: \'moderationbuttons_strip_mobile\',
368
				bUseImageButton: false,
369
				bCanRemove: ', $context['can_remove_post'] ? 'true' : 'false', ',
370
				sRemoveButtonLabel: \'', $txt['quickmod_delete_selected'], '\',
371
				sRemoveButtonImage: \'delete_selected.png\',
372
				sRemoveButtonConfirm: \'', $txt['quickmod_confirm'], '\',
373
				bCanRestore: ', $context['can_restore_msg'] ? 'true' : 'false', ',
374
				sRestoreButtonLabel: \'', $txt['quick_mod_restore'], '\',
375
				sRestoreButtonImage: \'restore_selected.png\',
376
				sRestoreButtonConfirm: \'', $txt['quickmod_confirm'], '\',
377
				bCanSplit: ', $context['can_split'] ? 'true' : 'false', ',
378
				sSplitButtonLabel: \'', $txt['quickmod_split_selected'], '\',
379
				sSplitButtonImage: \'split_selected.png\',
380
				sSplitButtonConfirm: \'', $txt['quickmod_confirm'], '\',
381
				sFormId: \'quickModForm\'
382
			});';
383
	}
384
385
	echo '
386
			if (\'XMLHttpRequest\' in window)
387
			{
388
				var oQuickModify = new QuickModify({
389
					sScriptUrl: smf_scripturl,
390
					sClassName: \'quick_edit\',
391
					bShowModify: ', $modSettings['show_modify'] ? 'true' : 'false', ',
392
					iTopicId: ', $context['current_topic'], ',
393
					sTemplateBodyEdit: ', JavaScriptEscape('
394
						<div id="quick_edit_body_container">
395
							<div id="error_box" class="error"></div>
396
							<textarea class="editor" name="message" rows="12" tabindex="' . $context['tabindex']++ . '">%body%</textarea><br>
397
							<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '">
398
							<input type="hidden" name="topic" value="' . $context['current_topic'] . '">
399
							<input type="hidden" name="msg" value="%msg_id%">
400
							<div class="righttext quickModifyMargin">
401
								<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">
402
							</div>
403
						</div>'), ',
404
					sTemplateSubjectEdit: ', JavaScriptEscape('<input type="text" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '">'), ',
405
					sTemplateBodyNormal: ', JavaScriptEscape('%body%'), ',
406
					sTemplateSubjectNormal: ', JavaScriptEscape('<a href="' . $scripturl . '?topic=' . $context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
407
					sTemplateTopSubject: ', JavaScriptEscape('%subject%'), ',
408
					sTemplateReasonEdit: ', JavaScriptEscape($txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . $context['tabindex']++ . '" class="quickModifyMargin">'), ',
409
					sTemplateReasonNormal: ', JavaScriptEscape('%modify_text'), ',
410
					sErrorBorderStyle: ', JavaScriptEscape('1px solid red'), ($context['can_reply']) ? ',
411
					sFormRemoveAccessKeys: \'postmodify\'' : '', '
412
				});
413
414
				aJumpTo[aJumpTo.length] = new JumpTo({
415
					sContainerId: "display_jump_to",
416
					sJumpToTemplate: "<label class=\"smalltext jump_to\" for=\"%select_id%\">', $context['jump_to']['label'], '<" + "/label> %dropdown_list%",
417
					iCurBoardId: ', $context['current_board'], ',
418
					iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
419
					sCurBoardName: "', $context['jump_to']['board_name'], '",
420
					sBoardChildLevelIndicator: "==",
421
					sBoardPrefix: "=> ",
422
					sCatSeparator: "-----------------------------",
423
					sCatPrefix: "",
424
					sGoButtonLabel: "', $txt['go'], '"
425
				});
426
427
				aIconLists[aIconLists.length] = new IconList({
428
					sBackReference: "aIconLists[" + aIconLists.length + "]",
429
					sIconIdPrefix: "msg_icon_",
430
					sScriptUrl: smf_scripturl,
431
					bShowModify: ', !empty($modSettings['show_modify']) ? 'true' : 'false', ',
432
					iBoardId: ', $context['current_board'], ',
433
					iTopicId: ', $context['current_topic'], ',
434
					sSessionId: smf_session_id,
435
					sSessionVar: smf_session_var,
436
					sLabelIconList: "', $txt['message_icon'], '",
437
					sBoxBackground: "transparent",
438
					sBoxBackgroundHover: "#ffffff",
439
					iBoxBorderWidthHover: 1,
440
					sBoxBorderColorHover: "#adadad" ,
441
					sContainerBackground: "#ffffff",
442
					sContainerBorder: "1px solid #adadad",
443
					sItemBorder: "1px solid #ffffff",
444
					sItemBorderHover: "1px dotted gray",
445
					sItemBackground: "transparent",
446
					sItemBackgroundHover: "#e0e0f0"
447
				});
448
			}';
449
450
	if (!empty($context['ignoredMsgs']))
451
		echo '
452
			ignore_toggles([', implode(', ', $context['ignoredMsgs']), '], ', JavaScriptEscape($txt['show_ignore_user_post']), ');';
453
454
	echo '
455
		</script>';
456
}
457
458
/**
459
 * Template for displaying a single post.
460
 *
461
 * @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'.
462
 */
463
function template_single_post($message)
464
{
465
	global $context, $settings, $options, $txt, $scripturl, $modSettings;
466
467
	$ignoring = false;
468
469
	if ($message['can_remove'])
470
		$context['removableMessageIDs'][] = $message['id'];
471
472
	// Are we ignoring this message?
473
	if (!empty($message['is_ignored']))
474
	{
475
		$ignoring = true;
476
		$context['ignoredMsgs'][] = $message['id'];
477
	}
478
479
	// Show the message anchor and a "new" anchor if this message is new.
480
	echo '
481
				<div class="', $message['css_class'], '" id="msg' . $message['id'] . '">
482
					', $message['id'] != $context['first_message'] ? '
483
					' . ($message['first_new'] ? '<a id="new"></a>' : '') : '', '
484
					<div class="post_wrapper">';
485
486
	// Show information about the poster of this message.
487
	echo '
488
						<div class="poster">';
489
490
	// Are there any custom fields above the member name?
491
	if (!empty($message['custom_fields']['above_member']))
492
	{
493
		echo '
494
							<div class="custom_fields_above_member">
495
								<ul class="nolist">';
496
497
		foreach ($message['custom_fields']['above_member'] as $custom)
498
			echo '
499
									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
500
501
		echo '
502
								</ul>
503
							</div>';
504
	}
505
506
	echo '
507
							<h4>';
508
509
	// Show online and offline buttons?
510
	if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
511
		echo '
512
								', $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>' : '';
513
514
	// Custom fields BEFORE the username?
515
	if (!empty($message['custom_fields']['before_member']))
516
		foreach ($message['custom_fields']['before_member'] as $custom)
517
			echo '
518
								<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
519
520
	// Show a link to the member's profile.
521
	echo '
522
								', $message['member']['link'];
523
524
	// Custom fields AFTER the username?
525
	if (!empty($message['custom_fields']['after_member']))
526
		foreach ($message['custom_fields']['after_member'] as $custom)
527
			echo '
528
								<span class="custom ', $custom['col_name'], '">', $custom['value'], '</span>';
529
530
	// Begin display of user info
531
	echo '
532
							</h4>
533
							<ul class="user_info">';
534
535
	// Show the member's custom title, if they have one.
536
	if (!empty($message['member']['title']))
537
		echo '
538
								<li class="title">', $message['member']['title'], '</li>';
539
540
	// Show the member's primary group (like 'Administrator') if they have one.
541
	if (!empty($message['member']['group']))
542
		echo '
543
								<li class="membergroup">', $message['member']['group'], '</li>';
544
545
	// Show the user's avatar.
546
	if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
547
		echo '
548
								<li class="avatar">
549
									<a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a>
550
								</li>';
551
552
	// Are there any custom fields below the avatar?
553
	if (!empty($message['custom_fields']['below_avatar']))
554
		foreach ($message['custom_fields']['below_avatar'] as $custom)
555
			echo '
556
								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
557
558
	// Don't show these things for guests.
559
	if (!$message['member']['is_guest'])
560
	{
561
		// Show the post group icons
562
		echo '
563
								<li class="icons">', $message['member']['group_icons'], '</li>';
564
565
		// 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.
566
		if ((empty($modSettings['hide_post_group']) || empty($message['member']['group'])) && !empty($message['member']['post_group']))
567
			echo '
568
								<li class="postgroup">', $message['member']['post_group'], '</li>';
569
570
		// Show how many posts they have made.
571
		if (!isset($context['disabled_fields']['posts']))
572
			echo '
573
								<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
574
575
		// Show their personal text?
576
		if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb']))
577
			echo '
578
								<li class="blurb">', $message['member']['blurb'], '</li>';
579
580
		// Any custom fields to show as icons?
581
		if (!empty($message['custom_fields']['icons']))
582
		{
583
			echo '
584
								<li class="im_icons">
585
									<ol>';
586
587
			foreach ($message['custom_fields']['icons'] as $custom)
588
				echo '
589
										<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
590
591
			echo '
592
									</ol>
593
								</li>';
594
		}
595
596
		// Show the website and email address buttons.
597
		if ($message['member']['show_profile_buttons'])
598
		{
599
			echo '
600
								<li class="profile">
601
									<ol class="profile_icons">';
602
603
			// Don't show an icon if they haven't specified a website.
604
			if (!empty($message['member']['website']['url']) && !isset($context['disabled_fields']['website']))
605
				echo '
606
										<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>';
607
608
			// Since we know this person isn't a guest, you *can* message them.
609
			if ($context['can_send_pm'])
610
				echo '
611
										<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>';
612
613
			// Show the email if necessary
614
			if (!empty($message['member']['email']) && $message['member']['show_email'])
615
				echo '
616
										<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>';
617
618
			echo '
619
									</ol>
620
								</li><!-- .profile -->';
621
		}
622
623
		// Any custom fields for standard placement?
624
		if (!empty($message['custom_fields']['standard']))
625
			foreach ($message['custom_fields']['standard'] as $custom)
626
				echo '
627
								<li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>';
628
	}
629
	// Otherwise, show the guest's email.
630
	elseif (!empty($message['member']['email']) && $message['member']['show_email'])
631
		echo '
632
								<li class="email">
633
									<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>
634
								</li>';
635
636
	// Show the IP to this user for this post - because you can moderate?
637
	if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
638
		echo '
639
								<li class="poster_ip">
640
									<a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '" data-hover="', $message['member']['ip'], '" class="show_on_hover"><span>', $txt['show_ip'], '</span></a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a>
641
								</li>';
642
643
	// Or, should we show it because this is you?
644
	elseif ($message['can_see_ip'])
645
		echo '
646
								<li class="poster_ip">
647
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help show_on_hover" data-hover="', $message['member']['ip'], '"><span>', $txt['show_ip'], '</span></a>
648
								</li>';
649
650
	// Okay, are you at least logged in? Then we can show something about why IPs are logged...
651
	elseif (!$context['user']['is_guest'])
652
		echo '
653
								<li class="poster_ip">
654
									<a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a>
655
								</li>';
656
657
	// Otherwise, you see NOTHING!
658
	else
659
		echo '
660
								<li class="poster_ip">', $txt['logged'], '</li>';
661
662
	// Are we showing the warning status?
663
	// Don't show these things for guests.
664
	if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
665
		echo '
666
								<li class="warning">
667
									', $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>
668
								</li>';
669
670
	// Are there any custom fields to show at the bottom of the poster info?
671
	if (!empty($message['custom_fields']['bottom_poster']))
672
		foreach ($message['custom_fields']['bottom_poster'] as $custom)
673
			echo '
674
								<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
675
676
	// Poster info ends.
677
	echo '
678
							</ul>
679
						</div><!-- .poster -->
680
						<div class="postarea">
681
							<div class="keyinfo">';
682
683
	// Some people don't want subject... The div is still required or quick edit breaks.
684
	echo '
685
								<div id="subject_', $message['id'], '" class="subject_title', (empty($modSettings['subject_toggle']) ? ' subject_hidden' : ''), '">
686
									', $message['link'], '
687
								</div>';
688
689
	echo '
690
								', !empty($message['counter']) ? '<span class="page_number floatright">#' . $message['counter'] . '</span>' : '', '
691
								<div class="postinfo">
692
									<span class="messageicon" ', ($message['icon_url'] === $settings['images_url'] . '/post/xx.png' && !$message['can_modify']) ? ' style="position: absolute; z-index: -1;"' : '', '>
693
										<img src="', $message['icon_url'] . '" alt=""', $message['can_modify'] ? ' id="msg_icon_' . $message['id'] . '"' : '', '>
694
									</span>
695
									<a href="', $message['href'], '" rel="nofollow" title="', !empty($message['counter']) ? sprintf($txt['reply_number'], $message['counter'], ' - ') : '', $message['subject'], '" class="smalltext">', $message['time'], '</a>
696
									<span class="spacer"></span>';
697
698
	// Show "<< Last Edit: Time by Person >>" if this post was edited. But we need the div even if it wasn't modified!
699
	// 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.
700
	echo '
701
									<span class="smalltext modified floatright', !empty($modSettings['show_modify']) && !empty($message['modified']['name']) ? ' mvisible' : '', '" id="modified_', $message['id'], '">';
702
703
	if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
704
		echo
705
										$message['modified']['last_edit_text'];
706
707
	echo '
708
									</span>
709
								</div>
710
								<div id="msg_', $message['id'], '_quick_mod"', $ignoring ? ' style="display:none;"' : '', '></div>
711
							</div><!-- .keyinfo -->';
712
713
	// Ignoring this user? Hide the post.
714
	if ($ignoring)
715
		echo '
716
							<div id="msg_', $message['id'], '_ignored_prompt" class="noticebox">
717
								', $txt['ignoring_user'], '
718
								<a href="#" id="msg_', $message['id'], '_ignored_link" style="display: none;">', $txt['show_ignore_user_post'], '</a>
719
							</div>';
720
721
	// Show the post itself, finally!
722
	echo '
723
							<div class="post">';
724
725
	if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
726
		echo '
727
								<div class="noticebox">
728
									', $txt['post_awaiting_approval'], '
729
								</div>';
730
	echo '
731
								<div class="inner" data-msgid="', $message['id'], '" id="msg_', $message['id'], '"', $ignoring ? ' style="display:none;"' : '', '>
732
									', $message['body'], '
733
								</div>
734
							</div><!-- .post -->';
735
736
	// Assuming there are attachments...
737
	if (!empty($message['attachment']))
738
	{
739
		$last_approved_state = 1;
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 ($attachment['is_approved'] && !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'] && !empty($modSettings['attachmentShowImages']))
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="" loading="lazy" 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
807
		// If we had unapproved attachments clean up.
808
		if ($last_approved_state == 0)
809
			echo '
810
								</fieldset>';
811
812
		// Only do this if we output a div above - otherwise it'll break things
813
		if ($div_output)
814
			echo '
815
							</div><!-- #msg_[id]_footer -->';
816
	}
817
818
	echo '
819
							<div class="under_message">';
820
821
	// What about likes?
822
	if (!empty($modSettings['enable_likes']))
823
	{
824
		echo '
825
								<ul class="floatleft">';
826
827
		if (!empty($message['likes']['can_like']))
828
		{
829
			echo '
830
									<li class="smflikebutton" id="msg_', $message['id'], '_likes"', $ignoring ? ' style="display:none;"' : '', '>
831
										<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>
832
									</li>';
833
		}
834
835
		if (!empty($message['likes']['count']))
836
		{
837
			$context['some_likes'] = true;
838
			$count = $message['likes']['count'];
839
			$base = 'likes_';
840
841
			if ($message['likes']['you'])
842
			{
843
				$base = 'you_' . $base;
844
				$count--;
845
			}
846
847
			$base .= (isset($txt[$base . $count])) ? $count : 'n';
848
849
			echo '
850
									<li class="like_count smalltext">
851
										', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '
852
									</li>';
853
		}
854
855
		echo '
856
								</ul>';
857
	}
858
859
	// Show the quickbuttons, for various operations on posts.
860
	template_quickbuttons($message['quickbuttons'], 'post');
861
862
	echo '
863
							</div><!-- .under_message -->
864
						</div><!-- .postarea -->
865
						<div class="moderatorbar">';
866
867
	// Are there any custom profile fields for above the signature?
868
	if (!empty($message['custom_fields']['above_signature']))
869
	{
870
		echo '
871
							<div class="custom_fields_above_signature">
872
								<ul class="nolist">';
873
874
		foreach ($message['custom_fields']['above_signature'] as $custom)
875
			echo '
876
									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
877
878
		echo '
879
								</ul>
880
							</div>';
881
	}
882
883
	// Show the member's signature?
884
	if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
885
		echo '
886
							<div class="signature" id="msg_', $message['id'], '_signature"', $ignoring ? ' style="display:none;"' : '', '>
887
								', $message['member']['signature'], '
888
							</div>';
889
890
	// Are there any custom profile fields for below the signature?
891
	if (!empty($message['custom_fields']['below_signature']))
892
	{
893
		echo '
894
							<div class="custom_fields_below_signature">
895
								<ul class="nolist">';
896
897
		foreach ($message['custom_fields']['below_signature'] as $custom)
898
			echo '
899
									<li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>';
900
901
		echo '
902
								</ul>
903
							</div>';
904
	}
905
906
	echo '
907
						</div><!-- .moderatorbar -->
908
					</div><!-- .post_wrapper -->
909
				</div><!-- $message[css_class] -->
910
				<hr class="post_separator">';
911
}
912
913
/**
914
 * The template for displaying the quick reply box.
915
 */
916
function template_quickreply()
917
{
918
	global $context, $modSettings, $scripturl, $options, $txt;
919
920
	echo '
921
		<a id="quickreply_anchor"></a>
922
		<div class="tborder" id="quickreply">
923
			<div class="cat_bar">
924
				<h3 class="catbg">
925
					', $txt['quick_reply'], '
926
				</h3>
927
			</div>
928
			<div id="quickreply_options">
929
				<div class="roundframe">';
930
931
	// Is the topic locked?
932
	if ($context['is_locked'])
933
		echo '
934
					<p class="alert smalltext">', $txt['quick_reply_warning'], '</p>';
935
936
	// Show a warning if the topic is old
937
	if (!empty($context['oldTopicError']))
938
		echo '
939
					<p class="alert smalltext">', sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']), '</p>';
940
941
	// Does the post need approval?
942
	if (!$context['can_reply_approved'])
943
		echo '
944
					<p><em>', $txt['wait_for_approval'], '</em></p>';
945
946
	echo '
947
					<form action="', $scripturl, '?board=', $context['current_board'], ';action=post2" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);">
948
						<input type="hidden" name="topic" value="', $context['current_topic'], '">
949
						<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '">
950
						<input type="hidden" name="icon" value="xx">
951
						<input type="hidden" name="from_qr" value="1">
952
						<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '">
953
						<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '">
954
						<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '">
955
						<input type="hidden" name="last_msg" value="', $context['topic_last_message'], '">
956
						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
957
						<input type="hidden" name="seqnum" value="', $context['form_sequence_number'], '">';
958
959
	// Guests just need more.
960
	if ($context['user']['is_guest'])
961
	{
962
		echo '
963
						<dl id="post_header">
964
							<dt>
965
								', $txt['name'], ':
966
							</dt>
967
							<dd>
968
								<input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" required>
969
							</dd>';
970
971
		if (empty($modSettings['guest_post_no_email']))
972
		{
973
			echo '
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
		}
981
982
		echo '
983
						</dl>';
984
	}
985
986
	echo '
987
						', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message'), '
0 ignored issues
show
'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

987
						', 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

987
						', template_control_richedit($context['post_box_name'], 'smileyBox_message', /** @scrutinizer ignore-type */ 'bbcBox_message'), '
Loading history...
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...
988
						<script>
989
							function insertQuoteFast(messageid)
990
							{
991
								var e = document.getElementById("', $context['post_box_name'], '");
992
								sceditor.instance(e).insertQuoteFast(messageid);
993
994
								return false;
995
							}
996
						</script>';
997
998
	// Is visual verification enabled?
999
	if ($context['require_verification'])
1000
		echo '
1001
						<div class="post_verification">
1002
							<strong>', $txt['verification'], ':</strong>
1003
							', template_control_verification($context['visual_verification_id'], 'all'), '
1004
						</div>';
1005
1006
	// Finally, the submit buttons.
1007
	echo '
1008
						<span id="post_confirm_buttons">
1009
							', 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...
1010
						</span>';
1011
	echo '
1012
					</form>
1013
				</div><!-- .roundframe -->
1014
			</div><!-- #quickreply_options -->
1015
		</div><!-- #quickreply -->
1016
		<br class="clear">';
1017
1018
	// Draft autosave available and the user has it enabled?
1019
	if (!empty($context['drafts_autosave']))
1020
		echo '
1021
		<script>
1022
			var oDraftAutoSave = new smf_DraftAutoSave({
1023
				sSelf: \'oDraftAutoSave\',
1024
				sLastNote: \'draft_lastautosave\',
1025
				sLastID: \'id_draft\',', !empty($context['post_box_name']) ? '
1026
				sSceditorID: \'' . $context['post_box_name'] . '\',' : '', '
1027
				sType: \'', 'quick', '\',
1028
				iBoard: ', (empty($context['current_board']) ? 0 : $context['current_board']), ',
1029
				iFreq: ', (empty($modSettings['masterAutoSaveDraftsDelay']) ? 60000 : $modSettings['masterAutoSaveDraftsDelay'] * 1000), '
1030
			});
1031
		</script>';
1032
1033
	if ($context['show_spellchecking'])
1034
		echo '
1035
		<form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow">
1036
			<input type="hidden" name="spellstring" value="">
1037
		</form>';
1038
1039
	echo '
1040
		<script>
1041
			var oQuickReply = new QuickReply({
1042
				bDefaultCollapsed: false,
1043
				iTopicId: ', $context['current_topic'], ',
1044
				iStart: ', $context['start'], ',
1045
				sScriptUrl: smf_scripturl,
1046
				sImagesUrl: smf_images_url,
1047
				sContainerId: "quickreply_options",
1048
				sImageId: "quickReplyExpand",
1049
				sClassCollapsed: "toggle_up",
1050
				sClassExpanded: "toggle_down",
1051
				sJumpAnchor: "quickreply_anchor",
1052
				bIsFull: true
1053
			});
1054
			var oEditorID = "', $context['post_box_name'], '";
1055
			var oEditorObject = oEditorHandle_', $context['post_box_name'], ';
1056
			var oJumpAnchor = "quickreply_anchor";
1057
		</script>';
1058
}
1059
1060
?>