MyBB Community Forums

Full Version: Ip log on thread views
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
Is there any plugin to have ip log for each thread? Because users can view a thread multiple times to have more views.
thanks
That isn't really a practical way for thread view control. Unless a person has a static ip, it could change any time. What would be better is to log user ids that have viewed a thread instead.
(2021-03-20, 07:09 PM)dragonexpert Wrote: [ -> ]That isn't really a practical way for thread view control. Unless a person has a static ip, it could change any time. What would be better is to log user ids that have viewed a thread instead.

Thank you for your reply,
I agree with you, Its better to log user ids, Do you have any idea how to do it?
It exists, it's the mybb_threadsread table.
I found this one by @Omar
showthread.php
if(!$session->is_spider && $mybb->user['uid'] != $thread['uid'])
{
	if($mybb->settings['delayedthreadviews'])
	{
		$db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
	}
	else
	{
		$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
	}
}

If you don't want thread authors to increase the thread views count,Anyone know how to make it for everyone? I mean for guests+members+ thread authros to give only 1 view