MyBB Community Forums
Broken thread view counter caused by old plugin MyTracker - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Broken thread view counter caused by old plugin MyTracker (/thread-233262.html)



Broken thread view counter caused by old plugin MyTracker - remus - 2021-08-11

Hi,

I've managed to get MyTracker (1.0.1, didn't find the newer 1.0.2) working under MyBB 1.8.27. Everything works perfectly but today i realized the thread view counter does not work anymore. I figured out that plugins can cause this and yes, right after deactivating MyTracker the thread view counter works again. I tried to fix it by doing the MyTracker upgrade process without success.

Any ideas how this could be fixed?

EDIT:
It seems to be fixed by the following code changes in showthread.php:

if($mybb->settings['delayedthreadviews'] == 1)
{
	$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}'");
	$db->query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
}
++$thread['views'];


Greez
remus