', $txt['report_sent'], '
';
// Let them know why their message became unapproved.
if ($context['becomesUnapproved'])
echo '
', $txt['post_becomes_unapproved'], '
';
// Show new topic info here?
echo '
', $context['subject'], '', ($context['is_locked']) ? ' ' : '', ($context['is_sticky']) ? ' ' : '', '
';
// Show the page index... "Pages: [1]".
echo '
', $txt['go_down'], '
', $context['page_index'], '
', template_button_strip($context['normal_buttons'], 'right'), '
', $context['menu_separator'], '
';
// Next - Prev
echo '
', $context['previous_next'], '
';
if (!empty($settings['display_who_viewing']))
{
echo '
';
// Show just numbers...?
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt['members'];
// Or show the actual people viewing the topic?
else
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'] . ')');
// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '
';
}
// Show the anchor for the top and for the first message. If the first message is new, say so.
echo '
', $context['first_new_message'] ? '' : '';
// Is this topic also a poll?
if ($context['is_poll'])
{
echo '
', $context['poll']['is_locked'] ? '' : '', ' ', $context['poll']['question'], '
';
// Are they not allowed to vote but allowed to view the options?
if ($context['poll']['show_results'] || !$context['allow_vote'])
{
echo '
';
// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option)
{
echo '
- ', $option['option'], '
- ';
if ($context['allow_results_view'])
echo '
', $option['bar_ndt'], '
', $option['votes'], ' (', $option['percent'], '%)';
echo '
';
}
echo '
';
if ($context['allow_results_view'])
echo '
', $txt['poll_total_voters'], ': ', $context['poll']['total_votes'], '
';
}
// They are allowed to vote! Go to it!
else
{
echo '
';
}
// Is the clock ticking?
if (!empty($context['poll']['expire_time']))
echo '
', ($context['poll']['is_expired'] ? $txt['poll_expired_on'] : $txt['poll_expires_on']), ': ', $context['poll']['expire_time'], '
';
echo '
';
template_button_strip($context['poll_buttons']);
echo '
';
}
// Does this topic have some events linked to it?
if (!empty($context['linked_calendar_events']))
{
echo '
', $txt['calendar_linked_events'], '
';
}
// Mobile action - moderation buttons (top)
if (!empty($context['normal_buttons']))
echo '
';
echo '
';
// Show the topic information - icon, subject, etc.
echo '
';
// Show the page index... "Pages: [1]". But after all posts.
echo '
', $txt['go_up'], '
', $context['page_index'], '
', template_button_strip($context['normal_buttons'], 'right'), '
', $context['menu_separator'], '
';
// Next - Prev
//echo '
', $context['previous_next'], ''
;
// Mobile action - moderation buttons (bottom)
if (!empty($context['normal_buttons']))
echo '
';
echo '
';
// Show the lower breadcrumbs.
theme_linktree();
// Moderation buttons
echo '
', template_button_strip($context['mod_buttons'], 'bottom', array('id' => 'moderationbuttons_strip')), '
';
// Show the jumpto box, or actually...let Javascript do it.
echo '
';
// User action pop on mobile screen (or actually small screen), this uses responsive css does not check mobile device.
echo '
';
// Show the moderation button & pop (if there is anything to show)
if (!empty($context['mod_buttons']))
echo '
';
echo '
';
}
/**
* Template for displaying a single post.
*
* @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'.
*/
function template_single_post($message)
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
$ignoring = false;
if ($message['can_remove'])
$context['removableMessageIDs'][] = $message['id'];
// Are we ignoring this message?
if (!empty($message['is_ignored']))
{
$ignoring = true;
$context['ignoredMsgs'][] = $message['id'];
}
// Show the message anchor and a "new" anchor if this message is new.
echo '
', $message['id'] != $context['first_message'] ? '
' . ($message['first_new'] ? '
' : '') : '', '
';
// Show information about the poster of this message.
echo '
';
// Are there any custom fields above the member name?
if (!empty($message['custom_fields']['above_member']))
{
echo '
';
foreach ($message['custom_fields']['above_member'] as $custom)
echo '
- ', $custom['value'], '
';
echo '
';
}
echo '
';
// Custom fields BEFORE the username?
if (!empty($message['custom_fields']['before_member']))
foreach ($message['custom_fields']['before_member'] as $custom)
echo '
', $custom['value'], '';
// Show a link to the member's profile.
echo '
', $message['member']['link'];
// Custom fields AFTER the username?
if (!empty($message['custom_fields']['after_member']))
foreach ($message['custom_fields']['after_member'] as $custom)
echo '
', $custom['value'], '';
// Begin display of user info
echo '
';
// Show the member's custom title, if they have one.
if (!empty($message['member']['title']))
echo '
- ', $message['member']['title'], '
';
// Show the member's primary group (like 'Administrator') if they have one.
if (!empty($message['member']['group']))
echo '
- ', $message['member']['group'], '
';
// Show the user's avatar.
if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
-
', $message['member']['avatar']['image'], '
';
// Are there any custom fields below the avatar?
if (!empty($message['custom_fields']['below_avatar']))
foreach ($message['custom_fields']['below_avatar'] as $custom)
echo '
- ', $custom['value'], '
';
// Don't show these things for guests.
if (!$message['member']['is_guest'])
{
// Show their personal text?
if (!empty($modSettings['show_blurb']) && !empty($message['member']['blurb']))
echo '
- ', $message['member']['blurb'], '
';
// Any custom fields to show as icons?
if (!empty($message['custom_fields']['icons']))
{
echo '
-
';
foreach ($message['custom_fields']['icons'] as $custom)
echo '
- ', $custom['value'], '
';
echo '
';
}
// Any custom fields for standard placement?
if (!empty($message['custom_fields']['standard']))
foreach ($message['custom_fields']['standard'] as $custom)
echo '
- ', $custom['title'], ': ', $custom['value'], '
';
}
// Otherwise, show the guest's email.
elseif (!empty($message['member']['email']) && $message['member']['show_email'])
echo '
-
', ($settings['use_image_buttons'] ? '' : $txt['email']), '
';
// Show the IP to this user for this post - only if you can moderate. Useful for guest, can be used if a member are hacked (from where).
if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
echo '
-
', $txt['show_ip'], ' (?)
';
// Are we showing the warning status?
// Don't show these things for guests.
if (!$message['member']['is_guest'] && $message['member']['can_see_warning'])
echo '
-
', $context['can_issue_warning'] ? '' : '', ' ', $context['can_issue_warning'] ? '' : '', '', $txt['warn_' . $message['member']['warning_status']], '
';
// Are there any custom fields to show at the bottom of the poster info?
if (!empty($message['custom_fields']['bottom_poster']))
foreach ($message['custom_fields']['bottom_poster'] as $custom)
echo '
- ', $custom['value'], '
';
// Poster info ends.
echo '
';
// Some people don't want subject... The div is still required or quick edit breaks.
echo '
', $message['link'], '
';
// Link with date and link to the message above post
echo '
', !empty($message['counter']) ? '#' . $message['counter'] . '' : '', '
(', $message['time'], ')
';
// Show the quickbuttons, for various operations on posts. TODO : changer ce machin par des boutons sans "quick". Tel quel, ils ont des soucis d'accessibilités, sont pénibles, certains inutiles...
template_quickbuttons($message['quickbuttons'], 'post');
echo '
';
// Ignoring this user? Hide the post.
if ($ignoring)
echo '
';
// Show the post itself, finally!
echo '
';
if (!$message['approved'] && $message['member']['id'] != 0 && $message['member']['id'] == $context['user']['id'])
echo '
', $txt['post_awaiting_approval'], '
';
echo '
', $message['body'], '
';
// Assuming there are attachments...
if (!empty($message['attachment']))
{
$last_approved_state = 1;
// Don't output the div unless we actually have something to show...
$div_output = false;
foreach ($message['attachment'] as $attachment)
{
// Do we want this attachment to not be showed here?
if ($attachment['is_approved'] && !empty($modSettings['dont_show_attach_under_post']) && !empty($context['show_attach_under_post'][$attachment['id']]))
continue;
elseif (!$div_output)
{
$div_output = true;
echo '
';
}
echo '
';
// What about likes?
if (!empty($modSettings['enable_likes']))
{
echo '
';
if (!empty($message['likes']['can_like']))
{
echo '
-
', $message['likes']['you'] ? $txt['unlike'] : $txt['like'], '
';
}
if (!empty($message['likes']['count']))
{
$context['some_likes'] = true;
$count = $message['likes']['count'];
$base = 'likes_';
if ($message['likes']['you'])
{
$base = 'you_' . $base;
$count--;
}
$base .= (isset($txt[$base . $count])) ? $count : 'n';
echo '
-
', sprintf($txt[$base], $scripturl . '?action=likes;sa=view;ltype=msg;like=' . $message['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], comma_format($count)), '
';
}
echo '
';
}
echo '
';
// Show "<< Last Edit: Time by Person >>" if this post was edited. But we need the div even if it wasn't modified!
// 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.
echo '
';
if (!empty($modSettings['show_modify']) && !empty($message['modified']['name']))
echo
$message['modified']['last_edit_text'];
echo '';
// Are there any custom profile fields for above the signature?
if (!empty($message['custom_fields']['above_signature']))
{
echo '
';
foreach ($message['custom_fields']['above_signature'] as $custom)
echo '
- ', $custom['value'], '
';
echo '
';
}
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']) && $context['signature_enabled'])
echo '
', $message['member']['signature'], '
';
// Are there any custom profile fields for below the signature?
if (!empty($message['custom_fields']['below_signature']))
{
echo '
';
foreach ($message['custom_fields']['below_signature'] as $custom)
echo '
- ', $custom['value'], '
';
echo '
';
}
echo '
';
}
/**
* The template for displaying the quick reply box.
*/
function template_quickreply()
{
global $context, $modSettings, $scripturl, $options, $txt;
echo '
', $txt['quick_reply'], '
';
// Is the topic locked?
if ($context['is_locked'])
echo '
', $txt['quick_reply_warning'], '
';
// Show a warning if the topic is old
if (!empty($context['oldTopicError']))
echo '
', sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']), '
';
// Does the post need approval?
if (!$context['can_reply_approved'])
echo '
', $txt['wait_for_approval'], '
';
echo '
';
// Draft autosave available and the user has it enabled?
if (!empty($context['drafts_autosave']))
echo '
';
if ($context['show_spellchecking'])
echo '
';
echo '
';
}
?>