Only count registered users in page views/downloads
Virtual Research Environment / On-line Bibliography Manager
Brought to you by:
sirfragalot
Have an option that only registered users are counted in the page view and the downloads counter, but anonymous views are ignored and not recorded in the database.
This is because anonymous users are often search robots and such, so one might not want to count these.
Hi again,
here is a quick fix so that only page views from registered users are counted. I don't really suggest that this is included in the code, as it would be better to have an administrator option to enable/disable this, but I want to share this in case somebody else needs this.
Here are the changes. In modules/resources/RESOURCEVIEW.php, add the following at the beginning of the function updateAccesses():
This will stop page updates for non-registered users.
To stop the update counter for downloads too, change the following in modules/attachments/ATTACHMENTS.php, at the end of the function downloadAttachment(). Change this line:
to the following
Cheers
Stephan