From 932b48ef448414de37b509b57bdcb400208bb0bd Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 7 Feb 2018 08:11:01 +0100 Subject: [PATCH] Minor - format code, fix php warning --- main/forum/viewthread_flat.inc.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/main/forum/viewthread_flat.inc.php b/main/forum/viewthread_flat.inc.php index cfe227a28b..fecdfbaa55 100755 --- a/main/forum/viewthread_flat.inc.php +++ b/main/forum/viewthread_flat.inc.php @@ -62,9 +62,7 @@ if (isset($current_thread['thread_id'])) { $current_thread['locked'] == 0 || api_is_allowed_to_edit(false, true) ) { - if ($_user['user_id'] || - ($current_forum['allow_anonymous'] == 1 && !$_user['user_id']) - ) { + if ($userId || ($current_forum['allow_anonymous'] == 1 && !$userId)) { if ((api_is_anonymous() && $current_forum['allow_anonymous'] == 1) || (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) ) { @@ -173,7 +171,7 @@ if (isset($current_thread['thread_id'])) { // The course admin him/herself can do this off course always $groupInfo = GroupManager::get_group_properties($groupId); if ((isset($groupInfo['iid']) && GroupManager::is_tutor_of_group($userId, $groupInfo)) || - ($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) || + ($current_forum['allow_edit'] == 1 && $posterId == $userId) || ( api_is_allowed_to_edit(false, true) && !(api_is_session_general_coach() && $current_forum['session_id'] != $sessionId) @@ -315,7 +313,7 @@ if (isset($current_thread['thread_id'])) { $post_image = Display::return_icon('forumpost.gif'); } - if ($row['post_notification'] == '1' && $row['poster_id'] == $_user['user_id']) { + if ($row['post_notification'] == '1' && $row['poster_id'] == $userId) { $post_image .= Display::return_icon('forumnotification.gif', get_lang('YouWillBeNotified')); } // The post title @@ -328,8 +326,9 @@ if (isset($current_thread['thread_id'])) { $html .= Display::return_icon('attachment.gif', get_lang('Attachment')); $html .= ' '.$user_filename.' '; - if (($current_forum['allow_edit'] == 1 && $row['user_id'] == $_user['user_id']) || - (api_is_allowed_to_edit(false, true) && !(api_is_session_general_coach() && $current_forum['session_id'] != $sessionId)) + if (($current_forum['allow_edit'] == 1 && $posterId == $userId) || + (api_is_allowed_to_edit(false, true) && + !(api_is_session_general_coach() && $current_forum['session_id'] != $sessionId)) ) { $html .= '