I have many installed mods on my links directory. What I am looking for is a fix to a problem I am having with Dup URL errors.
This is the code I have in db.pl
sub check_duplicates {
# --------------------------------------------------------
# This routine searches through the database and pulls up sets
# of links that have the same domain.
#
my (@values, %seen, %doubles, $url, $title, $count);
open (DB, "<$db_links_name") or &cgierr("error in check_duplicates. unable to open db file: $db_links_name. Reason: $!");
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@values = &split_decode($_);
# $values[$db_url] =~ s,/$,,;
$values[$db_title] =~ s,/$,,;
# $seen{$values[$db_url]}++;
$seen{$values[$db_title]}++;
push (@{$doubles{$values[$db_title]}}, $values[$db_key_pos], $values[$db_title], $values[$db_category]);
}
close DB;
while (($title, $count) = each %seen) {
($count < 2) and delete $doubles{$title};
}
&html_check_duplicates (%doubles);
}
When I go to add a new resource, I am getting a Duplicate URL error. I'm not sure why though if this is a fix to find only Dup Titles.
Any help is appreciated.
Thanks
James
This is the code I have in db.pl
Code:
sub check_duplicates {
# --------------------------------------------------------
# This routine searches through the database and pulls up sets
# of links that have the same domain.
#
my (@values, %seen, %doubles, $url, $title, $count);
open (DB, "<$db_links_name") or &cgierr("error in check_duplicates. unable to open db file: $db_links_name. Reason: $!");
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@values = &split_decode($_);
# $values[$db_url] =~ s,/$,,;
$values[$db_title] =~ s,/$,,;
# $seen{$values[$db_url]}++;
$seen{$values[$db_title]}++;
push (@{$doubles{$values[$db_title]}}, $values[$db_key_pos], $values[$db_title], $values[$db_category]);
}
close DB;
while (($title, $count) = each %seen) {
($count < 2) and delete $doubles{$title};
}
&html_check_duplicates (%doubles);
}
When I go to add a new resource, I am getting a Duplicate URL error. I'm not sure why though if this is a fix to find only Dup Titles.
Any help is appreciated.
Thanks
James