Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

automatic duplicate check

Quote Reply
automatic duplicate check
this mode made my life alot easier when i was using links2.
anyone is working on this one?
basiclly it checks if the link is already listed and gives an error if it does.
it checks for x.xom www.x.com www.x.com/index.html and x.com/index.html and turns an error and does not allow the user to add the link.


Quote Reply
Re: automatic duplicate check In reply to
alex, how about adding this to your to do list.
i'm spending at least 2 hours a day doing this manually

Quote Reply
Re: automatic duplicate check In reply to
There was a code hack released for Links SQl v.1.X posted in the Links SQL 1.X Forum that could easily be adapted to Links SQL 2.X...

Regards,

Eliot Lee
Quote Reply
Re: automatic duplicate check In reply to
Eliot,

Can you be more specific? I'd like to use this but I need to know what changes specifically, if any, must be made to make this compatible with SQL2.0.3?

Code:
# Check that the record hasn't been added already in the Links and Validate tables.
$val = new Links::DBSQL $LINKS{admin_root_path} . "/defs/Validate.def";
$val->query ( { Description => $in->param('Description'), URL => $in->param('URL'), Title => $in->param('Title'), ww => 1 } );
$db = new Links::DBSQL $LINKS{admin_root_path} . "/defs/Links.def";
$db->query ( { Description => $in->param('Description'), Title => $in->param('Title'), URL => $in->param('URL'), ww => 1 } );
if (($db->hits) and ($val->hits)) {
&site_html_error ( { error => "A request to add this record has been received. We will notify you via email when your link has been validated."}, $dynamic);
return;
}
if ($db->hits) {
&site_html_error ( { error => "Your link already exists in our database. To modify your link, please click on the Edit Link link located at the top and bottom of our web pages."}, $dynamic);
return;
}
if ($val->hits) {
&site_html_error ( { error => "A request to add this record has been received and your link has not been validated yet."}, $dynamic);
return;
}
Mark Brasche
http://SurfSafely.com/
Quote Reply
Re: automatic duplicate check In reply to
Well for starters, things like this.......

Links::DBSQL
$LINKS{admin_root_path}

....need to be changed as the new versions doesn't use syntax like this....and the perl modules are different. Also templates and errors are called differently.

Look at your new copy to see examples.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: [RedRum] automatic duplicate check In reply to
any news for this mod?
Quote Reply
Re: [Essam] automatic duplicate check In reply to
I've got a kludge working, but nothing that can be distributed yet.

I'll see if I can fix this up. It wasn't a plug-in per se, it was modifications to the Add.pm which made it easier. Before passing information on, it did a check to see if the url existed, and then returned an error page.

It's not elegant, and certainly doesn't do all sorts of redundancy checks.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.