2k11 staticpage date bug (win)

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

2k11 staticpage date bug (win)

Post by Timbalu » Mon Mar 25, 2013 6:30 pm

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

User avatar
Don Chambers
Regular
Posts: 3636
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: 2k11 staticpage date bug (win)

Post by Don Chambers » Mon Mar 25, 2013 10:32 pm

... and probably does not need with "@" for smarty 3.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: 2k11 staticpage date bug (win)

Post by Timbalu » Tue Mar 26, 2013 11:31 am

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

User avatar
Don Chambers
Regular
Posts: 3636
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: 2k11 staticpage date bug (win)

Post by Don Chambers » Tue Mar 26, 2013 7:07 pm

That's good to know.

User avatar
yellowled
Regular
Posts: 7072
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: 2k11 staticpage date bug (win)

Post by yellowled » Tue Mar 26, 2013 7:38 pm

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
amazon Wishlist - Serendipity-Podcast (German only, sorry)

Post Reply