Miscellaneous Hacks - JavaScript: Copyright Year Generation
Just because a bunch of people wanted me to release this. Here's a little JavaScript I wrote that you can place in your copyright statement to keep your year up to date. Just put it where you want the year to display:
<script type="text/javascript">
d = new Date();
y = d.getFullYear();
document.write(y);
</script>
OR
<script type="text/javascript">d = new Date();y = d.getFullYear();document.write(y);</script>
They both do the same thing, one's just on a single line. :)
A JS file attached just in case you want to keep it as a back up.
Thanks to Gasper for reminding me to put in the text/javascript tag. :)
Also, this works with any version of vBulletin (or should) and can be seen on vB.org.
*clicks install*
teehee
Thanks!
Thankyou:up:
Well, since we are using it here, id better click install. :)
Installed. ;)
Simple hack, but very useful.
ahh here it was, ;) installed ofc.
Well, since we are using it here, id better click install. :)
I was actually quite surprised that you used it. :) I'm sure you could have whipped that up quite faster than me (it sadly took me like 5 minutes as my first code failed (document.write(Date.getFullYear()) ;)).
Thanks dude, installed :D
Thanks. :D
I was actually quite surprised that you used it. :) I'm sure you could have whipped that up quite faster than me (it sadly took me like 5 minutes as my first code failed (document.write(Date.getFullYear()) ;)).
nearly there, this would have worked.
document.write((new Date()).getFullYear());
nearly there, this would have worked.
document.write((new Date()).getFullYear());
Gah. I'm new to JavaScript. And I have to say, it's very low skill. But that totally makes sense. :D
Good job here mate. Javascript reminds me of unreal code in games - a mess to understand at the best of times, but very useful too. Compliments PHP nicely.
Good job here mate. Javascript reminds me of unreal code in games - a mess to understand at the best of times, but very useful too. Compliments PHP nicely.
I am still learning. I got a book but half the time, it's just bad. ;)