Journal

Copyright Tip

23 April 2006 › 19 comments

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.

Discussion + Dissension

  1. #1 Jon-Michael

    What Is Copyright Protection? has some information. If you modify or add content, or adjust the layout, etc. in the current year, you’re good. The proper way (supposedly) is “Copyright© Year Name.”

    Unrelated (aside from the txp:php tags), I almost always send a proper PHP header to eliminate the meta content type tag.

    header("content-type:text/html;charset=utf-8"); above your doctype

  2. #2 Dennis Bullock

    This is good information Nathan. I can now drop the ugly copyright badge I am using.

  3. #3 Nathan Smith

    Jon-Michael: Well, these code snippets are meant for inclusion inside other parts of a template, which would hopefully have the correct doctype already.

    Thanks for the tip though, because that could come in handy for future projects. As for this site, index.php would just be overwritten when I upgrade Textpattern. I have it in the XHTML, so I don’t need to worry about it later.

  4. #4 Mike Montgomery

    Nathan,
    The copyright notice is now optional, at least in all countries that have ratified the Berne Convention.

    The correct form includes three items:

    1. The word “copyright” or “copr.”, or the © symbol.
    2. The year of first publication of the copyrighted material to which the notice refers.
    3. The name of the copyright owner. This may be an individual’s full name or last name only, or a company or organization name (or a recognizable abbreviation).

    This third one causes some confusion for websites (and software programs, like Windows for example), which contain various chunks of material that were posted/published in different years. The usual solution is the “year1-year2” nomenclature.

    By the way, it is generally considered acceptable to change the order of these three items of a copyright notice, although it looks funny if the copyright word/symbol isn’t in the front.

    If the Microsoft and Apple websites only show the current year, they may be asserting that all content on their site is fresh.

    Reliable information is available from the U.S. Copyright Office. Wikipedia also has some copyright information.

    One note about the comments at WhatIsCopyright.org—the copyright is created when the work is created, but the notice date(s) correspond to first publication. So if you write/draw/design/photograph something, but post/publish it years later, then your copyright creation and publication/notice dates will be different.

    Also, I’m writing a copyright article for Godbit, so more info is on the way.

    The usual disclaimers apply: this is not legal advice, and does not create an attorney-client relationship; any legal situation is highly fact-dependent, etc.

  5. #5 Nathan Smith

    Mike: Thanks, I appreciate the clarification! For those of you who don’t know, Mike is a dangerous patent attorney by day, web design ninja by night.

  6. #6 Elliot Swan

    That’s pretty sweet, it does get annoying having to go back and fix copyright dates on old sites. But no more…

  7. #7 Clive Walker

    I’ve been using a JavaScript version of this but PHP is much better now that I think about it.

  8. #8 chris rhee

    Nice tip, Nathan. I actually use this PHP code on my sites: print date( “Y” );

    Cause short is sweet. Unless there’s something wrong with my code, haha.

  9. #9 Nathan Smith

    Chris: Actually, that is a better way to do it. It’s funny you mention it, because Nathan Logan had emailed me about it right before you did. I updated the files with the shortened version, though personally I prefer echo to print.

  10. #10 David Russell

    Was looking for and found this solution the other day as well. Weird that we were on the same path, for once… :) Pretty simple, but marvelously effective.

  11. #11 Jon

    A really good tip—it is something I found myself neglecting for nearly 6 weeks this past New Year. It is a very good idea to do, especially for client sites due to the fact that they are not likely to notice such a thing or know what to do in order to fix it had the year changed.

  12. #12 Jason Beaird

    I just made a similar post back in December entitled Happy New Date(Y). It’s definitely a handy thing to do for your own site or cleint sites that update their content on a regular basis. You can also write in the date with asp:
    response.write Year(Now())

    or with javascript:
    var today = new Date();
    document.write(today.getFullYear());

    ...if either of those float your boat.

  13. #13 Nathan Smith

    David: Great minds think alike, eh?

    Jon: That was exactly the situation I found myself in, needing a lazier way.

    Jason: Thanks for those methods too. I’m no ASP guy, so I welcome other ways of accomplishing the same thing. I’ll have to dig through your archives and check out that article you wrote in December.

  14. #14 Sean Fraser

    There’s a second reason for copyright maintenance. Perceived value. Studies have shown that new visitors are less likely to stay on a site that does not appear current, e.g., Copyright 2005.

  15. #15 Nathan Smith

    Sean: That’s a very good point. I am partial in that regard, specifically when looking up books on computer or programming related topics. If a technical text is out of date, chances are there is probably a new version of whatever language or product to which the book pertains. In such cases, I usually go find, research and purchase a book that is more up to date instead.

  16. #16 Mithrill

    Nice solution Nathan. This is like one of those why didn’t I think of that moments. Thanks for sharing.

  17. #17 Steve Dickinson

    Thanks for the tip Nathan.

    I’ve taken your idea and Mike’s info and stretched it a little to make a Textpattern plugin that generates the dates in the copyright message from the dates that the TXP articles were written/modified.

    Just in case anyone is interested you can try it out here.

  18. #18 Nathan Smith

    Mithrill: Yeah, I know what you mean. It’s such a simple and easy solution / fix that it really shouldn’t have taken me this long to write about it.

    Steve: Wow, that’s pretty cool that you made it into a plugin, right on. I’ve been wanting to look into writing TXP extensions, but haven’t had the time.

  19. #19 Ryan Heneise

    If you use Ruby on Rails, like me, there is also an easy way to print the current year:

    Copyright < %= Time.now.year % > My Pretty Website, Inc.

Comments closed after 2 weeks.

FYI


Member of 9rulesHosted by Mosso

Advertisement

Ads by SidebarAds

Fight Cancer

Pink October

Latest Posts: All - RSS