MyBB Community Forums

Full Version: New thread views count is zero [SOLVED]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Since today, view counts for newly created threads are zero. I did whats being advised in this thread
http://community.mybb.com/thread-52909-p...#pid515853
but no change. (link directly gets to my reply. I realized then that that was merge system support thread and decided to make a new thread here and link to that. Mods please feel free to merge or delete as you see fit)

How to reset the view count? Reply count works fine. Thanks
Go to your Admin Panel -> Tools & Maintenance -> Recount & Rebuild and rebuild the thread counters.
(2009-07-14, 11:46 AM)MattRogowski Wrote: [ -> ]Recently there have been quite a few threads made with a problem where all post counts are 0, and post counts don't increment. To solve this issue, follow these three steps below.

Go into phpMyAdmin and run this query:

UPDATE `mybb_forums` SET `usepostcounts` = '1';

This is needed because, if you have this problem, this is set to 0 for all forums, meaning posts won't be counted.

Next, go to the MyBB ACP > Tools & Maintenance > Cache Manager > find the 'forums' cache, and click Rebuild Cache. This is necessary when editing forum settings via phpMyAdmin.

Finally, go to ACP > Tools & Maintenance > Recount and Rebuild > run the first 4 in the list. This will just recount all of the stats and post counts to their true value.

After that, everything should be running as normal.

Yes. All done, also according to this and no effect.
Any other solutions?
(2010-06-07, 11:54 PM)Bob Jansen Wrote: [ -> ]Go to your Admin Panel -> Tools & Maintenance -> Recount & Rebuild and rebuild the thread counters.

Any other solutions?
Are you sure you're doing all the steps correctly?? There's only so many things that can cause this... if not then PM me phpMyAdmin and forum admin login details...
Yes. I did exactly as it said multiple times. When I run the SQL command it says with a tick mark
0 row(s) affected. ( Query took 0.0004 sec )
And you're rebuild the cache too?? PM me phpMyAdmin and forum admin details.
(2010-06-11, 06:28 PM)MattRogowski Wrote: [ -> ]And you're rebuild the cache too?? PM me phpMyAdmin and forum admin details.

ok. details sent. thanks
I apologise, I got my wires crossed with what the problem was here. The thread you tried before was for user post counts staying at 0, not view counts, and I then got into my head that it was post counts with the problem. Issue was that the 'Delayed Thread View Updates' option in the Show Thread Options was set to On, so thread views were increased every 15 minutes by a scheduled task, not instantly. I've turned this setting off and views now increase as someone views the thread. Sorry for the confusion, should all be working fine now.
(2010-06-12, 12:51 PM)MattRogowski Wrote: [ -> ]I apologise, I got my wires crossed with what the problem was here. The thread you tried before was for user post counts staying at 0, not view counts, and I then got into my head that it was post counts with the problem. Issue was that the 'Delayed Thread View Updates' option in the Show Thread Options was set to On, so thread views were increased every 15 minutes by a scheduled task, not instantly. I've turned this setting off and views now increase as someone views the thread. Sorry for the confusion, should all be working fine now.

Matt,

Thank you very much for your time. I was curious as to why the view count was constant at 0, irrespective of how many times I viewed the thread from different locations. For days. And, if I remember correctly, the view count it set to 1 as soon as a thread is created. But it was always zero for several threads I created. Strange. It seems to be in order now.

Matt: you are the man!
i have same problem!
i turned off thread delay view...
rebuild caches...
rebuild threads counters... forum counters....
and no success!

few days ago it was okay! but after i changed my server, this happened to my board!
no new thread VIEW won't change! all are 0 views.
another which i have is this which the FORUMS ICON (On - Off) is always turned on! (like there is a new topic or post in this forum, but user already checked new topics and there is no more un-viewed topic)
in didn't find the solution, but at least by this way my THREAD VIEW COUNTER works!

in showthread.php

i changed this:

	// Increment the thread view.
	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}'");
	}
	++$thread['views'];

to this:

	// Increment the thread view.
	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'];

now it update my THREAD views! Toungue
Pages: 1 2