View Full Version : Adding Auto Update Copyright div using javascript?
bsmith
Oct-16-2009, 06:18 PM
Can this be done? Any thoughts?
~Brendan
SamirD
Oct-16-2009, 10:47 PM
Can this be done? Any thoughts?
~BrendanWhat do you mean by auto-update?
bsmith
Oct-16-2009, 11:32 PM
What do you mean by auto-update?
I have been looking online to see if there was any javascript code that can automatically update the copyright information (i.e. 2009 change to 2010) that can be incorporated into the smugmug customization. So far, I have found a bunch of javascript code independent of smugmug so i was just wondering...i've found code that looks something like this and other versions:
******** type='text/javascript'>
copyright=new Date();
update=copyright.getFullYear();
document.write("Copyright © 2001-"+ update + " (your company name) All rights reserved.");
// End -->
</********
SamirD
Oct-16-2009, 11:35 PM
I have been looking online to see if there was any javascript code that can automatically update the copyright information (i.e. 2009 change to 2010) that can be incorporated into the smugmug customization. So far, I have found a bunch of javascript code independent of smugmug so i was just wondering...i've found code that looks something like this and other versions:
******** type='text/javascript'>
copyright=new Date();
update=copyright.getFullYear();
document.write("Copyright © 2001-"+ update + " (your company name) All rights reserved.");
// End -->
</********You know, that's not a bad idea. I bet there's something in Javascript to pull the current date and then parse off the year. *searching*
SamirD
Oct-16-2009, 11:37 PM
That script should work. Try it!
bsmith
Oct-16-2009, 11:49 PM
That script should work. Try it!
where would i put the code? and HOW? I'm horrible w/ JavaScript.
SamirD
Oct-17-2009, 11:31 PM
Let's see...control panel-->Customize-->Advanced Site-wide Customization.
I've only got a static right click message, so this is a guess with the code you posted above. Place this in your "Top JavaScript" box:copyright=new Date();
update=copyright.getFullYear();
rightClickWarning = "Copyright © 2001-"+ update + " (your company name) All rights reserved."
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.