Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2009-09-11 13:52:36

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,456
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#22 2009-09-13 00:39:01

simoin
Member
From: Ireland
Registered: 2009-02-10
Posts: 50
Website

Re: smd_lately: recently viewed site articles

Thanks Bloke,
This is just what I was looking for!

Offline

#23 2009-09-13 08:21:58

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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

#24 2009-09-13 15:05:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,456
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#25 2009-09-13 18:32:45

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

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

#26 2010-02-19 20:54:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,456
Website

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:

  • include and exclude allow 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 clicks
  • status allow you to only show articles that have certain status values
  • time allows you to only show articles in the future or the past (or any, 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.

Txp Builders – finely-crafted code, design and Txp

Offline

#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

#28 2010-04-28 08:06:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,456
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#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

#30 2010-04-28 09:47:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,456
Website

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.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB