Warning: include() [function.include]: Unable to access /home/eliseb/public_html/includes/head.php in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 6

Warning: include(/home/eliseb/public_html/includes/head.php) [function.include]: failed to open stream: No such file or directory in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 6

Warning: include() [function.include]: Failed opening '/home/eliseb/public_html/includes/head.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 6

Warning: include() [function.include]: Unable to access /home/eliseb/public_html/includes/banner.php in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 9

Warning: include(/home/eliseb/public_html/includes/banner.php) [function.include]: failed to open stream: No such file or directory in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 9

Warning: include() [function.include]: Failed opening '/home/eliseb/public_html/includes/banner.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 9

Warning: include() [function.include]: Unable to access /home/eliseb/public_html/includes/mainmenu.php in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 10

Warning: include(/home/eliseb/public_html/includes/mainmenu.php) [function.include]: failed to open stream: No such file or directory in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 10

Warning: include() [function.include]: Failed opening '/home/eliseb/public_html/includes/mainmenu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 10

« Dynamic Comment Previewing | Main | Helping MT and Images Get Along Nicely »

Automatic Copyright Notice Year Update

Every year come January we have to start signing checks with a new date. One little site detail that often gets overlooked is the date on the copyright notice (if you have a copyright notice) for your blog. If your site is PHP friendly, you can replace the copyright date with a little php script that automatically puts in the correct year.

Replacing the date with <?php echo date('Y'); ?> will do the trick. For example, the copyright code for LMT is:

Copyright &copy; 2004-<?php echo date('Y'); ?>

There's probably a way to do this just with using MT tags. Anyone know how? If so, please let us know in the comments and I'll add it to this post.

Comments (4)

<MTDate format="%Y"> should work :)

Yes indeed, MTDate should work fine.

Just make sure you rebuild every page that uses it, or put it into a dynamically generated template, so it is built with PHP on demand, though caching may affect the date for a brief period.

If you use a footer and include that dynamically on your pages (via PHP or SSI), then this might be as simple as a single rebuild. If you have a footer on every page, it might mean rebuilding everything.

frank:

Just to say hi & thanks for the new tip. Hope that with this new year you'll post more often too!

cheers!

Stefaan:

Easiest? Use SSI includes, make your copyright statement a file fragment that can be pulled in with a simple <!--#include virtual="/path/to/copyright" -->

End of story :)

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)



Warning: include() [function.include]: Unable to access /home/eliseb/public_html/includes/sidebar.php in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 201

Warning: include(/home/eliseb/public_html/includes/sidebar.php) [function.include]: failed to open stream: No such file or directory in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 201

Warning: include() [function.include]: Failed opening '/home/eliseb/public_html/includes/sidebar.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 201

Warning: include() [function.include]: Unable to access /home/eliseb/public_html/includes/footer.php in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 202

Warning: include(/home/eliseb/public_html/includes/footer.php) [function.include]: failed to open stream: No such file or directory in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 202

Warning: include() [function.include]: Failed opening '/home/eliseb/public_html/includes/footer.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/www.learningmovabletype.com/archives/a/001584automatic_copyright_notice_year_update/index.php on line 202