Gossamer Forum
Home : Products : Links 2.0 : Customization :

Auto Validate...Anyone have a mod?

Quote Reply
Auto Validate...Anyone have a mod?
Any ideas of how to setup links 2.0 to accept submitted links without having to validate them manually?

Thanks,

Tim
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
In add.cgi you'll find the following code, just change $db_valid_name into $db_links_name.

old:
Code:
# Print out the validate input to a "validation database" where it is stored until
# the admin decides to add it into the real database.
open (VAL, ">>$db_valid_name") or &cgierr("error in add_record. unable to open validate file: $db_valid_name. Reason: $!");
flock(VAL, 2) unless (!$db_use_flock);
print VAL &join_encode(%in);
close VAL; # automatically removes file lock

new:
Code:
# Print out the validate input to a "validation database" where it is stored until
# the admin decides to add it into the real database.
open (VAL, ">>$db_links_name") or &cgierr("error in add_record. unable to open validate file: $db_links_name. Reason: $!");
flock(VAL, 2) unless (!$db_use_flock);
print VAL &join_encode(%in);
close VAL; # automatically removes file lock


[This message has been edited by chrishintz (edited April 29, 1999).]
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
Thanks a lot...that worked great!

Any ideas on how to auto build upon submission?

-Tim
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
actually the BEST way to do it is putting

$status = &validate_record (%in);

if ($status eq "ok") {
#ADD CODE HERE..
}
else {
&html_add_failure($status);
}
that actually auto validates the record otherwise it gives you an error..
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
Tim Mousel, you said>>>
Any ideas on how to auto build upon submission?
... that is a good idea. Has anyone got the answer to this question?

Also, Has anyone had any problems on down the line with this change to add.cgi? ie, what will happen when they try to modify?
TimRyan
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
widgetz, and where might one stick this code Smile
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
Was this problem ever solved? I need to have this code.
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
Where to insert this??? Be specific please.
Quote Reply
Re: Auto Validate...Anyone have a mod? In reply to
Is it really that hard to figure where to put this code, since chris said in his directions add.cgi and widgetz said change that to this
add it under
$status = &validate_record (%in);
in add.cgi

------------------
LookHard Search
lookhard.hypermart.net
Lavon Russell