Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Repeat Links On CentOS Machine

Quote Reply
Repeat Links On CentOS Machine
Hi,

I'm a licensed customer and still using Links SQL 2.1.1
My problem is when i transfer to new OS/Server, my previous OS is Redhat 9.0, but when i upgrade the server to Centos 4.2, my links are going to triple time show on any category, for example u can see at http://resepi.mesra.net/Masakan_Ayam/

Is it because of the modification i made long time ago at category.html as below?

<%loop links_loop%>
<%if first%> <%-- set up the opening table --%>
<TABLE width="100%">
<TR>
<%endif%>
<TD>
<%include link.html%>
</TD>
<%ifnot row_num % 2%> <%-- close the row --%>
</TR>
<%endif%>
<%if last%> <%-- close the table --%>
<%if row_num % 2 eq 1%> <%-- balance the trailing rows --%>
<TD></TD><TD></TD>
<%endif%>
</tr>
</TABLE>
<%endif%>
<%endloop%>

I hope having some advice why this happen and hopefully i dont have to upgrade to latest Links SQL 3.0 because on current 2.1.1 i had plenty of templates global and modification.

Thank you.

Last edited by:

reenee: Feb 16, 2006, 2:39 AM
Quote Reply
Re: [reenee] Repeat Links On CentOS Machine In reply to
Hi,

The template seems fine. I think there are duplicated records in the CatLinks table. May be they were inmported three times.

Hope that helps,

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Repeat Links On CentOS Machine In reply to
Hi Tandat,

The problem is i just transfer all the db and files from Redhat To CentOS without doing any import, its work ok before i nph-build-cgi on new machine, but when i run nph-build.cgi --all, all is changed to triple link on any category, is it any issues on perl 5.8.7 ?

Please help and Thank you.
Quote Reply
Re: [reenee] Repeat Links On CentOS Machine In reply to
No, I don't think that is related to Perl or OS. Because these could not produce more records for a link. So, just check the table CatLinks first.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Repeat Links On CentOS Machine In reply to
Mannnnn,

You're genius, now i can see it duplicate 3 time for each ID, anyway how can i fix that?

I very appreciate your help


Quote Reply
Re: [reenee] Repeat Links On CentOS Machine In reply to
Try to repair table if that helps. Otherwise, you need to manual delete the duplicated ones.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Repeat Links On CentOS Machine In reply to
Hi,

I try to repair table but its not help, Any clue to make it by using myql command? All links are total 5000 x 3 = 15,000 links to delete

Please help
Quote Reply
Re: [reenee] Repeat Links On CentOS Machine In reply to
I don't know if sql comman can do this or there is some tool available to do so.

I created a small script which can be upload onto the admin folder and change its permission to 755, then run it. Please backup that table before running the script for safety. I have tested locally but the world is too wide ;-)

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [reenee] Repeat Links On CentOS Machine In reply to
Hi,

In my opinion (which may not be correct of course) the easiest way to do this would be to add a unique index on the CatLinks table.
I think the command is something like this (backup first).

ALTER TABLE CatLinks ADD UNIQUE lid_cid (LinkID,CategoryID);

Quote Reply
Re: [afinlr] Repeat Links On CentOS Machine In reply to
This will fail if there are duplicate entries though. If you upgrade to 3.1.0, there is code to remove any duplicate entries and setup a unique index for you.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Repeat Links On CentOS Machine In reply to
Hi Alex,

Agreed, that will fail. However, I have done this before - using an index to remove duplicates - which is why I suggested it. Unfortunately I can't find the command I used now.

What about this:

ALTER IGNORE TABLE CatLinks ADD UNIQUE INDEX(LinkID,CategoryID);

Laura.
The UK High Street
Quote Reply
Re: [afinlr] Repeat Links On CentOS Machine In reply to
Hi Laura,

That indeed will work (well, looks like it should from MySQL's docs, I've never tried it myself). =)

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Repeat Links On CentOS Machine In reply to
Thanks. I often find that I remember doing something similar in the past when I'm reading posts on this forum - the problem is always remembering what exactly it was that I did Tongue