', isset($context['current_topic']) ? '
' : '';
// If an error occurred, explain what happened.
echo '
', $txt['error_while_submitting'], '
', empty($context['post_error']) ? '' : implode(' ', $context['post_error']), '
';
// If this won't be approved let them know!
if (!$context['becomes_approved'])
{
echo '
', $txt['wait_for_approval'], '
';
}
// If it's locked, show a message to warn the replyer.
echo '
', $txt['topic_locked_no_reply'], '
';
if (!empty($modSettings['drafts_post_enabled']))
echo '
',
sprintf($txt['draft_saved'], $scripturl . '?action=profile;u=' . $context['user']['id'] . ';area=showdrafts'), '
';
// The post header... important stuff
echo '
';
// Are you posting a calendar event?
if ($context['make_event'])
{
echo '
', $txt['calendar_event_title'], '
', $txt['calendar_year'], '
';
// Show a list of all the years we allow...
for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
echo '
', $year, ' ';
echo '
', $txt['calendar_month'], '
';
// There are 12 months per year - ensure that they all get listed.
for ($month = 1; $month <= 12; $month++)
echo '
', $txt['months'][$month], ' ';
echo '
', $txt['calendar_day'], '
';
// This prints out all the days in the current month - this changes dynamically as we switch months.
for ($day = 1; $day <= $context['event']['last_day']; $day++)
echo '
', $day, ' ';
echo '
';
if (!empty($modSettings['cal_allowspan']) || ($context['event']['new'] && $context['is_new_post']))
{
echo '
', $txt['calendar_event_options'], '
';
// If events can span more than one day then allow the user to select how long it should last.
if (!empty($modSettings['cal_allowspan']))
{
echo '
', $txt['calendar_numb_days'], '
';
for ($days = 1; $days <= $modSettings['cal_maxspan']; $days++)
echo '
', $days, ' ';
echo '
';
}
// If this is a new event let the user specify which board they want the linked post to be put into.
if ($context['event']['new'] && $context['is_new_post'])
{
echo '
', $txt['calendar_post_in'], '
';
foreach ($context['event']['categories'] as $category)
{
echo '
';
foreach ($category['boards'] as $board)
echo '
', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=>' : '', ' ', $board['name'], ' ';
echo '
';
}
echo '
';
}
echo '
';
}
echo '
';
}
// If this is a poll then display all the poll options!
if ($context['make_poll'])
{
echo '
', $txt['poll_question'], '
(', $txt['poll_add_option'], ')
', $txt['poll_options'], '
', $txt['poll_max_votes'], ':
', $txt['poll_run'], ':
', $txt['poll_run_limit'], '
', $txt['days_word'], '
', $txt['poll_do_change_vote'], ':
';
if ($context['poll_options']['guest_vote_enabled'])
echo '
', $txt['poll_guest_vote'], ':
';
echo '
', $txt['poll_results_visibility'], ':
', $txt['poll_results_anyone'], '
', $txt['poll_results_voted'], '
', $txt['poll_results_after'], '
';
}
// Show the actual posting area...
echo '
', template_control_richedit($context['post_box_name'], 'smileyBox_message', 'bbcBox_message');
// If this message has been edited in the past - display when it was.
if (isset($context['last_modified']))
echo '
', $txt['last_edit'], ':
', $context['last_modified'], '
';
// If the admin has enabled the hiding of the additional options - show a link and image for it.
if (!empty($settings['additional_options_collapsable']))
echo '
';
// Display the check boxes for all the standard options - if they are available to the user!
echo '
', $context['can_notify'] ? ' ' . $txt['notify_replies'] . ' ' : '', '
', $context['can_lock'] ? ' ' . $txt['lock_topic'] . ' ' : '', '
' . $txt['back_to_topic'] . '
', $context['can_sticky'] ? ' ' . $txt['sticky_after'] . ' ' : '', '
', $txt['dont_use_smileys'], ' ', '
', $context['can_move'] ? ' ' . $txt['move_after2'] . ' ' : '', '
', $context['can_announce'] && $context['is_first_post'] ? ' ' . $txt['announce_topic'] . ' ' : '', '
', $context['show_approval'] ? ' ' . $txt['approve_this_post'] . ' ' : '', '
';
// If this post already has attachments on it - give information about them.
if (!empty($context['current_attachments']))
{
echo '
', $txt['attached'], ':
', $txt['uncheck_unwatchd_attach'], ':
';
foreach ($context['current_attachments'] as $attachment)
echo '
', $attachment['name'], (empty($attachment['approved']) ? ' (' . $txt['awaiting_approval'] . ')' : ''),
!empty($modSettings['attachmentPostLimit']) || !empty($modSettings['attachmentSizeLimit']) ? sprintf($txt['attach_kb'], comma_format(round(max($attachment['size'], 1028) / 1028), 0)) : '', '
';
if (!empty($context['files_in_session_warning']))
echo '
', $context['files_in_session_warning'], ' ';
echo '
';
}
// Is the user allowed to post any additional ones? If so give them the boxes to do it!
if ($context['can_post_attachment'])
{
echo '
';
// But, only show them if they haven't reached a limit. Or a mod author hasn't hidden them.
if ($context['num_allowed_attachments'] > 0 || !empty($context['dont_show_them']))
{
echo '
', $txt['attach'], ':
', empty($modSettings['attachmentSizeLimit']) ? '' : (' '), '
(', $txt['clean_attach'], ' )';
// Show more boxes if they aren't approaching that limit.
if ($context['num_allowed_attachments'] > 1)
echo '
(', $txt['more_attachments'], ') ';
else
echo '
';
}
// Add any template changes for an alternative upload system here.
call_integration_hook('integrate_upload_template');
echo '
';
// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed.
if (!empty($modSettings['attachmentCheckExtensions']))
echo '
', $txt['allowed_types'], ': ', $context['allowed_extensions'], ' ';
if (!empty($context['attachment_restrictions']))
echo '
', $txt['attach_restrictions'], ' ', implode(', ', $context['attachment_restrictions']), ' ';
if ($context['num_allowed_attachments'] == 0)
echo '
', $txt['attach_limit_nag'], ' ';
if (!$context['can_post_attachment_unapproved'])
echo '
', $txt['attachment_requires_approval'], ' ', ' ';
echo '
';
}
// If the admin enabled the drafts feature, show a draft selection box
if (!empty($modSettings['drafts_enabled']) && !empty($context['drafts']) && !empty($options['drafts_show_saved_enabled']))
{
echo '
', $txt['subject'], '
', $txt['draft_saved_on'], ' ';
foreach ($context['drafts'] as $draft)
echo '
', $draft['link'], '
', $draft['poster_time'], ' ';
echo '
';
}
// Is visual verification enabled?
if ($context['require_verification'])
{
echo '
', $txt['verification'], ':
', template_control_verification($context['visual_verification_id'], 'all'), '
';
}
// Finally, the submit buttons.
echo '
', isBrowser('is_firefox') ? ($context['drafts_save'] ? $txt['shortcuts_drafts_firefox'] : $txt['shortcuts_firefox']) : ($context['drafts_save'] ? $txt['shortcuts_drafts'] : $txt['shortcuts']), '
', template_control_richedit_buttons($context['post_box_name']);
// Option to delete an event if user is editing one.
if ($context['make_event'] && !$context['event']['new'])
echo '
';
echo '