Auto updating copyright year

If your site has been online for a few years you would want a copyright that looked like this Copyright your site name 2004 - 2006This code will do this automatically and update each year saving you a bit of time and hassle This bit of code is mainly for new sites and you havent been online long enough to have a copyright date spanning two years, if your going to add it to a site that is already older than a year use this alternative.

(example uses site created in 2005)A few years and Joomla verision later on, this is still the simplest way to generate a self-updating date (year in this case) for a copyright info. Just wanted to add a way on how to include this PHP code in a module position instead of the template, it is using an extension named "Sourcerer" by No Number:

qh=YTox Ontp Oj A7czo5Oi Jzb3Vy Y2Vy ZXIi O30%3DThis extension will allow you to add the above mentioned PHP code (or any other code-language-etc.

I have been recently updating all my javascript to JQUERY (it is MUCH easier to use)... So many websites depend on it now for navigation, slideshows and even layout...

Here is a little bit of code that you can add to your new template.

Basically it takes the year you create your template, and if its still that year it shows it, if its not it shows the old year and then the new year.

So for exampl if you created your site this year you would want a copyright that looked something like Copyright your site name 2006.

Especially if no notice is required for copyright protection?

Having to assign a year to a copyright notice makes things rather confusing in online media.

For instance, In a blog or any other site where fresh content regularly appears, there typically is a date assigned to each item (at least in the metadata, if not displayed).

Most of my sites are PHP, so I just use echo date ("Y"). Give the span a unique and meaningful ID: In the sample above, the message will appear in the span with the ID="copy R". After that, you need to create the script that will generate the year, and then write it do the target span.

But there are sites that are older, or where my client does not want to use any server side scripting... Just put this script somewhere in your header: In case you didn't remember or know, © HTML for ©. You may be asking "what if the visitor to my site has disabled Javascript?

First identify where the message is to appear, and put a span there.

Finally, you will need to do something to call the Set Year() function. " I did address this on this article, but in reality, very few people disable Javascript.

Comments are closed.