Copyright tip

If you are like me, you probably tend to be knit-picky about details. You probably also hate going back to make small updates on projects that you have already finished. One of my least favorite things to do is updating the copyright year, usually found in the footer on most websites.

Well, I thought I would show you a little snippet that I have been adding to my projects as of late. It's just a bit of PHP that will output the current year according to the server's clock. By slapping an © symbol in front of it, your site constantly has a current copyright, and you can rest easy, never having to revisit that aspect of it again.

I have uploaded two example files, to keep the PHP from actually being parsed on this article page. One of them is for use in Textpattern, the other for use in WordPress or anything that takes raw PHP. Check 'em out here:

txp-copyright.txt | php-copyright.txt = © 2006 Your Name.

If you are using WordPress, it should just parse the PHP by default, if you put it in an include file. If you're using Textpattern, be sure check out Admin › Advanced Preferences, and make sure "Allow PHP on pages?" is set to yes:

advanced options

I'm no lawyer, so I'm not sure about the legality of everything. From what I can tell, Microsoft and Apple just have the current year in their copyrights, though I have seen it done in this fashion on other sites: © 1998-2006. At any rate, that's not a problem. Just add your beginning year and a dash, then you're in business. Hopefully this will help y'all save time in the future.