Gossamer Forum
Home : Products : Links 2.0 : Customization :

days_old Mod

Quote Reply
days_old Mod
I have found the following thread: http://www.gossamer-threads.com/...ew=&sb=&vc=1

I am trying to implement this. Just not sure on a couple of things.

Do I use:
$days_old = &days_old($rec{'Date'});
or
my $days_old = &days_old($rec{'Date'});

in sub site_html_search_results???



Also I am using:
<select name="days_old">
<option value="">Choose one of the following:
<option value="1">Today
<option value="7">Last Week
<option value="14">Last Two Weeks
<option value="30">Last Month
<option value="60">Last Two Months
<option value="90">Last Three Months
<option value="180">Last Six Months
<option value="360">Last Year
</select>


If a user does not select anything from this drop down, but others, will it still present a results page? I would like to have it set for ALL if nothing has been selected.

The thread also states to put:
if ($in{'daysold'} =~ m,^\d+$,) { (&days_old($values[$db_modified]) <= $in{'daysold'}) or next LINE;}

under:
$grand_total++;

I take it this goes within the Search.cgi. There are two $grand_total++; though. Should it go under both?

And finally, is this all there is to this mod?

Thank you.



Quote Reply
Re: days_old Mod In reply to
In Reply To:
Do I use:
$days_old = &days_old($rec{'Date'});
or
my $days_old = &days_old($rec{'Date'});

in sub site_html_search_results???
$days_old = &days_old($rec{'Date'});

In Reply To:
If a user does not select anything from this drop down, but others, will it still present a results page? I would like to have it set for ALL if nothing has been selected.
It will present all results if someone does NOT select any of the values.

In Reply To:
I take it this goes within the Search.cgi. There are two $grand_total++; though. Should it go under both?
ONLY under the one in the sub search routine.

Also, you need to use the following codes:

Code:

if ($in{'days_old'} =~ m,^\d+$,) { (&days_old($values[$db_modified]) <= $in{'days_old'}) or next LINE;}


Since you are using days_old in your search form, you need to keep the variables consistent in your search.cgi file.

Good luck!

Regards,

Eliot Lee