From 3b158218cf4f4a4b47f6d7316b3237953059b82a Mon Sep 17 00:00:00 2001
From: Jimako <janamicek@gmail.com>
Date: Sun, 6 Jan 2019 13:48:56 +0100
Subject: [PATCH] Fix #3338 - marked more than one forum as read

Because $currentUser['user_plugin_forum_viewed'] is not refreshed after adding one thread,  it's still the same and only last thread is changed
---
 e107_plugins/forum/forum_class.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php
index 41c101e85..261d8937a 100644
--- a/e107_plugins/forum/forum_class.php
+++ b/e107_plugins/forum/forum_class.php
@@ -1586,6 +1586,7 @@ class e107forum
 		$tmp = array_unique($_tmp);
 		// issue #3338 fixed typo, that caused issue with not marking threads are read
 		$viewed = trim(implode(',', $tmp), ',');
+		$currentUser['user_plugin_forum_viewed'] =  $viewed;
 		return e107::getDb()->update('user_extended', "user_plugin_forum_viewed = '{$viewed}' WHERE user_extended_id = ".USERID);
 	}