Page 1 of 1

display year in footer?

Posted: Fri Oct 29, 2010 8:48 am
by toolman
Hi,

I am trying to display a date in the footer. I have tried:

Copyright ©

but it doesn't work. Is there another date tag I can use?

Thanks.

Re: display year in footer?

Posted: Fri Oct 29, 2010 9:26 am
by MikeTroop74
I found this in the template I am using.

Make a new UDT and name it "custom_copyright"

Put this in the *Code area:

//set start to date your site was published
$startCopyRight='2010';

// check if start year is this year
if(date('Y') == $startCopyRight){
// it was, just print this year
    echo $startCopyRight;
}else{
// it wasnt, print startyear and this year delimited with a dash
    echo $startCopyRight.'-'. date('Y');
}

Now call the UDT in your template where you want the year to appear. This is how I am using it:

Copyright © {custom_copyright} Troop 74. All Rights Reserved.
Might not be exactly what you are looking for but hope that helps.