Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

No validation need when modifying..

Quote Reply
No validation need when modifying..
Hi,

How can I do this?

When people modify there account, it will auto update the Link database instead of going to the validation database?

Another question:

Do not allow HTML in the description. example when they type:
in the description (it will not show up or it will be
text but not html)



Thanks in advance.



Quote Reply
Re: No validation need when modifying.. In reply to
Open modify.cgi, in sub process_form and look for:

Code:
$links->{'Mode'} = 'Modify';
Comment it out or delete it....


Then look for:


$val = new Links::DBSQL "$LINKS{admin_root_path}/defs/Validate.def";
Change it to read:
$val = new Links::DBSQL "$LINKS{admin_root_path}/defs/Links.def";

I think that'll do it, you'll want to change the output accordingly but that's just aesthetics. That's the basic idea it'll probably require a little more tweaking, but it's a start for you.

As for the HTML thing that's a complicated issue that would involve alot of regexp code to control all possible HTML input...the best thing to do is just tell people their links will not be validated if they choose to use HTML in their descriptions. Besides you may want to use it in your descriptions why restrict yourself?



Quote Reply
Re: No validation need when modifying.. In reply to
Hi,

Thanks for your respond.

I did what you said above, BUT it adds another ID# instead of replacing the ID number.

Quote Reply
Re: No validation need when modifying.. In reply to
OK, that means there is code that is adding it to the database rather than modifying it. There are basic routines in DB_UTILS.pm and this one I think is in DBSQL.pm they are foundation blocks for creating and making changes to Links and manipulating it's data.

Code:
At this line (I broke it up to fit here):
# Otherwise add it in.
$val->add_record ( $links ) or &site_html_modify_failure (
{ Category => $category, error => $Links::DBSQL::error, %in }, $dynamic) and return;
Change to:

# Otherwise add it in.
$val->modify_record ( $links ) or &site_html_modify_failure (
{ Category => $category, error => $Links::DBSQL::error, %in }, $dynamic) and return;

That should fix the adding a new record ;)