View Full Version : How to make automatical "NEW"-tags on website


Hurricane
Jul 15, 2002, 05:03 AM
I have a small (intranet) site which I update on a daily basis. The site contains links to various Excel,Word etc. files. Some of the files are updated daily, some weekly and some on an irregular basis. Now, instead of me having to remember to write "last updated xx.xx" after every link, I wonder if it is possible to have some script do it automatically?

For example a JavaScript code that checks for the file date, and if the file date is new enough the script would insert a "NEW" image beside the link.

Any suggestions? :)

Lostman
Jul 16, 2002, 10:58 AM
Check here, (http://webdeveloper.earthweb.com/webjs) or here (http://srd.yahoo.com/srst/85563220/Free+javascript/4/21/T=1026837745/F=4792bbe0fed0d0a347c55de5e63e3267/*)
or here (http://www.jsmadeeasy.com/) or here (http://srd.yahoo.com/srst/44873770/Free+javascript/5/21/T=1026837745/F=cc4838a0dee9cc24df6c0d75bc00cd03/*)
or here (http://www.webmonkey.com/programming/javascript/[/url). There's more out there but you get the point. Copy and paste my friend.

Hurricane
Jul 16, 2002, 10:55 PM
Thanks! Iīll check out those sites. :)

Hurricane
Jul 17, 2002, 01:17 AM
Originally posted by Lostman
Check here, (http://webdeveloper.earthweb.com/webjs) or here (http://srd.yahoo.com/srst/85563220/Free+javascript/4/21/T=1026837745/F=4792bbe0fed0d0a347c55de5e63e3267/*)
or here (http://www.jsmadeeasy.com/) or here (http://srd.yahoo.com/srst/44873770/Free+javascript/5/21/T=1026837745/F=cc4838a0dee9cc24df6c0d75bc00cd03/*)
or here (http://www.webmonkey.com/programming/javascript/[/url). There's more out there but you get the point. Copy and paste my friend.

Couldnīt get the Yahoo links to works. They just sent me to the start page. Anyway, I couldnīt find anything to solve my particular problem (I copied some other nice scripts, though). I guess JavaScript just canīt handle it. :(

Baso
Jul 18, 2002, 02:24 AM
You should be more specific about your problem.
On which platform do you run your intranet?
Do you have access to database?

Hurricane
Jul 18, 2002, 10:44 PM
The intranet is on a shared computer, so it is not on a web server or anything. No databases, either. Just simple HTML files accessible by everyone inside the company.

Baso
Jul 19, 2002, 02:24 AM
Huh, this tip is for MS related platforms, although the concept is the same on any platform.
U can access file information with FileSystemObject.

var fso = new ActiveXObject("Scripting.FileSystemObject");

U have info on the object in MSDN.

Now all u have to do is to create your links dynamically using data from fso.

If u can't find any patterns in your document creation then u have a problem.
Good luck.

Hurricane
Jul 19, 2002, 02:46 AM
Thanks, Iīll check it out. I havenīt done any ActiveX programming before, but it canīt be that hard, can it? :D

Iīll get back to you after the weekend. :)