Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: smd_lately: recently viewed site articles
It’s working now — not sure why. Maybe it needed time to pick up some hits using the /section/title system.
In any case, thanks for the great plug-in. It’s long been needed.
Mark
Offline
Re: smd_lately: recently viewed site articles
I’m using this to show popular articles, so far so good, but someone is constantly sending hits to one of my pages (looks like they’re trying to spam it through the comment form) and after a day or two this page shows up as the most popular. I’ve blocked 10 IP-addresses so far.
Is there an easy way to exclude empty referrers or have each IP only counted once? Otherwise I think I’ll just add the page to the filter array and never have it show up again on the list! :P
Offline
Re: smd_lately: recently viewed site articles
paperboy
Can you employ any of gocom’s plugins to try and combat this? For example rah_comment_spam, rah_ip_range or rah_unlog_me?
Not sure if smd_lately can do anything about logspam because it’s just counting what it sees and has no other built in intelligence. I could look into offering an empty referrer and/or IP count limiter though. Will see if it’s possible.
Last edited by Bloke (2009-08-22 01:09:56)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online
Re: smd_lately: recently viewed site articles
Empty referrer or IP count limiter would be nice if you plan on expanding the plug-in but I’ll manage with rah_unlog_me for now. :)
Offline
Re: smd_lately: recently viewed site articles
Is there a way of showing a count of how many times the article has been viewed?
it would be nice to display this if you were using sort=“popularity” with the plugin
Offline
Re: smd_lately: recently viewed site articles
simoin
Will v.013 do which introduces some useful replacement vars?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online
Re: smd_lately: recently viewed site articles
Thanks Bloke,
This is just what I was looking for!
Offline
Re: smd_lately: recently viewed site articles
Maybe it’s worth to add attribute for setting length of search? For ex. look in logs for 1 day. or 1 week, or 48 hours, or 86400 seconds? For simplicity it can handle only seconds :)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: smd_lately: recently viewed site articles
the_ghost wrote:
Maybe it’s worth to add attribute for setting length of search?
Great suggestion. Can’t believe I didn’t do it in the first place. For flexibility I’ll probably add a within attribute that allows you to limit the search to within the most recent N whatevers, and perhaps some way of specifying what “most recent” means. e.g. “show what’s new but only up to the end of the last whole month”. Thus it’d be within="1 month" to="01-?month-?year" — or something like that. Might add a from attribute as well, ‘cos that would allow for some cool paging features but I’d need to think it through.
For simplicity it can handle only seconds :)
If you want simplicity, you shouldn’t be using an smd_* plugin :oD
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online
Re: smd_lately: recently viewed site articles
I like within="1 month" :)
If you want simplicity, you shouldn’t be using an smd_* plugin :oD
I ment simplicity for you as author :)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: smd_lately: recently viewed site articles
New version released. Although it doesn’t have the_ghost’s suggestion built in yet (I forgot, oops) I’ve put a couple of new attributes in to help make the output better:
includeandexcludeallow you to filter which pages are shown based on full-match or a regex partial match with either the ip address, the host, the referer or the page URL. Useful for omitting your own clicksstatusallow you to only show articles that have certain status valuestimeallows you to only show articles in thefutureor thepast(orany, as it was before). It’s bizarre to think that a log entry could be in the future but consider the case where you have written a post for future publication. You click on it to preview it and it pops up in your logs. You might not want people knowing it’s there until it’s published, so limiting the time display to only past articles means you can preview future articles without anybody finding out
Please note if upgrading to v0.2 that the default behaviour has changed: the list is now limited to live articles published in the past. Give it a spin and let me know how it performs. I’ll try and remember to include the_ghost’s suggestion in the next version.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online
#27 2010-04-28 04:26:40
- sereal
- Member

- From: Indonesia
- Registered: 2010-02-18
- Posts: 55
Re: smd_lately: recently viewed site articles
hi Mr.Stef
I put your code like this one below but only works for a week then stop to work, its not displaying afterwards
<txp:smd_lately by=”“ wraptag=“ul” break=“li” class=“hotList” limit=“4” time=“past” status=“4”> <txp:permlink><txp:title /></txp:permlink> [{smd_lately_count}]<br /> <txp:posted /> oleh <txp:custom_field name=“Author” />
</txp:smd_lately>
any idea why this happen sir ? is there something wrong on my tags ?
kind regards
$(mydocument).notyetready(function() {});
dowebsitesneedtolookexactlythesameineverybrowser ?
Offline
Re: smd_lately: recently viewed site articles
sereal wrote:
only works for a week then stop to work, its not displaying afterwards
Nothing wrong with your tag. What is the setting of Logs expire after how many days? in your Advanced Prefs? If it’s set to 7 days, that’s probably the answer :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online
#29 2010-04-28 09:35:29
- sereal
- Member

- From: Indonesia
- Registered: 2010-02-18
- Posts: 55
Re: smd_lately: recently viewed site articles
yes it was set to 7 days , then
I try to change it to 1 day and still won’t display :(
should I clear the logs first ? or may be there is a good trick for this Sir ? I’d love to know
kind regards
Last edited by sereal (2010-04-28 09:36:42)
$(mydocument).notyetready(function() {});
dowebsitesneedtolookexactlythesameineverybrowser ?
Offline
Re: smd_lately: recently viewed site articles
sereal wrote:
I try to change it to 1 day and still won’t display :(
It won’t. You need to set it to a much longer time frame (say, 30 days or more?) Then, when your visitors start clicking on stuff the logs will be populated and smd_lately will start to do its job. The plugin only reads what is in the logs, so if they expire (i.e. old hits get deleted) after 7 days you’ll have no information for smd_lately to look at.
Remember, the plugin shows what your visitors have been clicking lately, not forever. You can increase the definition of ‘lately’ by setting your logs to expire less frequently :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Online