Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-25 20:55:43

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

alternatives to sed_copyright_date

I’ve been using sed_copyright_date for so long I stopped noticing it, but it doesn’t seem to have survived the move to 4.2.0

<txp:sed_copyright_date date_type='end' end_year='now'/></b> -> <b> Textpattern Warning: tag does not exist on line 1120</b>

I only ever used it to output the current year, so I guess a lick of php would probably cover it. Does anyone know how to do it?

cheers
Stu

Offline

#2 2009-09-25 21:06:48

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: alternatives to sed_copyright_date

pieman wrote:

I only ever used it to output the current year, so I guess a lick of php would probably cover it

Current year:

<txp:php>
	echo safe_strftime('%Y');
</txp:php>

Offline

#3 2009-09-25 21:07:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,454
Website GitHub

Re: alternatives to sed_copyright_date

pieman wrote:

I’ve been using sed_copyright_date for so long I stopped noticing it, but it doesn’t seem to have survived the move to 4.2.0

Weird, works on my 4.2.0 site. Both the sed_copyright_date and sed_copyright tags. But either way the PHP equivalent is:

<txp:php>
echo date("Y");
</txp:php>

EDIT: and of course Gocom’s faster and more accurate because he owns the space-time continuum

Last edited by Bloke (2009-09-25 21:09:09)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2009-09-25 21:08:25

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: alternatives to sed_copyright_date

blimey, that was quick!

much appreciated :)

Offline

Board footer

Powered by FluxBB