Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

HELP..why the same idnumber ??

Quote Reply
HELP..why the same idnumber ??
My searchscript links2 is running well since 3 weeks and now I can see while validating that the idnumbers of the new addings are the same like these of links added before...?
What is the reason and the solution ?

Thanks.
L. Nueesch
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
Your admin/data/linksid.txt file should contain the highest number used by any link. If it does not, it will create duplicate ID's. Edit the file to correct the number, save the file, and then ensure that it is chmod 666 (all files in the data directory need to be chmod 666).

I hope this helps.
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
thanks,
I corrected the linksid.txt file into a higher number.But why did it changed from 208 to 1 again ?

L. Nueesch
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
You mean, after you corrected the file, then added a link, it got changed back to 1 again? That shouldn't have happened. Have you made any mods to nph-build.cgi or add.cgi?
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
After the correction of the linksid.txt file it is working ok. It is running well now.

I just asked me, why it could happened before ?
When it runs on like now, it is great .:-)
You can have a look at it:
http://www.internet-marketingcenter.ch/powerlink/

L.Nueesch
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
Hello & HELP,

I read this thread with interest. I approaching 5000 links and having the same ID duplication problem.

I get 123|123 etc including duple like that for everything in a link, double ID's Double email addresses etc. The actual links don't go to the correct web site when selected.

So, if the fix is put the correct number in Linksid.txt, how does one determine what the exact number of links in the database is?

I can't count them and frankly, I don't believe the report feedback when building, because the reported number of links is the same number in Linksid.txt

Any help appreciated.

Getting worse by the minute.

Thanks,

Dave
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
1 link per line in the database, so just count the number of lines

wc links.db

should do the trick
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
Hello world,

since this is exactly the problem I have I'd like to pull out this old thread again:
I've been running LINKS for several months without problems now, but for a few weeks it happens that sometimes (!) 2 new links get the same ID. My links.db is already 271kb...

- In links.db something like 841~~841|http://blabla.com~~http://blabla.com| [.. and so on] is inserted
- So I have edited links.db manually and put in the 2 entries included in above "error-line" as ID 841 and 842.
- Then I set linksid.txt to 843 (or must it be 842?)

I also found that my links.db was never set back so CHMOD 666, so I installed a little mod I found in another thread. Could this have caused above mentioned error? Still my linksdb.bak is not being deleted automatically. Could this be causing the problem?

I don't think that I made changes to nph-build or somewhere that could influence this, especially 'cause it does not happen all the time...

Any ideas? Highly appreciated,
thanks
Denis

Quote Reply
Re: HELP..why the same idnumber ?? In reply to
The number in the linksid.txt should be the EXACT last ID number of the LAST record in your links.db file...so, you should use 842.

In Reply To:
I also found that my links.db was never set back so CHMOD 666, so I installed a little mod I found in another thread. Could this have caused above mentioned error?
NOPE.

In Reply To:
Still my linksdb.bak is not being deleted automatically. Could this be causing the problem?
Yep...make sure it is set to 666 (rw-rw-rw-).

Regards,



Eliot Lee
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
Thank you Eliot for replying,

actually I received another link addition this morning.
The latest link was set to 844 and linkid.txt also to 844, so this seems to be working as it should.

But links.db.bak is still not deleted, even if I delete it manually before building. It is set to CHMOD 666.
Should you have another idea what could be causing this I'd be very thankful for tips.

Thanks,
Denis


PS: just took a another look in my nph-build. Maybe this started to happen after having installed widgetz review mod. Have there been any know problems with this?

I'd like to put my codes here, maybe you'd do me a very big favour and see if this is the same codes in the same place as you have? Thanks so much,

# Update the links database.
my $output = '';
INLINE: {
local ($^I, @ARGV) = ('.bak', $db_links_name);
LINE: while (<> ) {
/^#/ and print OUT and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@values = split /\Q$db_delim\E/;
$id = $values[0];

if (exists $votes{$id}) {
$values[$db_rating] = (($values[$db_rating] * $values[$db_votes]) + $rating{$id}) /
($values[$db_votes] + $votes{$id});
$values[$db_rating] = sprintf ("%.2f", $values[$db_rating]);
$values[$db_votes] = $values[$db_votes] + $votes{$id};
$output .= "\tUpdating rating to $values[$db_rating] for link id $id\n";
}
if ($values[$db_reviews] != $review{$id}) {
$values[$db_reviews] = $review{$id};
$output .= "\tUpdating reviews to $review{$id} for link id $id\n";
}
print &join_encode(&array_to_hash(0, @values));
}
}
print $output;

Quote Reply
Re: HELP..why the same idnumber ?? In reply to
That looks like your problem...You have inadvertantly deleted the following codes:

Code:

close DB;
close DBTMP;

if (-s "$db_links_name.bak" > 0) {
if (! rename ("$db_links_name.bak", $db_links_name)) {
print "\tCouldn't rename! Had to copy. Strange: $!\n";
open (DBTMP, ">$db_links_name") or
&cgierr ("unable to open links database: $db_links_name. Reason: $!");
open (DB, "$db_links_name.bak") or
&cgierr ("unable to open temp links database: $db_links_name.bak. Reason: $!");
while ( ) { print DBTMP; }
close DB;
close DBTMP;
}
else { chmod 0666, $db_links_name; }
}
else {
&cgierr ("Error building! Links database is 0 bytes!");
}


WHICH should go right after the following codes:

Code:

}
print $output;


Regards,


Eliot Lee
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
STRIKE!
Eliot, you're my hero!
I don't use the reviews for rating my links, so I think I forgot to change back those "# Update the links database." codes to the originals.

Thanks a lot,
Denis

Quote Reply
Re: HELP..why the same idnumber ?? In reply to
In Reply To:
STRIKE!
Huh??? In American baseball, a strike is a bad thing! Is that suppose to mean something else?!?!??!

In Reply To:
Thanks a lot,
You're welcome.

Regards,

Eliot Lee
Quote Reply
Re: HELP..why the same idnumber ?? In reply to
Sorry, 'have no idea about American Football.
Seems the Anglicism people use here more and more do not mean neccessarily the same as what an American would understand. Actually STRIKE should mean something like "I did it" or "THat was succesfull"...

Anyway thanks again,
Denis