Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Duplicate Entries/links when they are not error

Quote Reply
Duplicate Entries/links when they are not error
Under Admin - Links section - did a check for duplicate links. Came back with a list of over 150 links it is saying are duplicates when they are not. Checked linked.db.

Any ideas?


------------------
www.nzcid.org.nz
New Zealand Christian Internet Directory







Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
This has happened to me before...Mostly with mailing list (listserv addresses). If you have links with the same domain, then they will show up.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
Hi there Elliot!

Most of these entries have no url - and now I note that every new link added is being called a duplicate, whether they have an url or not.

Would it do any harm to ignore this or will it get out of hand somehow. I do not feel like deleting them and inputting them again.

------------------
www.nzcid.org.nz
New Zealand Christian Internet Directory









[This message has been edited by Ian Conza (edited April 23, 2000).]

[This message has been edited by Ian Conza (edited April 23, 2000).]
Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
There really is no harm in this...If you really want the duplicate check to work properly...you could edit the sub check_duplicates routine in the db.pl file to check fields other than the URL.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
Hi Elliot!

Thanks for the quick reply. Had a look at the db.pl - bit beyond me Smile

If it not going to cause any harm I am going to leave it for the time being. I am saving my pennies to go to a sql version of some sort..

Once again many thanks.

------------------
www.nzcid.org.nz
New Zealand Christian Internet Directory







Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
You're welcome.

HINT about that sub...rather than using the URL field to @push the values...think about using another field like the Title.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
Hi Elliot!

Sorry for taking so long to reply. I will need to be told what to replace with what. I really have no idea what you mean.

I notice in looking at the Dpulicate list - it seems to point out the common names that are in the Titles as many do have urls. Like Elim - AOG and there will be many more as they are the denominational names associated with a Church / churches.

I also note these duplicates are causing the AltCategory not work - so it must be causing a conflict somewhere.

------------------
www.nzcid.org.nz
New Zealand Christian Internet Directory







Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
 
Quote:
I also note these duplicates are causing the AltCategory not work - so it must be causing a conflict somewhere.

Huh? Duplicate listings inhibiting the AltCategories from working? That makes no sense...What I would recommend doing is re-tracing the recent Mods you've implemented and verify the codes in the recent Mods.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
Hi Elliot!

I have added no mods recently at all. Up until I started entering all this data everything was working okay.

------------------
www.nzcid.org.nz
New Zealand Christian Internet Directory







Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
Hi Elliot!

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, $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,/$,,;
$seen{$values[$db_url]}++;
push (@{$doubles{$values[$db_url]}}, $values[$db_key_pos], $values[$db_title], $values[$db_category]);
}
close DB;
while (($url, $count) = each %seen) {
($count < 2) and delete $doubles{$url};
}
&html_check_duplicates (%doubles);
}

Of the above what do I change to stop it picking up blank urls and same word/name in the Title?

------------------
www.nzcid.org.nz
New Zealand Christian Internet Directory







Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
*sigh*

Ian,

You should really considering picking up a Perl book to help you with tweaking codes.

Wink

Try the following codes:

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, $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_url]}}, $values[$db_key_pos], $values[$db_title], $values[$db_category]);
}
close DB;
while (($url, $count) = each %seen) {
($count < 2) and delete $doubles{$url};
}
&html_check_duplicates (%doubles);
}

Hope this helps.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
Hi Elliot!

Thanks for the additional code. Did not solve the issues. This is what is happening:

It is picking up multipules of http://
and entries where I have deleted the http://

Both of the above are where entries have no url at all - in some cases I have left the http://, in others I have deleted the http://

also where they have the same domain like this:

http://www.porirua.elim.org.nz
http://www.oasis-elim.org.nz

Hope that explains it far more clearly.

------------------
www.nzcid.org.nz
New Zealand Christian Internet Directory









[This message has been edited by Ian Conza (edited April 29, 2000).]
Quote Reply
Re: Duplicate Entries/links when they are not error In reply to
Sorry...I don't have time to help you right now.

Best of luck.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: [Stealth] Duplicate Entries/links when they are not error In reply to
This may seem like a silly question, but where exactly IS this db.pl file? I need to mod this sub routine. I can't seem to locate it. This thread is kind of old, so it may have gotten renamed in an update.

Thanks
Quote Reply
Re: [TNIJason] Duplicate Entries/links when they are not error In reply to
It's in the admin directory, still named db.pl...Smile


Leonard
aka PerlFlunkie