doublesecretagency / craft-viewcount

View Count plugin for Craft CMS
Other
6 stars 4 forks source link

Filter viewcount on a period of time #7

Closed migswd closed 4 years ago

migswd commented 4 years ago

I would like to display my most viewed elements on the last X days / and on any period of time in the past...

Is it possible ?

The problem I want to solve is that the sorting of most viewed elements is not fair without the same period of time taken into account : the oldest elements have a great advantage on the last elements added into my library.

lindseydiloreto commented 4 years ago

Hi @migswd, sorry for the late response.

This can be done using the detailed view log...

https://www.doublesecretagency.com/plugins/view-count/docs/detailed-view-log

Be aware, some level of plugin development knowledge will be required to get the data you need. Also, the detailed view log will lead to a notably larger database. I'd recommend adding a cron job to truncate that table on a regular basis.

Hope that helps!