You can't call it by a URL from a static web page, since there is no way to determine the current date on a static web page. Unless there's something in Java or something else that would do it.
Wait a minute. Maybe you can. You could, if you wanted, make a change to db.cgi that would do it automatically. Pardon me while I ponder this a bit first. (Ponder, ponder, ponder.)
Okay. I think I got it.
Open up db.cgi and find sub query.
After
local (%sortby);
add
Code:
if ($in{'today'}) {
$in{'Date'} = &get_date;
}
elsif ($in{'future'}) {
$in{'Date-lt'} = &get_date(time() + ($in{'future'} * 86400));
$in{'Date-gt'} = &get_date(time() - 86400);
}
The last line of the code above makes sure that you don't get events that are outdated. If you don't want it to show today's events, change it to
Code:
$in{'Date-gt'} = &get_date;
A little further down in sub query, you'll need to fix a bug in the script. (unless you recently downloaded DBMan. Alex may have fixed it.)
Look for
Code:
if ($in{"$column-gt"} !~ /^\s*$/) { ($db_sort{$column} eq 'date') and
(&date_to_unix($in{$column}) or return "Invalid date format: '$in{$column
-gt}'");
push(@search_gt_fields, $i); }
if ($in{"$column-lt"} !~ /^\s*$/) { ($db_sort{$column} eq 'date') and
(&date_to_unix($in{$column}) or return "Invalid date format: '$in{$column
-lt}'");
push(@search_lt_fields, $i); }
Make sure the bolded characters above are in the lines. (I separated the lines a bit so you wouldn't have to scroll across the page. You should be able to find the lines.)
Now, when you create your links on your static html page, use
for today:
http://url/to/cgi-bin/dbman/db.cgi?db=
default&uid=default&today=1&view_records=1
for dates in the future:
http://url/to/cgi-bin/dbman/db.cgi?db=
default&uid=default&future=
7&view_records=1
A couple of things to be careful of. First, if you are using a .cfg file other than default.cfg, change the
default in the links to the name of your .cfg file. Second, in the "future" link, adjust the number to whatever you want. You should probably set it one more than you really want, though.
That should work, but it is untested.
------------------
JPD
[This message has been edited by JPDeni (edited April 19, 1999).]