Opened 7 years ago

# Support Hit and Visit Counters

Reported by: Owned by: rlrj60 Ryan J Ollos normal FiveStarVotePlugin normal 0.11

### Description

Just got some requests from several coworkers for Page Hit and Visit counters. So when hovering over the stars, a pop-up will display current vote and page hit/visit counts:

Current vote: 4 users voted for a total of 17.
Page hit count: 12345, Visit count: 112.


Is it possible to integrate VisitCounterMacro with this plugin? This way we don't need to modify the page.

### comment:1 in reply to:  description Changed 7 years ago by Ryan J Ollos

Is it possible to integrate VisitCounterMacro with this plugin? This way we don't need to modify the page.

It seems like a reasonable enhancement. We'd have to look at the license and should talk to the macro author, but if there are no hold-ups there, then the code could either be directly integrated, or we could extend the VisitCounterMacro to a plugin an API (assuming this hasn't already been done).

### comment:2 follow-up:  3 Changed 7 years ago by rlrj60

It's cold, raining and boring outside today so I play around with the plugin. Turned out it has almost everything there already. I just need to add one more "hit" counter to the table and we have the feature. Though, it requires a database upgrade which will DESTROY current vote information and start every counter at 0.

Basically, on every visit I increment the "hit" counter. This means sum of votes must qualify with "vote != 0" since non-voting user always has the default value of 0. Attached here is the patch. Please review and possible accept it as an enhancement.

### comment:3 in reply to:  2 Changed 4 years ago by Steffen Hoffmann

It's cold, raining and boring outside today so I play around with the plugin. Turned out it has almost everything there already. I just need to add one more "hit" counter to the table and we have the feature. Though, it requires a database upgrade which will DESTROY current vote information and start every counter at 0.

There are known-good ways to preserve information by using little more elaborated SQL foo, i.e. see [13079]. Still we'll review your patch for other valuable enhancements. Thanks for taking your time to contribute.

Basically, on every visit I increment the "hit" counter. This means sum of votes must qualify with "vote != 0" since non-voting user always has the default value of 0. Attached here is the patch. Please review and possible accept it as an enhancement.

Changing VisitCounterMacro into a plugin is what we should do, sure. I'm not sure, if/how it fits into current code if VotePlugin, that probably is a preview to the future of this plugin too.

### Modify Ticket

Change Properties