1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-29 10:38:08 +01:00

Possibly related to issue #809.

This commit is contained in:
Cameron 2015-04-22 00:16:52 -07:00
parent bd75e69f2d
commit db235bd468
3 changed files with 13 additions and 4 deletions

View File

@ -1248,7 +1248,7 @@ class e107forum
{
$_tmp[] = (int)$tid;
}
$tmp = array_unique($tmp);
$tmp = array_unique($_tmp);
$viewed = trim(implode(',', $_tmp), ',');
return e107::getDb()->update('user_extended', "user_plugin_forum_viewed = '{$viewed}' WHERE user_extended_id = ".USERID);
}

View File

@ -406,18 +406,27 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
}
$mes = e107::getMessage();
$forend = $tp->simpleParse($FORUMEND, $tVars);
$forumstring = $forstr . $forthr . vartrue($forrep) . $forend;
//If last post came after USERLV and not yet marked as read, mark the thread id as read
$threadsViewed = explode(',', $currentUser['user_plugin_forum_viewed']);
if ($thread->threadInfo['thread_lastpost'] > USERLV && !in_array($thread->threadId, $threadsViewed))
{
$tst = $forum->threadMarkAsRead($thread->threadId);
$mes->addDebug("Marking Forum as read: ".$thread->threadId." result: ".$tst);
}
$mes = e107::getMessage();
else
{
$ret = array('lastpost'=>$thread->threadInfo['thread_lastpost'], 'lastvisit'=>USERLV, 'thread'=>$thread->threadId, 'viewed'=>$threadsViewed);
$mes->addDebug(print_a($ret,true));
unset($ret);
}
require_once (HEADERF);

View File

@ -428,7 +428,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
// $text .= $this->sc_level('pic');
$ue = $tp->parseTemplate("{USER_EXTENDED=location.text_value}",true);
$username = $this->postInfo['user_name'];
$username = (empty($this->postInfo['user_name'])) ? LAN_ANONYMOUS : $this->postInfo['user_name'];
$text = '<div class="btn-group ">