No More Copyright Updates

Many of the sites I do are php only which offers many advantages. One is the copyright notice can be updated programmatically instead of manually. Here is the snippet of PHP code I use (the define is put into a config file):

define(STARTCOPYRIGHTDATE, "2009");
$thisyear = date("Y");    // YYYY
if(0 == strcmp($thisyear, STARTCOPYRIGHTDATE))
    $gcopyrightdate = $thisyear;
else
    $gcopyrightdate = STARTCOPYRIGHTDATE . '-' . $thisyear;

If the site uses html files, there are a few ways to do this. One is to use a server side include file. The include file has to be manually changed then uploaded to the server. Once there, all files using it are up-to-date. This is nice because every file on the website does not have to be updated.

The last way I mention is to use an include file or, if you have a template, put the copyright notice in it. The drawback is every file will have to be uploaded to the server.

Doug

Bookmark and Share
This entry was posted in Web Site. Bookmark the permalink.

Leave a Reply