2k11 staticpage date bug (win)

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

2k11 staticpage date bug (win)

Post by Timbalu »

In plugin_staticpage.tpl on line 40, this

Code: Select all

{$staticpage_lastchange|date_format:$template_option.date_format}
needs to be changed to

Code: Select all

{$staticpage_lastchange|@formatTime:$template_option.date_format}
else you get a

Code: Select all

M�rz
A |date_format modifier is best used with :"%Y-%m-%d" only.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: 2k11 staticpage date bug (win)

Post by Don Chambers »

... and probably does not need with "@" for smarty 3.
=Don=
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: 2k11 staticpage date bug (win)

Post by Timbalu »

Well, YL used that all over, since the @ tells Smarty (2!) to pass the entire array to the modifier rather than calling the modifier for each element of the array (which leaves you to think about, if this assigned var (at the moment it is passed) is actually an array...). But as 2k11 is used with older S9y < Smarty3 environments too, I left the @ notation here.

The point I wanted to note, using the |formatTime modifier here is much better, since already switching "%e" with "%d" for WIN users, before passing the same to strftime(), which avoids this (..locale) "Bug".
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: 2k11 staticpage date bug (win)

Post by Don Chambers »

That's good to know.
=Don=
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: 2k11 staticpage date bug (win)

Post by yellowled »

You know, it would be much easier to just send a pull request on the 2k11 repo on GitHub, but never mind. Thanks for noticing.

YL
Post Reply