Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#106 2018-09-03 11:12:05
Re: smd_lately: recently viewed site articles
jakob wrote #313783:
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_customsorted by the custom_field with the timestamp.
Thanks Jakob I’ll give that a try!
Offline
#107 2020-04-22 08:40:01
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_lately: recently viewed site articles
PHP version: 7.1.33
after upgrade TXP to 4.8, i get fatal error:
Fatal error: Uncaught Error: Call to undefined function find_temp_dir() in /www/apache/domains/www.varaleidja.ee/htdocs/textpattern/plugins/smd_lately/smd_lately.php:60 Stack trace: #0 [internal function]: smd_lately(Array, '\r\n<div class="a...') #1 /www/apache/domains/www.varaleidja.ee/htdocs/textpattern/vendors/Textpattern/Tag/Registry.php(141): call_user_func('smd_lately', Array, '\r\n<div class="a...') #2 /www/apache/domains/www.varaleidja.ee/htdocs/textpattern/lib/txplib_publish.php(541): Textpattern\Tag\Registry->process('smd_lately', Array, '\r\n<div class="a...') #3 /www/apache/domains/www.varaleidja.ee/htdocs/textpattern/lib/txplib_publish.php(447): processTags('smd_lately', 'limit="4" by="S...', '\r\n<div class="a...') #4 /www/apache/domains/www.varaleidja.ee/htdocs/textpattern/publish/taghandlers.php(4258): parse('\r\n\r\n<txp:articl...', true) #5 [internal function]: if_section(Array, '\r\n\r\n<txp:articl...') #6 /www/apache/domains/www.varaleidja.ee/htdocs/textpattern/vendors/Textpattern/Tag/Registry.php(141 in /www/apache/domains/www.varaleidja.ee/htdocs/textpattern/plugins/smd_lately/smd_lately.php on line 60
Offline
#108 2020-04-22 10:15:47
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_lately: recently viewed site articles
…or maybe it can be done with TXP native tags? i need most viewed articles functionality
Offline
#109 2020-04-22 10:31:01
Re: smd_lately: recently viewed site articles
I’ve fixed this bug on the github version. Can’t remember if I bundled up a release or not. But if not, I’ll do so later.
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
#110 2020-04-22 10:41:40
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_lately: recently viewed site articles
Bloke wrote #322669:
I’ve fixed this bug on the github version. Can’t remember if I bundled up a release or not. But if not, I’ll do so later.
sorry, bloke, but… how to install it?
Offline
#111 2020-04-22 12:32:38
Re: smd_lately: recently viewed site articles
That version on github isn’t installable as a .txt plugin yet. But you can copy the code (just the code, not the docs and header info) from the .php file and paste it over the one you have already. I’ll try and make a proper plugin out of it for you later.
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
#112 2020-04-22 13:00:41
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_lately: recently viewed site articles
Bloke wrote #322672:
That version on github isn’t installable as a .txt plugin yet. But you can copy the code (just the code, not the docs and header info) from the .php file and paste it over the one you have already.
from:
if (class_exists('\Textpattern\Tag\Registry')) {
Txp::get('\Textpattern\Tag\Registry')
->register('smd_lately');
}
to:
return ($out) ? doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class) : '';
}
correct?
code works now, but in debug mode i still get error:
...
</txp:smd_lately> -> Textpattern Notice: Unknown tag attribute: by while parsing form Ükski on page est_default
textpattern/lib/txplib_misc.php:1693 trigger_error()
textpattern/plugins/smd_lately/smd_lately.php:52 lAtts()
smd_lately()
textpattern/vendors/Textpattern/Tag/Registry.php:141 call_user_func()
textpattern/lib/txplib_publish.php:541 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:447 processTags()
textpattern/publish/taghandlers.php:4258 parse()
if_section()
textpattern/vendors/Textpattern/Tag/Registry.php:141 call_user_func()
textpattern/lib/txplib_publish.php:541 Textpattern\Tag\Registry->process()
Offline
#113 2020-04-22 13:12:30
Re: smd_lately: recently viewed site articles
Yes, that’s perfect. However, you will find that the by attribute has been removed. The reason is that Txp no longer tracks IP addresses in the txp_log table, so that feature had to be axed from the plugin too. Sorry.
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
#114 2020-04-22 13:19:58
Re: smd_lately: recently viewed site articles
And there you go, smd_lately v0.4.0 released.
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
#115 2020-04-24 11:28:24
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_lately: recently viewed site articles
Bloke wrote #322674:
Yes, that’s perfect. However, you will find that the
byattribute has been removed. The reason is that Txp no longer tracks IP addresses in the txp_log table, so that feature had to be axed from the plugin too. Sorry.
thank’s bloke!
but it still shows the most viewed articles (sort by popularity within certain time), correct?
Last edited by Gallex (2020-04-24 11:33:00)
Offline
#116 2020-04-24 11:36:14
Re: smd_lately: recently viewed site articles
Gallex wrote #322688:
it still shows the most viewed articles (sort by popularity within certain time), correct?
Yes, just aggregated for all visitors, not by an individual person any more.
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