MyBB Community Forums

Full Version: My forum post view count is zero, help me solve it please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Yikes! I didn't even spot the error logging settings. They were off. I just changed them to Log and Email, warnings and errors.

Mr. Friday. If you receive an email about an error, let someone here know.

Here is a thread where member found an old plugin interfered with thread views.
His solution was a core edit in showthread.php
https://community.mybb.com/thread-233262...69943.html

Essentially, if Delayed Thread Views is Off, then change shutdown_query function to query function.

In this instance, changing Delayed Thread Views to On does not appear to change the count. The task fares no better.
If a plugin is the cause then the fix should be made to the plugin, editing a core file to fix an issue with a plugin just adds an unnecessary maintenance burden. if shutdown functions aren't running it could be happening across the board so changing once instance isn't a proper fix. Once we know which plugin is causing the issue we can work out why and fix the root issue.
I really appreciate all your efforts sir.
May God bless you all.

For now, this case is beyond my control.
Thanks to @HLFadmin for his constant support.

I have granted you @HLFadmin access to my Cpanel to help me complete the troubleshooting process.

Thanks.

(2021-09-22, 07:43 PM)HLFadmin Wrote: [ -> ]I looked in a lot of places just to find any anomalies. The only one is the plugin problem where Upload Plugin does not permit access, and therefore makes it impossible to continue to evaluate.

It is not theme-related, at least that I can see. I created a new theme MyBBDefault based on the Master MyBB theme. No change in Views count.

I believe the problem is plugin related.

The process by which troubleshooting continues is to deactivate all the plugins from the plugin control panel, then activate them one by one to discover which one is at fault. This can only be done by you, assuming you have limited access to them.

If it is not possible to fix it this way, the next step is to investigate at the server level.

@Matt
We were both looking for the trouble at about the same time.
Yours and my conclusions were identical, yours was posted first. Smile

The double Back click problem may be a Firefox oddity.  That's the browser I use. Not tested with another. However, I did confirm the change in browser behavior several times in different iterations of disabling all plugins.

I really appreciate all your efforts sir. 
I am very sorry for replying to your feedback on time please. My system got spoilt since three days now. I just finished repairing it.

Thanks you all for your efforts once again.

I have granted you @HLFadmin access to my Cpanel, so  You can continue the troubleshooting steps sir. Thanks.
Problem solved. The plugin that interfered with the view count was Picture Perfect. It is listed in Extend as a developmental plugin, with a warning to not install on a live forum. After removing it, I looked at threads that had images in it, and they showed up as attached thumbnail images. The threads are viewable.


For the benefit of others who are trying to fix a problem caused by a plugin, here's what I did.
From File Manager in cPanel, I looked at the files in inc/plugins, then sort by date.
Remembering from previous investigation that the last date of thread or post that showed more than 0 views was 9/16 at 12:54, I observed the Picture Perfect plugin was installed at 12:59 on that date. Ah ha! Smile

However, not everyone has such a clue, so I did a full process of removing plugins manually. This was required since pluginuploader was installed and only permits superadmin access in MyBB.

First, I created a folder called holdthem in the plugins folder, then used cPanel's FileManager to move all *.php files to holdthem folder. This disables all plugins.
Second, I went to the forum and observed that clicking on a thread in a forum, then clicking back and refreshing the page incremented the view count showed it was working properly as expected.
Third, one-by-one I moved a plugin php file from holdthem folder back to the plugin folder, and verified forum still working as in step two.
Finally, when I moved the Picture Perfect file back to plugins and the view count did not increment, I verified the faulty plugin.

It is interesting that Picture Perfect on a fresh installation of 1.8.27 does not exhibit the view count problem. So there is an interaction somewhere in the system perhaps in conjunction with another plugin that could be the root cause. This would require much deeper troubleshooting that is beyond me at this time.

Thank you Mr. Friday for the trust you've shown me in granting access to your cPanel. I did not save the password, and I have deleted the PM which contained it.

In the process of enabling the plugins one-by-one, I confirmed that it is the MyAdvertisements plugin that is causing the double back-click necessary to go to the previous page. Again, not tested with a different browser, but evident in Firefox.
(2021-09-24, 04:34 PM)HLFadmin Wrote: [ -> ]Problem solved. The plugin that interfered with the view count was Picture Perfect. It is listed in Extend as a developmental plugin, with a warning to not install on a live forum. After removing it, I looked at threads that had images in it, and they showed up as attached thumbnail images. The threads are viewable.


For the benefit of others who are trying to fix a problem caused by a plugin, here's what I did.
From File Manager in cPanel, I looked at the files in inc/plugins, then sort by date.
Remembering from previous investigation that the last date of thread or post that showed more than 0 views was 9/16 at 12:54, I observed the Picture Perfect plugin was installed at 12:59 on that date. Ah ha! Smile

However, not everyone has such a clue, so I did a full process of removing plugins manually. This was required since pluginuploader was installed and only permits superadmin access in MyBB.

First, I created a folder called holdthem in the plugins folder, then used cPanel's FileManager to move all *.php files to holdthem folder. This disables all plugins.
Second, I went to the forum and observed that clicking on a thread in a forum, then clicking back and refreshing the page incremented the view count showed it was working properly as expected.
Third, one-by-one I moved a plugin php file from holdthem folder back to the plugin folder, and verified forum still working as in step two.
Finally, when I moved the Picture Perfect file back to plugins and the view count did not increment, I verified the faulty plugin.

It is interesting that Picture Perfect on a fresh installation of 1.8.27 does not exhibit the view count problem. So there is an interaction somewhere in the system perhaps in conjunction with another plugin that could be the root cause. This would require much deeper troubleshooting that is beyond me at this time.

Thank you Mr. Friday for the trust you've shown me in granting access to your cPanel. I did not save the password, and I have deleted the PM which contained it.

In the process of enabling the plugins one-by-one, I confirmed that it is the MyAdvertisements plugin that is causing the double back-click necessary to go to the previous page. Again, not tested with a different browser, but evident in Firefox.

Thank you very much. I don't know how to thank you enough. May God bless you beyond your expectation.

I have also confirmed that the problem is solved. I am really grateful. 

Thanks to every other administrators who have immensely contributed to this achievement. 

I will always remain loyal to this free software and all its administrators.

Bless you sir!!!
Hello.

I also face similar issue, a post's views don't get updated... sometimes they don't get updated not even when I visit them with a user account.... but i want them to increase even when accessed by guests.

Later edit:
I went to shohthread.php and discovered the incremental views code.
I've recplaced $db->shutdown_query with $db-query and now this works.

May i know why shutdown_query is not working?

Later edit 2:
Got to the bottom of it.
I've recently added a MyCode to parse HTML5 mp4 videos.
Apparently, that parser throws some silent errors regarding parsing the VID tag that I've created... and because it was setting a has_errors parameter in class_error.php, the function that executes all shutdown queries would not execute them... because it has a check for error_handler->has_errors

So I went to class_error.php at the line where the code sets has_errors to true and made a condition for the error message so that if it starts with "Parser output validation failed", to not set that has_errors flag.
Now counting views works.

P.S. This is the MyCode template who caused these errors:
<video height="720" width="1280" controls>
  <source src="$2" type="video/mp4">
  <object data="$2" height="720" width="1280">
    <param name="src" value="$2"></param>
    <param name="AutoPlay" value="true"></param>
    <param name="Controller" value="true"></param>
    <embed src="$2" height="720" width="1280"></embed>
  </object>
</video>
Pages: 1 2 3 4