2015-11-09, 09:55 PM
2015-11-10, 11:07 AM
For a logged in user you'll want to query the mybb_threadsread table first.
Then in your while loop for posts put this:
I believe for guests it stores the data as cookies.
$query = $db->simple_select("threadsread", "*", "tid=$tid AND uid=" . $mybb->user['uid']);
$threaddata= $db->fetch_array($query);
Then in your while loop for posts put this:
if($post['dateline'] > $threaddata['dateline'])
{
// Post is unread.
}
else
{
// Post is already read
}
I believe for guests it stores the data as cookies.
2015-11-10, 04:16 PM
yes that I know good to look in to forumread DB table too
guest have cookie
guest have cookie
$last_read = my_get_array_cookie("threadread", $thread['tid']);
$forum_read = my_get_array_cookie("forumread", $fid);
if(isset($mybb->cookies['mybb']['readallforums']) && !$forum_read)
{
$forum_read = $mybb->cookies['mybb']['lastvisit'];
}