From b963f763196625b54884cea1c08c19cb17fc5eae Mon Sep 17 00:00:00 2001 From: mcfly Date: Thu, 18 Dec 2008 17:10:48 +0000 Subject: [PATCH] Mark newly added thread as read by author --- e107_plugins/forum/forum_class.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index d94516459..005f3ecdf 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_class.php,v $ -| $Revision: 1.30 $ -| $Date: 2008-12-18 15:28:59 $ +| $Revision: 1.31 $ +| $Date: 2008-12-18 17:10:48 $ | $Author: mcfly_e107 $ +----------------------------------------------------------------------------+ */ @@ -109,7 +109,6 @@ class e107forum } } - function checkPerm($forumId, $type='view') { return (in_array($forumId, $this->permList[$type])); @@ -125,11 +124,7 @@ class e107forum $this->userViewed = explode('.', $e107->currentUser['user_plugin_forum_viewed']); } } - if(is_array($this->userViewed) && in_array($threadId, $this->userViewed)) - { - return true; - } - return false; + return (is_array($this->userViewed) && in_array($threadId, $this->userViewed)); } function getTrackedThreadList($id, $retType = 'array') @@ -241,6 +236,7 @@ class e107forum $postInfo['_FIELD_TYPES'] = $this->fieldTypes['forum_post']; $postInfo['post_thread'] = $newThreadId; $newPostId = $this->postAdd($postInfo, false); + $this->threadMarkAsRead($newThreadId); return array('postid' => $newPostId, 'threadid' => $newThreadId); } return false;