|
@@ -535,92 +535,125 @@ function template_main()
|
|
</div>';
|
|
</div>';
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // And stuff below the attachments
|
|
echo '
|
|
echo '
|
|
- </div>';
|
|
|
|
|
|
+ <div class="under_message">';
|
|
|
|
+
|
|
// Maybe they want to report this post to the moderator(s)?
|
|
// Maybe they want to report this post to the moderator(s)?
|
|
if ($context['can_report_moderator'])
|
|
if ($context['can_report_moderator'])
|
|
echo '
|
|
echo '
|
|
- <ul class="floatright smalltext">
|
|
|
|
- <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>
|
|
|
|
- </ul>';
|
|
|
|
|
|
+ <ul class="floatright smalltext">
|
|
|
|
+ <li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>
|
|
|
|
+ </ul>';
|
|
|
|
+
|
|
|
|
+ // What about likes?
|
|
|
|
+ echo '
|
|
|
|
+ <ul class="floatleft">';
|
|
|
|
+ if (!empty($message['likes']['can_like']))
|
|
|
|
+ {
|
|
|
|
+ echo '
|
|
|
|
+ <li class="like_button"><a href="', $scripturl, '?action=likes;ltype=msg;like=', $message['id'], '"><span class="', $message['likes']['you'] ? 'unlike' : 'like', '"></span>', $message['likes']['you'] ? $txt['unlike'] : $txt['like'], '</a></li>';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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 '
|
|
|
|
+ <li class="like_count smalltext">', sprintf($txt[$base], $scripturl . '?action=likes;view;ltype=msg;like=' . $message['id'], comma_format($count)), '</li>';
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ echo '
|
|
|
|
+ </ul>';
|
|
|
|
|
|
// Show the quickbuttons, for various operations on posts.
|
|
// Show the quickbuttons, for various operations on posts.
|
|
if ($message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
|
|
if ($message['can_approve'] || $message['can_unapprove'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'] || $context['can_quote'])
|
|
{
|
|
{
|
|
echo '
|
|
echo '
|
|
- <ul class="quickbuttons">';
|
|
|
|
|
|
+ <ul class="quickbuttons">';
|
|
|
|
|
|
// Can they reply? Have they turned on quick reply?
|
|
// Can they reply? Have they turned on quick reply?
|
|
if ($context['can_quote'] && !empty($options['display_quick_reply']))
|
|
if ($context['can_quote'] && !empty($options['display_quick_reply']))
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');" class="quote_button">', $txt['quote_action'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" onclick="return oQuickReply.quote(', $message['id'], ');" class="quote_button">', $txt['quote_action'], '</a></li>';
|
|
|
|
|
|
// So... quick reply is off, but they *can* reply?
|
|
// So... quick reply is off, but they *can* reply?
|
|
elseif ($context['can_quote'])
|
|
elseif ($context['can_quote'])
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" class="quote_button">', $txt['quote_action'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=post;quote=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';last_msg=', $context['topic_last_message'], '" class="quote_button">', $txt['quote_action'], '</a></li>';
|
|
|
|
|
|
// Can the user modify the contents of this post? Show the modify inline image.
|
|
// Can the user modify the contents of this post? Show the modify inline image.
|
|
if ($message['can_modify'])
|
|
if ($message['can_modify'])
|
|
echo '
|
|
echo '
|
|
- <li class="quick_edit"><img src="', $settings['images_url'], '/icons/modify_inline.png" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: pointer; margin: 0;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />', $txt['quick_edit'], '</li>';
|
|
|
|
|
|
+ <li class="quick_edit"><img src="', $settings['images_url'], '/icons/modify_inline.png" alt="', $txt['modify_msg'], '" title="', $txt['modify_msg'], '" class="modifybutton" id="modify_button_', $message['id'], '" style="cursor: pointer; margin: 0;" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" />', $txt['quick_edit'], '</li>';
|
|
|
|
|
|
if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
|
|
if ($message['can_approve'] || $message['can_unapprove'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
|
|
echo '
|
|
echo '
|
|
- <li class="post_options">', $txt['post_options'];
|
|
|
|
|
|
+ <li class="post_options">', $txt['post_options'];
|
|
|
|
|
|
echo '
|
|
echo '
|
|
- <ul>';
|
|
|
|
|
|
+ <ul>';
|
|
|
|
|
|
// Can the user modify the contents of this post?
|
|
// Can the user modify the contents of this post?
|
|
if ($message['can_modify'])
|
|
if ($message['can_modify'])
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" class="modify_button">', $txt['modify'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], '" class="modify_button">', $txt['modify'], '</a></li>';
|
|
|
|
|
|
// How about... even... remove it entirely?!
|
|
// How about... even... remove it entirely?!
|
|
if ($message['can_remove'])
|
|
if ($message['can_remove'])
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');" class="remove_button">', $txt['remove'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['remove_message'], '?\');" class="remove_button">', $txt['remove'], '</a></li>';
|
|
|
|
|
|
// What about splitting it off the rest of the topic?
|
|
// What about splitting it off the rest of the topic?
|
|
if ($context['can_split'] && !empty($context['real_num_replies']))
|
|
if ($context['can_split'] && !empty($context['real_num_replies']))
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '" class="split_button">', $txt['split'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=splittopics;topic=', $context['current_topic'], '.0;at=', $message['id'], '" class="split_button">', $txt['split'], '</a></li>';
|
|
|
|
|
|
// Can we issue a warning because of this post? Remember, we can't give guests warnings.
|
|
// Can we issue a warning because of this post? Remember, we can't give guests warnings.
|
|
if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
|
|
if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '" class="warn_button">', $txt['issue_warning'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '" class="warn_button">', $txt['issue_warning'], '</a></li>';
|
|
|
|
|
|
// Can we restore topics?
|
|
// Can we restore topics?
|
|
if ($context['can_restore_msg'])
|
|
if ($context['can_restore_msg'])
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="restore_button">', $txt['restore_message'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=restoretopic;msgs=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="restore_button">', $txt['restore_message'], '</a></li>';
|
|
|
|
|
|
// Maybe we can approve it, maybe we should?
|
|
// Maybe we can approve it, maybe we should?
|
|
if ($message['can_approve'])
|
|
if ($message['can_approve'])
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="approve_button">', $txt['approve'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="approve_button">', $txt['approve'], '</a></li>';
|
|
|
|
|
|
// Maybe we can unapprove it?
|
|
// Maybe we can unapprove it?
|
|
if ($message['can_unapprove'])
|
|
if ($message['can_unapprove'])
|
|
echo '
|
|
echo '
|
|
- <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="unapprove_button">', $txt['unapprove'], '</a></li>';
|
|
|
|
|
|
+ <li><a href="', $scripturl, '?action=moderate;area=postmod;sa=approve;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '" class="unapprove_button">', $txt['unapprove'], '</a></li>';
|
|
|
|
|
|
echo '
|
|
echo '
|
|
- </ul>
|
|
|
|
- </li>';
|
|
|
|
|
|
+ </ul>
|
|
|
|
+ </li>';
|
|
|
|
|
|
// Show a checkbox for quick moderation?
|
|
// Show a checkbox for quick moderation?
|
|
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
|
|
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $message['can_remove'])
|
|
echo '
|
|
echo '
|
|
- <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
|
|
|
|
|
|
+ <li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
|
|
|
|
|
|
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
|
|
if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
|
|
echo '
|
|
echo '
|
|
- </ul>';
|
|
|
|
|
|
+ </ul>';
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ echo '
|
|
|
|
+ </div>
|
|
|
|
+ </div>';
|
|
echo '
|
|
echo '
|
|
<div class="moderatorbar">';
|
|
<div class="moderatorbar">';
|
|
|
|
|
|
@@ -824,6 +857,10 @@ function template_main()
|
|
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script>
|
|
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/topic.js"></script>
|
|
<script type="text/javascript"><!-- // --><![CDATA[';
|
|
<script type="text/javascript"><!-- // --><![CDATA[';
|
|
|
|
|
|
|
|
+ if (!empty($context['some_likes']))
|
|
|
|
+ echo '
|
|
|
|
+ add_like_popup();';
|
|
|
|
+
|
|
if (!empty($options['display_quick_reply']))
|
|
if (!empty($options['display_quick_reply']))
|
|
echo '
|
|
echo '
|
|
var oQuickReply = new QuickReply({
|
|
var oQuickReply = new QuickReply({
|