Gossamer Forum
Home : Products : DBMan : Customization :

How can we link in html What's New Mod

Quote Reply
How can we link in html What's New Mod
How can we link in html What's New Mod.

If I want it to be linked from an Html page.
What line should I put to replace
<a href="$db_script_link_url&Date-gt=$new&view_records=1">What's New</a> ?

Thank you in advance
Quote Reply
Re: How can we link in html What's New Mod In reply to
I did it using javascript to define the current date. The example below gives you all records that are greater than todays date. I'm not a javascript expert but it did work although it may give you problems in some browsers, I'm not sure. As for the $db_script_path just hard code that in your definition of the url variable. There are people here that know alot more about js than I do but this is one idea.

var date = new Date();

var d = date.getDate();

var day = (d < 10) ? '0' + d : d;

var m = date.getMonth() + 1;

var month = (m < 10) ? '0' + m : m;

var yy = date.getYear();

var year = (yy < 1000) ? yy + 1900 : y;



function makeArray() {

for (i = 0; i<makeArray.arguments.length; i++)

this[i + 1] = makeArray.arguments;

}



var months2 = new makeArray('Jan', 'Feb', 'Mar',

'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',

'Oct', 'Nov', 'Dec');



var date2 = new Date();

var day2 = date.getDate();

var month2 = date.getMonth() + 1;

var yy2 = date.getYear();

var year2 = (yy < 1000) ? yy + 1900 : y;
var url = "http://yourserver.com/cgi-bin/db/db.cgi?db=default&uid=default&view_records=1&Date=>"+ day + "-" + months2[month2] + "-" + year

<A HREF="javascript:window.location.href=url"> #this line is your link line

[This message has been edited by mike1 (edited July 07, 1999).]
Quote Reply
Re: How can we link in html What's New Mod In reply to
Hi

I don't know if this helps but I worked out how to get the curent date in the DBMan format using SSI - see http://www.gossamer-threads.com/...um5/HTML/001090.html

Chris
Quote Reply
Re: How can we link in html What's New Mod In reply to
This should work fine

Tank you very much again