Hi - I noticed recently that the view count wasn't incrementing properly on some threads. I did some research and to me it looks like this happens when the thread was originally posted by an anonymous user (not registered) and the person viewing the thread is also not logged in. Obviously, I have the "Registered Users Only" security setting set to "No", which allows for non-registered posters.
To me it looks like the "View" increment test is in the templates view.php file and looks like this:
| Code: |
if ($this_message->userid != $my->id) {
$database->setQuery("UPDATE #__fb_messages SET hits=hits+1 WHERE id=$thread AND parent=0");
$database->query();
}
|
In the case of unregistered poster ($this_message->userid=0) and an unregistered unregistered viewer ($my->id = 0), the if-condition fails and the count is not incremented. To correct this, I changed the if-condition to be:
| Code: |
if (($this_message->userid != $my->id) or ($this_message->userid == 0)) {
|
Can anyone confirm for me if this is a known bug, and perhaps fixed in one of the RCs?
Thanks,
Philip