Hi, I've got a database of articles. It includes a 'publish date' field and a 'stick to publish date' box. Now, the box is 'on' on default. If a user adds an article, he can put it in to show up in the future, say 2 weeks from now.
I know how to compare the date with todays date, but where exactly and how do I put it in the code. I guess it needs to be done at query in db.cgi, but I'm not sure... Because, if the field is set (when doing a search) to 'on' I don't want the record to be included in search results. That would happen if I'd put it in sub html_record in html.pl
To compare the dates I found this:
$compare2 = &date_to_unix($rec{'Date2'});
if ($compare1 >= $compare2) {
include it in the search results;
}
Has anybody seen something like this already explained in the forum?
Any help is appreciated.
Lex
I know how to compare the date with todays date, but where exactly and how do I put it in the code. I guess it needs to be done at query in db.cgi, but I'm not sure... Because, if the field is set (when doing a search) to 'on' I don't want the record to be included in search results. That would happen if I'd put it in sub html_record in html.pl
To compare the dates I found this:
Code:
$compare1 = &get_date; $compare2 = &date_to_unix($rec{'Date2'});
if ($compare1 >= $compare2) {
include it in the search results;
}
Has anybody seen something like this already explained in the forum?
Any help is appreciated.
Lex