Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#2 2006-12-31 04:06:13

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

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

#4 2006-12-31 15:41:58

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

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

#5 2006-12-31 16:14:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#6 2006-12-31 17:32:10

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

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

#7 2006-12-31 18:08:11

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#9 2006-12-31 19:16:05

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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

#10 2007-07-05 09:50:56

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

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

#11 2007-07-05 09:56:02

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

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

#12 2007-07-05 10:11:41

jauhari
Member
Registered: 2007-05-24
Posts: 97
Website

Re: Alternative for mrz_lastsidemod?

And how to format the results?

example made like this 12 July 2007 16:00

Thanks

Offline

Board footer

Powered by FluxBB