In Reply To:
Unfortunately, with your codes, it will only check the TITLE, NOT both URL and Title.
Good luck!
Regards,
Eliot Lee
Ok I figured out the way to check both TITLE and URL for dupes.
In db.pl, sub check_duplicates, Just after
$seen{$values[$db_url]}++;
you must add
$seen2{$values[$db_title]}++;
push (@{$doubles2{$values[$db_title]}}, $values[$db_key_pos],$values[$db_title], $values[$db_category]);
Then
After
while (($url, $count) = each %seen) {
($count < 2) and delete $doubles{$url};
}
You must add
while (($title, $count) = each %seen2) {
($count < 2) and delete $doubles2{$title};
}
@doubles2=%doubles2;
In admin_html.pl, sub html_check_duplicates, Just after
my %duplicates = @_;
You must add
my
%duplicates2=@doubles2;
The line:
if (!%duplicates) {
Should be changed to
if (!%duplicates && !%duplicates2) {
Then
After
print qq~<input type=checkbox name="$id" value="delete"> <$font>
(<a href="$db_script_url?db=links&view_records=1&$db_key=$id&ww=1" target="_blan
k">$id</a>) $title in <em>$cat</em><br>~;
}
print qq~</td></tr>~;
}
You must add
foreach (keys %duplicates2) {
print qq~<tr><td colspan=2><$font><b>$_</b></font></td></tr>
<tr><td> </td>
<td>
~;
for ($i = 0; $i <= $#{$duplicates2{$_}}; $i = $i + 3) {
my $id = ${$duplicates2{$_}}[$i];
my $title = ${$duplicates2{$_}}[$i + 1];
my $cat = ${$duplicates2{$_}}[$i + 2];
print qq~<input type=checkbox name="$id" value="delete">
<$font>
(<a href="$db_script_url?db=links&view_records=1&$db_key=$id&ww=1"
target="_blan
k">$id</a>) $title in <em>$cat</em><br>~;
}
print qq~</td></tr>~;
}
That's it. This is assuming you haven't tinkered with the default Links 2.0 installation.
Cheers
Chinthaka Weerasinghe 11599119