Gossamer Forum
Home : Products : Links 2.0 : Customization :

Using current date when validating

Quote Reply
Using current date when validating
How can I automatically have the current system date as "date added" when validating instead of the date when they submitted? Even though I validate links daily, I often find links the next moring that were submitted overnight, showing yesterday's date - I keep adjusting the "date added" manually, but would appreciate some tips how I can automatically use the actual date the link was added as "date added" and not the one it was applied on. Any ideas? Haven't seen a mod for this yet...
Quote Reply
Re: Using current date when validating In reply to
One thing you can try is the following...

Add the following codes in the sub build_html_record routine in the db_utils.pl file:

Code:
$rec{'Date'} = &get_date;

AFTER the following codes:

Code:
my ($output, $field);

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Using current date when validating In reply to
Thanks! That wasn't quite it, but it got me into the right direction. I think I got it to work by adding that to admin_html.pl instead, in sub html_modify_form_record (for modifying) and sub html_record_form_mult (for validating). Thank you for the code line and getting me in the right direction Smile.
Quote Reply
Re: Using current date when validating In reply to
Did you check your codes with the adding new links via the add.cgi file?

Just to make sure there are no bugs.

But, I am glad you figured it out.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Using current date when validating In reply to
I did use the user form to test this... looks fine, I went into the validate.db to change the date to see if it still puts todays date in - looks fine, time will tell if I have any bugs in it... all tests I ran so far look good Smile
Quote Reply
Re: Using current date when validating In reply to
For the benefit of others...please post the EXACT codes you used.

I am glad you figured it out...however, it is a disservice to other LINKS users to NOT post the codes you used to make it work.

Wink

I know that others will appreciate this code hack. Please post the codes you used.

Thank you.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Using current date when validating In reply to
Sure, no problem - I used your line,
Code:
$rec{'Date'} = &get_date;
in admin_html.pl, in sub html_modify_form_record (for modifying) below
Code:
if (!%rec) { &html_modify_failure("unable to find record/no record specified: $in{'modify'}"); return; }
and in sub html_record_form_mult (for validating) below
Code:
my (%rec) = @_;
That's all... Wink