Tech ARP Forums

Go Back   Tech ARP Forums > Others > Team ARP .blog > Dashken
Register
FAQ Members List Calendar Arcade Mark Forums Read

Google Web www.techarp.com forums.techarp.com

Reply
 
LinkBack Thread Tools
Old 24th Mar 2007, 05:59 PM   #1 (permalink)
Administrator!
 
Dashken's Avatar
 
Join Date: 21 Apr 2003
Location: Penang
Posts: 29,541
Reputation: 2162
Dashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond repute
Rep Power: 56
Default Automatic Copyright Year Update

And err... any rude comments on my coding skills will be deleted. Posted this sometime ago on Dashken's I-Blog.
Quote:
I've been playing with the copyright year that you can see at the bottom of this page so that I don't have to change it every year. First, I tried googling for this automatic copyright year update and found quite a few but not quite what I'm looking for. Most of them only change the year and not from the original year to the latest year which defeats the purpose when a site has been online for a couple of years.

I tried a few PHP ones but can't seem to get it to work with the Serendipity index.tpl. Well, I'm a noob in programming so you can't really blame me. But I do blame myself for taking my sweet time when I was studying my IT degree. That's one of my many regrets.

Finally, I found a JavaScript one but still, it only prints out the current year. So, I decided to modify it since it looks quite straight forward. After fine-tuning the code for a couple of minutes, I finally got what I want. Woohoo!

I love programming but lazy to relearn after a couple of years in hibernation. Maybe this is how I should pick it up again, bit by bit. Do you know that I bought a VB.net book for RM200 ($50) 1/2 year ago but haven't even make it to Page 2? That's a lazy bum for you.

If you look at the bottom of this page, you can see the copyright line "Copyright © 2007 Dashken's I-Blog • All Rights Reserved." which is generated by the code below.


To generate the year so that it automatically change itself upon a new year, this is basically the code.


I don't know if my explaination is correct but this is what I understand. I haven't touch JAVA in 4 years already. LMAO!

First, I declare today as a new variable which takes the Date value. From there I declare thisyear to take on the current date year, which is 2007. Then I use the if argument to print 2007 if the current year is 2007. If it's not 2007, then it will print 2007-currentyear. It's as simple as that.

To check if it works, I tested it by changing the year to 2006 so that it will print out 2006-2007. haha... and it did.

Feel free to use this code snippet. Just change the three '2007' in the code to any year you want on your website. And if you are new to this... the & copy; in the full code above is actually for the copyright symbol.

That's all, easy ain't it?

Before I forget, here's the link to the code. Copyrightdate.zip (clean, NO virus)

Happy coding!
__________________
| Intel Core 2 Duo E6850 @ 3.2Ghz | ASUS P5B-E Plus | G.SKILL 2x1GB DDR2 800 | 6 HDDs (2TB+ only ) | NVIDIA GeForce 7600GT | Dell E248WFP 24" Widescreen |


Blog : Dashken's I-Blog
Gallery : Dashken's I-Paintings

Last edited by Dashken : 26th Mar 2007 at 09:12 AM.
Dashken is offline   Reply With Quote
SPONSOR
Old 25th Mar 2007, 02:29 AM   #2 (permalink)
zy
Dead
 
zy's Avatar
 
Join Date: 16 Dec 2002
Location: Penang,Malaysia - Buffalo,New York
Posts: 12,798
Reputation: 1998
zy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant future
Rep Power: 37
Default

its JavaScript .. not JAVA
__________________
current:
P4-3.2|P4P800-Deluxe|512x4-DDR|NV6600
WD2500KS|WD5000AAKS|AD-7191A|1860NX|Z2300|MP470

home (malaysia):
P4C-2.6@3.1-StockHSF|AI7|256x2-BT-D43|512x2-DT-D43|A9600XT-VIVO
WD1200JB|2xWD2500KS|DRU-800A|DVD-E616P|LTR-52327S|152x|V.S.4121|iP1500

laptop:
M1210|T7200|2GBDDR667|160GB5K160|GO7400
zy is offline   Reply With Quote
Old 25th Mar 2007, 05:13 PM   #3 (permalink)
Administrator!
 
Dashken's Avatar
 
Join Date: 21 Apr 2003
Location: Penang
Posts: 29,541
Reputation: 2162
Dashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond repute
Rep Power: 56
Default

OOps... about the same la dude... vbscript and vb also about the same what... just minus a few things nia..

And pls don't remind me about JAVA... I hate it since uni times.
__________________
| Intel Core 2 Duo E6850 @ 3.2Ghz | ASUS P5B-E Plus | G.SKILL 2x1GB DDR2 800 | 6 HDDs (2TB+ only ) | NVIDIA GeForce 7600GT | Dell E248WFP 24" Widescreen |


Blog : Dashken's I-Blog
Gallery : Dashken's I-Paintings

Last edited by Dashken : 25th Mar 2007 at 05:18 PM.
Dashken is offline   Reply With Quote
Old 26th Mar 2007, 03:05 AM   #4 (permalink)
zy
Dead
 
zy's Avatar
 
Join Date: 16 Dec 2002
Location: Penang,Malaysia - Buffalo,New York
Posts: 12,798
Reputation: 1998
zy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant futurezy has a brilliant future
Rep Power: 37
Default

to me its different
__________________
current:
P4-3.2|P4P800-Deluxe|512x4-DDR|NV6600
WD2500KS|WD5000AAKS|AD-7191A|1860NX|Z2300|MP470

home (malaysia):
P4C-2.6@3.1-StockHSF|AI7|256x2-BT-D43|512x2-DT-D43|A9600XT-VIVO
WD1200JB|2xWD2500KS|DRU-800A|DVD-E616P|LTR-52327S|152x|V.S.4121|iP1500

laptop:
M1210|T7200|2GBDDR667|160GB5K160|GO7400
zy is offline   Reply With Quote
Old 26th Mar 2007, 07:53 AM   #5 (permalink)
shutdown -h now
 
hyper_raider's Avatar
 
Join Date: 15 Aug 2003
Location: in front of my pc
Posts: 6,001
Reputation: 1078
hyper_raider has much to be proud ofhyper_raider has much to be proud ofhyper_raider has much to be proud ofhyper_raider has much to be proud ofhyper_raider has much to be proud ofhyper_raider has much to be proud ofhyper_raider has much to be proud ofhyper_raider has much to be proud of
Rep Power: 22
Default

No javascript is totally different from java, it is not the same thing at all.

The whole syntax is different and its not even java to begin with
__________________
"God does not play dice with the universe."
- Albert Einstein (1879-1955)
http://edward-lim.blogspot.com
hyper_raider is offline   Reply With Quote
Old 26th Mar 2007, 09:11 AM   #6 (permalink)
Administrator!
 
Dashken's Avatar
 
Join Date: 21 Apr 2003
Location: Penang
Posts: 29,541
Reputation: 2162
Dashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond repute
Rep Power: 56
Default

Aiyo... let's forget the whole Java vs Javascript thing. I know Java is by SUN Microsystems and Javascript is by Netscape. Both usage is different, bla bla bla... satisfied or not?

And I just edited Java to Javascript.
__________________
| Intel Core 2 Duo E6850 @ 3.2Ghz | ASUS P5B-E Plus | G.SKILL 2x1GB DDR2 800 | 6 HDDs (2TB+ only ) | NVIDIA GeForce 7600GT | Dell E248WFP 24" Widescreen |


Blog : Dashken's I-Blog
Gallery : Dashken's I-Paintings
Dashken is offline   Reply With Quote
Old 26th Mar 2007, 09:13 AM   #7 (permalink)
h@x!
 
Max_87's Avatar
 
Join Date: 11 Aug 2003
Location: Sarawak, Malaysia.
Posts: 10,997
Reputation: 1809
Max_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant futureMax_87 has a brilliant future
Rep Power: 34
Default

not yet satisfied

jk jk
__________________


Max_87
Tech ARP
http://www.techarp.com

Intel E8400 @ 4.2GHz / Abit IP35 Pro / G.Skill F2-8000CL5-4GBPQ / Radeon X1800 / Seagate 7200.9 120GB / 7200.10 320GBx2 / WD5000AAKS / Silverstone ST56F
Max_87 is offline   Reply With Quote
Old 26th Mar 2007, 09:16 AM   #8 (permalink)
Administrator!
 
Dashken's Avatar
 
Join Date: 21 Apr 2003
Location: Penang
Posts: 29,541
Reputation: 2162
Dashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond reputeDashken has a reputation beyond repute
Rep Power: 56
Default

Syntax may be different. But programming structures and concepts are similar... I was wrong to say that both are the same.

KNN... don't want to post adi...
__________________
| Intel Core 2 Duo E6850 @ 3.2Ghz | ASUS P5B-E Plus | G.SKILL 2x1GB DDR2 800 | 6 HDDs (2TB+ only ) | NVIDIA GeForce 7600GT | Dell E248WFP 24" Widescreen |


Blog : Dashken's I-Blog
Gallery : Dashken's I-Paintings
Dashken is offline   Reply With Quote
Old 26th Mar 2007, 10:26 AM   #9 (permalink)
I Lurrrve Panda Biscuit!
 
strawroot's Avatar
 
Join Date: 3 Jul 2006
Location: sitting next to da almighty boss
Posts: 2,304
Reputation: 1886
strawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant futurestrawroot has a brilliant future
Rep Power: 23
Default

i hate java
__________________
You know you're really trailer trash when... You think Genitalia is an Italian airline.
strawroot is offline   Reply With Quote
Old 26th Mar 2007, 11:54 AM   #10 (permalink)
"Little" Devil
 
PsYkHoTiK's Avatar
 
Join Date: 8 Apr 2004
Location: On the "throne"
Posts: 14,165
Reputation: 3858
PsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond reputePsYkHoTiK has a reputation beyond repute
Rep Power: 57
Default

LOL Dashken! I laughed so much it hurt (coz I have a supper full stomach right now.)
__________________
Intel SLAPL 4.3GHz @ 1.35v *WIP* : 2x2GB OCZ Platinum DDR2 1066 : Asus P5K Premium : WD Raptor X : G92 8800GTS 512mb *stock* : XFi Platinum : Silverstone OP650 : Silverstone TJ-07 : Vista Ultimate Edition : Dtek FuZion CPU : Swiftech MCW60 : MCP655 : Thermochill PA120.3 w Scythe Ultra Kaze : Tygon R3603 1/2" ID 3/4" OD
CPU-Z: SLAPL : SLA9U : FX-55 : DDR 600 : VX
www.techarp.com
PsYkHoTiK is online now   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zodiac for year of dog angel1011 Lounge 3 31st Jan 2006 07:25 PM
2005 Fortune Forecast Adrian Wong Lounge 28 15th Feb 2005 12:39 PM


All times are GMT +8. The time now is 08:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 1998-2007 Tech ARP. All rights reserved.