Best of joomla gives you news, joomla templates, tutorials and websites about Joomla , FireBoard and FireMessage official page.
| No account yet?   |
The FireBoard forum component development is still going on. In order to get better, FireBoard will be moved from the Best of Joomla website.
During this transition period, the forum in Best of Joomla will be closed to new posts.
Welcome, Guest
Please Login or Register.    Lost Password?
FireBoard Manual Latest release discussions Download FireBoard
view count doesn't work for anonymous posts (1 viewing) (1) Guest
TOPIC: view count doesn't work for anonymous posts
#62239
view count doesn't work for anonymous posts 1 Month, 1 Week ago  
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
afalubi (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
Go to top