Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: smd_lately: recently viewed site articles
A nice extra with this addition: by using exclude="method:GET" I get a nice list of spam victim articles, off course mixed with normal articles high in comments.
Last edited by kees-b (2014-03-14 11:20:44)
Offline
Re: smd_lately: recently viewed site articles
I’ve got smd_lately installed and working perfectly… it’s a site with a plurality of mobile users. Their IPs change frequently, so the visitor logs become a less than ideal way of keeping track of a users visited pages.
Cookies seem the likely way to keep track of mobile users. Could smd_lately be done using cookies instead of IP addresses?
Offline
Re: smd_lately: recently viewed site articles
towndock wrote #290122:
Could smd_lately be done using cookies instead of IP addresses?
Hmmm, that’s a good point about IPs. In the era of Tor and the like, it’s not ideal. Sadly, smd_lately only reads what’s in the visitor logs table and crunches that. It doesn’t do any tracking of its own. That’s not to say it couldn’t, but it would need one or two prefs adding and the associated admin UI, then some cookie code to replicate the sort of thing found in the visitor logs.
The plugin might be able to be retrofitted to allow the by attribute to read the cookie info, but the trouble is, to track historical information means the cookie data would grow and grow every visit. That’s probably untenable long term, I’m not sure what the size limits are and what, if anything, the performance would be like. Maybe a setting to limit the validity window (number of days, number of hits, etc) would work so it didn’t get too big.
Or some combination of using a cookie and a custom tracking table similar to the way analytics work.
tl;dr, I’m unsure if it’s doable in its current guise. Most options seem to indicate pretty much a new plugin needs to be written!
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
Offline
Re: smd_lately: recently viewed site articles
Bloke wrote #290124:
then some cookie code to replicate the sort of thing found in the visitor logs.
Found some code called Recently visited Page Links with jQuery and Cookies that could be a good basis.
While I could just use that, it needs some TXP plugin magic so one can display by section, etc.
Bloke, I’m open to shamelessly bribing you for the sake of God, country and the TXP world. How many beers do I need to email?
Offline
Re: smd_lately: recently viewed site articles
Hi,
I’m having the same problem as brunodario concerning the limit and section attributes. Tested on Mamp and online, the limit attribute doesn’t work correctly (limit="3" display only 2 articles and limit:="10" display 6 articles). And If I use the section attribute, nothing is displayed at all (of course there are some articles in the section).
I don’t understand what could be wong. I used the plugin with success for a previous project (with these attributes) but for now I can’t make it work. I’ve disable any other plugin but nothing better…
Maybe someone found how to solve this…?
My code (but the problem is elswhere I think):
<txp:smd_lately section='<txp:section />' show_current="0" limit="3" form="article_preview" sort="popularity" wraptag="ul" class="article-list" break="" by="" within="1 month" />
Last edited by NicolasGraph (2015-06-23 11:07:56)
Offline
Re: smd_lately: recently viewed site articles
NicolasGraph wrote #291862:
limit="3"display only 2 articles andlimit:="10"display 6 articles
Hmmm. Presumably you have more than limit articles that match your criteria in the visitor logs?
The section attribute will only work if your permlink structure has /section in it somewhere, but you’ve probably got that set. Without having access to the site it’s going to be difficult to diagnose. I kind of forgot to get to the bottom of brunodario’s issue, oops.
If you can’t figure it out, any chance I could have a login to your site please so I can poke around?
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
Offline
Re: smd_lately: recently viewed site articles
Bloke wrote #291864:
If you can’t figure it out, any chance I could have a login to your site please so I can poke around?
No problem, I clean everything and give you an access if I don’t find what is wrong soon. Thanks.
Offline
Re: smd_lately: recently viewed site articles
Ok, I can make the section attribute work online; don’t ask me how, it just happened…
…But, the problem is that the limit attribute doesn’t work correctly if the section attribute is not set. I tried on the previous project which is live and it is the same. I get one less article than the limit value if there is no section set.
Last edited by NicolasGraph (2015-06-23 14:04:32)
Offline
Re: smd_lately: recently viewed site articles
NicolasGraph wrote #291878:
Ok, I can make the
sectionattribute work online; don’t ask me how, it just happened…
Probably because your visitor logs filled up as you were using the site. The plugin only works off your visitor logs so if they’re relatively empty, you’ll get relatively few results, depending on your attribute settings.
I get one less article than the
limitvalue if there is nosectionset.
limit="11"? :-D
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
Offline
#100 2015-06-23 14:31:49
Re: smd_lately: recently viewed site articles
Bloke wrote #291880:
Probably because your visitor logs filled up as you were using the site. The plugin only works off your visitor logs so if they’re relatively empty, you’ll get relatively few results, depending on your attribute settings.
Yes, I don’t know why it doesn’t work with Mamp but you are probably right about the online site; I didn’t visit it last weeks and I have within="1 month" set…
Offline
#101 2017-04-20 21:55:14
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: smd_lately: recently viewed site articles
Updated txp 4.5.7 to txp 4.6.2 and
… <txp:smd_lately by=”“ limit=“4” section=“cars” > -> Textpattern Notice: unregistered_tag …
p.s.
when
Admin > Site > Production status > Debugging
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
#102 2017-04-20 22:21:18
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: smd_lately: recently viewed site articles
If you’re in a bold mood you can try to fix it by yourself (see the two links with “tag registering”. Not too complicated.) Or set your prefs to “Live”. Nothing bad will happen, except you can’t see other errors.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#103 2017-04-20 23:52:47
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: smd_lately: recently viewed site articles
Need to add
if (class_exists('\Textpattern\Tag\Registry')) {
Txp::get('\Textpattern\Tag\Registry')
->register('smd_lately')
;
}
uli, thanks!
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
#104 2018-09-03 10:15:43
Re: smd_lately: recently viewed site articles
smd_lately stopped working after an upgrade to TXP 4.7.1 because IP logging was dropped to make the logs GDPR compliant, which is good. I tried to use include=“page” in stead of the default “IP” but that doesn’t seem to work. Is there a way make it work again or another way to generate a ‘most read’ list as smd_lately did?
Kees
Offline
#105 2018-09-03 10:32:31
Re: smd_lately: recently viewed site articles
It’s not quite the same in that it doesn’t count unique visitors, but maybe this hint by NicolasGraph based on a prior tip by etc. helps. Basically it updates a timestamp in a custom field when an article is read and you can output your most recently read article using article_custom sorted by the custom_field with the timestamp.
TXP Builders – finely-crafted code, design and txp
Offline