Modify

Opened 4 years ago

Last modified 20 months ago

#8434 new enhancement

Support Hit and Visit Counters

Reported by: rlrj60 Owned by: rjollos
Priority: normal Component: FiveStarVotePlugin
Severity: normal Keywords:
Cc: Trac Release: 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.

Attachments (1)

changeset_1698.diff (10.7 KB) - added by rlrj60 4 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 in reply to: ↑ description Changed 4 years ago by rjollos

Replying to rlrj60:

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).

See also #7615.

comment:2 follow-up: Changed 4 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.

Changed 4 years ago by rlrj60

comment:3 in reply to: ↑ 2 Changed 20 months ago by hasienda

Replying to 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.

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.

Add Comment

Modify Ticket

Action
as new The owner will remain rjollos.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.