Hold on... This isn't EnnuiDesign.com — What Gives?
It's been a long time coming, but Jason Lengstorf, formerly of Ennui Design, has expanded his team to include Drew Douglass, Rob MacKay, Henry Moran, and Tom Sturge.
It didn't feel right to keep the same name, so we decided to continue on as Copter Labs. You can expect the same great content under this new name!
Automate Your Copyright Notices
If you've built blogs for clients before, or created a site based on a content management system, then you know keeping copyright information up-to-date can be a pain.
It used to be that every year, I'd have to pull up every single client's site and edit the year, which would eat up a full day of my time. It was a terrible way to start the new year, and after a couple years of tedium, I decided to deal with it once and for all.
View the Demo | Download Source
Automatically Update the Year
My first instinct was to simply use PHP's handy date() and time() functions to automatically find the year. To get the current year, you can use this snippet of code:
This prints the current four-digit year. This technique wasn't enough, however. On websites, you need to keep the original year of the site's creation in order to cover the original content. So we need to have a range (i.e. 2006-2009).
Keep the Original Year Displayed
So we don't lose the original year, it would make sense to simply add the original posted year to the script, like so:
2006-
Now that looks great! However, what happens for new sites? We'll end up with a copyright notice for the first year that reads "All Content Copyright © 2009-2009 Company Name". This obviously isn't what we want.
Combine Both Ideas
To solve this issue, I wrote a quick function to check if the current year matches the creation year of the site, then outputs the copyright date appropriately.
$created) ? $created.'-'.$current : $current;
}
?>
All Content © Client Name
Hey presto! Now, for every site we create from this point forward, copyrightYear() will output the correct year or year range for your copyright notice, and you don't ever have to worry about it again!
View the Demo | Download Source
Moving Forward
Do you have any time-saving tips? How about time-consuming tasks you wish you could automate? Let me know in the comments!
Jason Lengstorf
Jason Lengstorf a turbogeek hailing from Portland, Oregon. He designs and develops websites using PHP, MySQL, JavaScript (jQuery), CSS, and HTML. He's written two books (PHP for Absolute Beginners [2009 Apress] and Pro PHP and jQuery [2010 Apress]), and he's written articles on development and design for Nettuts, CSS Tricks, and Smashing Magazine, among others.
Comments.
Hey, just wanted to say thanks for this. Little thing that will save loads of time. Very cool.
Amelia 1:19pm Feb 10, 2009 permalink | flag
Nice post! Definately will be using this on future projects
Brenelz 2:26pm Feb 10, 2009 permalink | flag
I'm not a lawyer, but I play one on T.V.
Wait, that's not right.
Oh yeah: I'm not a lawyer, but I did take a media law class as part of my college degree and we talked a lot about copyright law.
You said, "on websites, you need to keep the original year of the site's creation in order to cover the original content." But so far as I learned, that's not true. In fact, you don't even need to slap the copyright symbol on anything you create in order to copyright it.
Copyright law states that, as soon as you create something, you own the copyright. Build a website? You own the copyright. Snap a photo on your friend's camera? You own the copyright. Draw a little doodle on the back page of your in-flight magazine? You own the copyright. This comment I've written? I own the copyright and give you permission to publish it on your site. -)
Note that this only applies to things you create. You can't copyright an idea (that's what patents are for).
Thomas J. Brown 4:49pm Feb 18, 2009 permalink | flag
@Thomas J. Brown:
Hmmm...
I found conflicting information online, so I figured it's better to be safe and post the copyright just in case.
It's comforting to know that I'm not giving away content if I don't post a copyright notice on it, though.
Thanks for the heads up!
Jason Lengstorf 5:49pm Feb 18, 2009 permalink | flag
No problem.
And like I said, I'm not a lawyer, and it was just one class, so I could be wrong. Web stuff is... Tricky at best.
All that said, it's still a really good tutorial and I'll probably make use of it in the future.
Thomas J. Brown 6:03pm Feb 18, 2009 permalink | flag
Wellington 4:30am Sep 21, 2009 permalink | flag
Hi Jason,
Thanks for the script will try it on my website :)
Regards,
Janet Gify
Gify 4:49am Nov 11, 2009 permalink | flag
Get drafted second overall in a given draft and expect expectations to be through the roof.Fortunately, though, when you're drafted that high, the thinking is you can handle and overcome high expectations.Such is the case with Boston Bruins forward Tyler Seguin, a highly skilled 19-year-old who's looking to burst onto the NHL stardom scene in his sophomore season after a Stanley Cup-winning rookie campaign.
wholesale nfl jerseys 7:10pm Oct 14, 2011 permalink | flag
I like the valuable info you provide in your articles. I will bookmark your weblog and check again here regularly. I’m quite sure I’ll learn many new stuff right here! Best of luck for the next!
Onitsuka Tiger Asics 1:44am Oct 28, 2011 permalink | flag
Crooked a crooked silver skull head: "You mean, just kill the two guys to be able to eliminate the light of God's anger?"
ugg boots outlet 1:14am Nov 1, 2011 permalink | flag
Nice to be visiting your blog again Herve Leger, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article Herve Leger Dresses. Thanks, great share.
herve leger 8:58pm Nov 27, 2011 permalink | flag
And consumers are already feeling the impact, especially cooling food prices.
Mr. Xing, Consumer, said, "Pork is cheaper now. It was 14 yuan per kilogram, and now its 12 yuan."The titleist 910d2
titleist 910D3
Ping G20
Taylormade r11
Taylormade r11 Driver
titleist 910d2
titleist 910D3
Ping G20
Taylormade r11
titleist 910d2
titleist 910D3
Ping G20
Taylormade r11
titleist 910d2
titleist 910D3
Ping G20
Taylormade r11
Wilson Tennis Racket
Babolat Tennis Racket
Head Tennis Racket
Prince Tennis Racket
Wilson Blx
government has been strengthening measures to control inflation, which rose to uncomfortably-high levels earlier this year.Now efforts seem to have paid off.Shi Laibin, General Manager of Shandong Shouguang Produce Market, said, "Compared with last year, the general price has fallen about 30 percent. Cabbage prices are down 70 percent. And so are radishes, white turnips and carrots. "
titleist 910d2 5:36pm Dec 11, 2011 permalink | flag
This was a useful post and I think it is rather easy to see from the other comments as well that this post is well written and useful. Thank you very much.
Azelex azelaic acid 3:09am Feb 7, 2012 permalink | flag
wonderful post...
Buy Rogaine 4:09am Apr 27, 2012 permalink | flag
It's cool. How you can do that!
wholesale snapback hats 2:09am May 7, 2012 permalink | flag
ceng you de jing guo...
hollister uk 11:54pm May 9, 2012 permalink | flag
Join In.
Have something to say? By all means, speak up!
But first, a few rules:
Happy commenting!