Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-27 15:50:26

bit
Archived Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

Plugin brainstorming: hit logging

(Mods: If I placed this in the wrong forum, feel free to move this appropriately.)

I recently came across the problem of having to list the most popular (most visited) articles on a TxP site. While jas_popular_articles is pretty good for just listing them, I have two issues with this plugin’s approach:

(Disclaimer: Nothing personal against the author of the said plugin. This is just a case of needing the right tool for the right job.)

  1. First it doesn’t support forms and a lot of other nifty things you could put into the form of attributes. Obviously I could just hack the plugin itself and offer a solution but then I go on to my next problem…
  2. It uses the Textpattern logs. No, it’s not a problem of the plugin as much as it is a problem with TxP hit logging. TxP logs hits by saving the URL requested and not the actual page visited. While it’s true that we can just test the 5 possible URL formats (messy, /id/title, /section/id/title, etc) of an article against the logs, wouldn’t it be better if the log would record the article itself?

I’m still thinking this through. I’m thinking that I’d either have to add a “hits” field to the textpattern table or create a whole new table for article hits. Then I’d create a replacement for <txp:article /> that would increment the hit-count of the article when accessed.

Am I overanalyzing? TooMuchMagic? Should I just use jas_popular_articles and hack it to my needs (and return my mods to the community)? Or am I actually thinking like a sane man and just do this?

Would anyone find this helpful? Any comments or suggestions?
I’d appreciate your feedback. :-)

Last edited by bit (2006-07-27 15:53:39)


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

Board footer

Powered by FluxBB