The Mac Observer

 
   
 
Displaying a year in a webpage
Posted: 14 October 2007 11:43 PM [ Ignore ]
Moderator
Avatar
Total Posts:  3821
Joined  2001-06-15

Although I’ve been maintaining a website for the last five-six years, I’m a web-designer boofhead.

I just noticed that the copyright line in the footer has a static year in it. There must be an easy-enough way to put the current year in there (javascript, probably). I’ve been googling and not come up with anything that’s less than about thirty lines of code, which I thought was over-egging the pudding.

Is there an easier way?

Ta,
L

 Signature 

Laurie Fleming - the singing geek

@LaurieFleming

Profile
 
 
Posted: 29 October 2007 07:18 PM [ Ignore ] [ # 1 ]
stars_5
Avatar
Total Posts:  1082
Joined  2007-02-07

deleted

I deleted this post, better code in another

 Signature 

“Works of art, in my opinion, are the only objects in the material universe to possess internal order, and that is why, though I don’t believe that only art matters, I do believe in Art for Art’s sake.” E. M. Forster

Profile
 
 
Posted: 30 October 2007 09:52 AM [ Ignore ] [ # 2 ]
stars_5
Avatar
Total Posts:  1082
Joined  2007-02-07

Another deleted

see the other post

 Signature 

“Works of art, in my opinion, are the only objects in the material universe to possess internal order, and that is why, though I don’t believe that only art matters, I do believe in Art for Art’s sake.” E. M. Forster

Profile
 
 
Posted: 30 October 2007 10:30 AM [ Ignore ] [ # 3 ]
stars_5
Avatar
Total Posts:  1082
Joined  2007-02-07

Got it, here is the script

Thanks to some guy name Guy at ttp://csscreator.com/node/4922

I modified his code to put a copyright notice + year on a single line. Copy the code below into the source code of your web page where you want the copyright notice to appear:

Copyright ©
  [removed]
var theDate=new Date()
[removed](theDate.getFullYear())
[removed]
    Laurie the Singing Geek, the Antipode, all rights reserved

Now Laurie I want to thank you. Yesterday afternoon I decided to kill my cable TV service and get back to basics, if not BASIC. So last night instead of watching premium channels on digital TV I started to surf the web for a direction. I saw Laurie’s post and decided that was something I could do. As I have said I am more of an artist than a tech/coder, but these days you need to be a bit of both.

 Signature 

“Works of art, in my opinion, are the only objects in the material universe to possess internal order, and that is why, though I don’t believe that only art matters, I do believe in Art for Art’s sake.” E. M. Forster

Profile
 
 
Posted: 30 October 2007 11:21 PM [ Ignore ] [ # 4 ]
Moderator
Avatar
Total Posts:  3821
Joined  2001-06-15

Thank you! I’m going to give it a go in the weekend.

As a point of clarification, I am not Laura, nor, by extension, a woman.

In countries outside the US, Laurie is predominantly a male name…

razz

 Signature 

Laurie Fleming - the singing geek

@LaurieFleming

Profile
 
 
Posted: 31 October 2007 04:25 AM [ Ignore ] [ # 5 ]
stars_5
Avatar
Total Posts:  1082
Joined  2007-02-07

[quote author=“LaurieF”]
As a point of clarification, I am not Laura, nor, by extension, a woman.

In countries outside the US, Laurie is predominantly a male name…

razz

Yes, I caught that yesterday and edited my posts, but I missed a few.

Notice how many people have viewed this thread, about 120.

 Signature 

“Works of art, in my opinion, are the only objects in the material universe to possess internal order, and that is why, though I don’t believe that only art matters, I do believe in Art for Art’s sake.” E. M. Forster

Profile
 
 
Posted: 03 November 2007 06:21 PM [ Ignore ] [ # 6 ]
Moderator
Avatar
Total Posts:  3821
Joined  2001-06-15

Excellent - thank you - even Tom Brown would begrudgingly have been impressed! razz

Here’s goes the code in effect: http://www.orpheuschoir.org.nz

Because I’m too cheap to shell out for any commercial software, I semi-hand-code it in NVU. For what I want to do, it works fine.

 Signature 

Laurie Fleming - the singing geek

@LaurieFleming

Profile
 
 
   
 
 

Apple Stock Quote (AAPL)

Loading...

Hot Topics

TMO Express

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday. Find out more!

Top Deals From DealBrothers.com

Recent Features

Support The Mac Observer

We noticed you may be running AdBlock on your computer. It takes real money to run this site and to deliver the news, tips, and opinions you love to read.

If you wish to block the ads that pay for the creation of our content, we ask that you instead support TMO Directly, either with a $5 monthly recurring contribution, or a one-time donation of any amount of your choice. Thanks!

Subscribe with Paypal Donate with Paypal