Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-03-13 07:22:42

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

how to make article hits count to the public

hi to all,
i’m making a news website, I searched a lot to find any good plugins but didn’t find for these two things:
1. to show the article hits count to the visitors, like how many hits got each articles.
2. list all the most popular articles which got more hits

any one please help me.
thanks

Last edited by raminrahimi (2014-03-13 07:28:35)

Offline

#2 2014-03-13 08:04:07

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,171
Website GitHub Mastodon Twitter

Re: how to make article hits count to the public

smd_article_stats should be of help


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2014-03-13 08:36:51

raminrahimi
Member
From: India
Registered: 2013-03-19
Posts: 278

Re: how to make article hits count to the public

i checked that before, that count the words of an article. i need to show the article hits count,
like to see how many clicks got the current article.

Offline

#4 2014-03-13 08:54:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,776
Website GitHub

Re: how to make article hits count to the public

raminrahimi wrote #279710:

i need to show the article hits count

Unless someone comes up with something better, you can (ab)use smd_lately for this task, as long as you have Visitor Logs set to all hits:

Page view count in the last 30 days:
<txp:smd_lately
   by=""
   within="30 days"
   show_current="1"
   include='page::<txp:page_url />'
   limit="1">
      {smd_lately_count}
</txp:smd_lately>

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2014-03-13 09:12:03

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: how to make article hits count to the public

Hi

maybe this one: dzd_counter_view

I havent tested it for the last txp version but it should work.

Offline

#6 2014-03-13 10:19:44

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Re: how to make article hits count to the public

Bloke wrote #279712:

Unless someone comes up with something better, you can (ab)use smd_lately for this task, as long as you have Visitor Logs set to all hits:

We had a lot of problems with comment spam hits that did not succeed because they were filtered by Jukka’s comment spam plugin. These alternating GET/POST visitors, mostly originating from the Ukraine (!), were heavily polluting the logs. I don’t know if smd_lately has a routine to filter these from the logs? For now this made our most visited list completely unusable…

kees

Last edited by kees-b (2014-03-13 10:22:10)

Offline

#7 2014-03-13 10:47:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,776
Website GitHub

Re: how to make article hits count to the public

kees-b wrote #279715:

I don’t know if smd_lately has a routine to filter these from the logs?

It has the include and exclude attributes which you may be able to use to match domain names or filter out crap.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2014-03-13 10:51:20

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Re: how to make article hits count to the public

Bloke wrote #279718:

It has the include and exclude attributes which you may be able to use to match domain names or filter out crap.

Yeah, that’s what I did but the list of excluded objects was growing and growing…. It should also be a nice option to be able filter out all POST entrees. Is this possible?

Offline

#9 2014-03-13 11:31:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,776
Website GitHub

Re: how to make article hits count to the public

kees-b wrote #279719:

It should also be a nice option to be able filter out all POST entrees. Is this possible?

Not yet, but it’s trivial to add. I’ll release a new version tonight for you.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#10 2014-03-13 11:32:59

kees-b
Member
From: middelburg, nl
Registered: 2004-03-03
Posts: 235
Website

Re: how to make article hits count to the public

Bloke wrote #279721:

Not yet, but it’s trivial to add. I’ll release a new version tonight for you.

super!

Offline

#11 2014-03-13 13:14:30

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: how to make article hits count to the public

We highly encourage disabling Textpattern’s logging, tho; it’s resource hog and you are better off using other logging and storage method than our MySQL database, which truly neither offer anything special compared to raw request log files. Starting from 4.6.0, Textpattern will ship logging pre-disabled for new installations. The logs grow too fast, and the storage and log writing method causes issues on more busy sites.

I myself recommend using your web server to store and process hits, and then periodically update the database with new stats from there. If you have setup your server properly you are already most likely doing that for various other purposes; including security and defending yourself against attacks.

Offline

Board footer

Powered by FluxBB