Fix thread template - refs BT#9892 #TMI

Angel Fernando Quiroz Campos 11 years ago
parent 5451d97107
commit 86d01e3668
  1. 23
      main/forum/viewthread.php
  2. 3
      main/forum/viewthread_flat.inc.php
  3. 8
      main/template/games/forum/flat_learnpath.tpl

@ -156,6 +156,9 @@ if ($my_action == 'move' && isset($_GET['post'])) {
/* Display the action messages */
$buttonReplyToThread = null;
$allowReply = false;
$my_message = isset($message) ? $message : '';
if ($my_message) {
Display::display_confirmation_message(get_lang($my_message));
@ -179,7 +182,9 @@ if ($my_message != 'PostDeletedSpecial') {
if ($_user['user_id'] OR ($current_forum['allow_anonymous'] == 1 && !$_user['user_id'])) {
// reply link
if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
$buttonReply = Display::toolbarButton(
$allowReply = true;
$buttonReplyToThread = Display::toolbarButton(
get_lang('ReplyToThread'),
"{$forumUrl}reply.php?" . api_get_cidreq() . '&' . http_build_query([
'forum' => Security::remove_XSS($_GET['forum']),
@ -204,21 +209,13 @@ if ($my_message != 'PostDeletedSpecial') {
)
) {
if ($current_forum['locked'] <> 1 AND $current_forum['locked'] <> 1) {
$buttonReply = '&nbsp;&nbsp;';
$buttonReplyToThread = '&nbsp;&nbsp;';
} else {
$buttonReply = get_lang('ForumLocked');
$buttonReplyToThread = get_lang('ForumLocked');
}
}
}
}
$html = '';
$html .= '<div class="top-disqus">';
$html .= $buttonReply;
$html .= '</div>';
echo $html;
}else{
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
@ -282,7 +279,9 @@ if ($my_message != 'PostDeletedSpecial') {
}
$my_url = null;
echo '</div>&nbsp;';
if ($origin != 'learnpath') {
echo '</div>';
}
/* Display Forum Category and the Forum information */

@ -357,12 +357,15 @@ if (isset($current_thread['thread_id'])) {
$template = new Template(null, false, false, false, false, false);
$template->assign('is_anonymous', api_is_anonymous());
$template->assign('is_allowed_to_edit', api_is_allowed_to_edit(false, true));
$template->assign('is_allowed_to_session_edit', api_is_allowed_to_session_edit(false, true));
$template->assign('posts', $rows);
$template->assign('forum', $current_forum);
$template->assign('thread_id', $clean_thread_id);
$template->assign('delete_confirm_message', addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)));
$template->assign('locked', $locked);
$template->assign('allow_reply', $allowReply);
$template->assign('button_reply_to_thread', $buttonReplyToThread);
$templateFolder = api_get_configuration_value('default_template');

@ -1,3 +1,7 @@
<div class="top-disqus">
{{ button_reply_to_thread }}
</div>
<div class="forum-disqus">
{% for post in posts %}
<div class="post-disqus">
@ -24,8 +28,7 @@
{{ post.post_text }}
</div>
<div class="tools-disqus">
{% if _u.user_id or (forum.allow_anonymous == 1 and not _u.user_id) %}
{% if not is_anonymous and is_allowed_to_session_edit %}
{% if allow_reply %}
<a href="reply.php?{{ _p.web_cid_query ~ '&' ~ {'forum': forum.forum_id, 'thread': thread_id, 'post': post.post_id, 'action': 'replymessage'}|url_encode }}" class="btn btn-primary btn-xs reply-disqus">
<i class="fa fa-reply"></i> {{ "Reply"|get_lang }}
</a>
@ -34,7 +37,6 @@
<i class="fa fa-quote-left"></i> {{ "Quote"|get_lang }}
</a>
{% endif %}
{% endif %}
{% if is_allowed_to_session_edit %}
{% if not locked %}

Loading…
Cancel
Save