Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-12-31 00:41:44
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Alternative for mrz_lastsidemod?
Does anyone know of an alternative for mrz_lastsidemod, or how to modify it so it will work again? In 4.0.4 it just returns today’s date.
Offline
Re: Alternative for mrz_lastsidemod?
A dash of PHP suffices:
<txp:php>
global $prefs;
echo $prefs['lastmod'];
</txp:php>
If the default time representation doesn’t fit your needs, you could easily apply time formatting (see php.net for available conversion specifiers):
<txp:php>
global $prefs;
$format = '%Y-%m-%d'; // CHANGE THIS TO FIT YOUR NEEDS
echo safe_strftime($format, safe_strtotime($prefs['lastmod']));
</txp:php>
:)
Last edited by wet (2006-12-31 04:07:00)
Offline
#3 2006-12-31 13:19:10
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Alternative for mrz_lastsidemod?
Thanks wet! But it still returns today… (slaps forehead) of course it would, when I just put that on a page, wouldn’t it?
Last edited by els (2006-12-31 13:20:49)
Offline
Re: Alternative for mrz_lastsidemod?
The “last modification” date is updated whenever you:
- edit/publish an article, a link, a file, an image
- change a page template
- change a style sheet
- add/edit a section
- change a form
- receive/moderate a comment
Offline
Re: Alternative for mrz_lastsidemod?
is there a way to just grap the date of the latest post?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Alternative for mrz_lastsidemod?
<txp:php>
$format = '%Y-%m-%d %H:%M'; // CHANGE THIS TO FIT YOUR NEEDS
$latest = safe_field('unix_timestamp(max(Posted))', 'textpattern', '1');
echo safe_strftime($format, $latest);
</txp:php>
Happy New Year!
Offline
Re: Alternative for mrz_lastsidemod?
cooool!!!!!!! Happy new year wet, and to all txpjunkies out there
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#8 2006-12-31 18:10:22
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Alternative for mrz_lastsidemod?
colak wrote:
is there a way to just grap the date of the latest post?
Wouldn’t you be able to do this with <txp:article_custom limit="1" sort="Posted desc" form="posted" />
, and in form ‘posted’: <txp:posted />
?
Thanks again wet, and a happy new year to you and everyone else too!
Offline
Re: Alternative for mrz_lastsidemod?
Els wrote:
Wouldn’t you be able to do this with
<txp:article_custom limit="1" sort="Posted desc" form="posted" />
, and in form ‘posted’:<txp:posted />
?
dhaaa!!! The simplest things are so easily to be overseen.. thanks els. Happy new year to you…
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Alternative for mrz_lastsidemod?
wet wrote:
The “last modification” date is updated whenever you:
- edit/publish an article, a link, a file, an image
- change a page template
- change a style sheet
- add/edit a section
- change a form
- receive/moderate a comment
Show how to display last modification?
Please give me some guide to do this
Thanks
Last edited by jauhari (2007-07-05 09:51:50)
Offline
Re: Alternative for mrz_lastsidemod?
Use this code:
<txp:php>
global $prefs;
echo ($prefs['lastmod']);
</txp:php>
Last edited by wet (2007-07-05 09:56:27)
Offline
Re: Alternative for mrz_lastsidemod?
And how to format the results?
example made like this 12 July 2007 16:00
Thanks
Offline