Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
simple php question
I’m trying to figure out how to do the following
if
YEAR(Posted) = YEAR(NOW();
echo YEAR(Posted);
else
echo YEAR(Posted) to YEAR(NOW();
can someone help me with it?
Last edited by colak (2007-05-25 07:28:13)
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: simple php question
<txp:php>
global $thisarticle;
if(date('Y', $thisarticle['posted']) == date('Y')) {
echo date('Y', $thisarticle['posted']);
} else{
echo date('Y', $thisarticle['posted']).' to '.date('Y');
}
</txp:php>
HTH…
Offline
Re: simple php question
Robert..
Works like a charm
thanks!
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Pages: 1