Your Ad Here

Dynamic copyright

Brad Feld wants to know if you’ve updated your copyright dates and suggests you put them in an include for update-once ease.

Most sites I’ve built take this a step further — the dates are dynamic. Copyright dates are often a range, and of course the first date doesn’t change. But the last date is always current with a dynamic copyright.

In Movable Type, you can use this…

&copy; 1996 - <MTDate format="%Y">

In PHP…

echo '&copy; 1996 - ' . date('Y');

And in Smarty…

&copy; 1996 - {$smarty.now|date_format:"%Y"}

Dave Kaufman - Techlife
January 1, 2007 1:57 PM

Interesting and useful…now the dumb question.…

in HTML? or if your Apache webserver has PHP and the page is .html can you use the PHP?

Adam Kalsey
January 1, 2007 2:01 PM

Only if your web server is set up to process .html pages as PHP. If you’re using Apache, adding the following to your .htaccess file should do the trick (assuming that PHP is already set up on your server)…

AddType application/x-httpd-php .html

But don’t do this lightly. There’s performance and server load considerations to think about. This means that every .html page on your server will be processed for PHP, regardless of whether you actually put any PHP code in there.

Viv
January 21, 2007 11:37 AM

Very helpful notes on Apache and .htaccess…thanks Adam.

Viv


Your comments:

Text only, no HTML. URLs will automatically be converted to links. Your email address is required, but it will not be displayed on the site.

Name:

Email: (not displayed)

If you don't feel comfortable giving me your real email address, don't expect me to feel comfortable publishing your comment.

Website (optional):

Lijit Search

Best Of

Recently Read

Get More

Subscribe | Archives

Recently

Sprout Test (May 7)
A test post for Sprout widgets.
Product Leadership (May 3)
An anthology of product leadership writing.
Fighting Monster patent claims (Apr 16)
The patent bully picked on the wrong little guy.
Peavy's pine tar (Apr 6)
Jake Peavy's cheating
Bush and Morgan on inner city baseball (Mar 30)
Morgan and Bush discuss the role of baseball in the inner cities.
Not a fork (Mar 27)
We have no intention of forking Drupal. That would be nuts. So what are we doing then?
Eating our dogfood in the sausage factory (Mar 26)
Recursive development for the new Drupal powered community platform.

Subscribe to this site's feed.

Elsewhere

Feed Crier
Get alerted by IM when your favorite web sites and feeds are updated.
SacStarts
The Sacramento technology startup community.
Pinewood Freak
Pinewood Derby tips and tricks
Del.icio.us
My tagstream at del.icio.us.
Waddlespot
My son's Club Penguin community. News, blogs, tips, and tricks.

Contact

Adam Kalsey

Mobile: 916.600.2497

Email: adam AT kalsey.com

AIM or Skype: akalsey

Resume

PGP Key

©1999-2008 Adam Kalsey.
Content management by Movable Type.