Gossamer Forum
Home : Products : Links 2.0 : Discussions :

modify.cgi not working

Quote Reply
modify.cgi not working
Hello all,

a year after I had my site up I noticed that modify.cgi is not working...!

I have some mods installed on Links 2.0, but I managed to fix 1 problem with the limited perl experience I have, but it still refuses to work.

The problem is it does not find the link in the database or so it says...
The modify is supposed to look for Title or URL, but neither work

Here's the code:

open db file: $db_file_name. Reason: $!");
$found = 0;
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
if ($data[$db_url] eq $in{'Current URL'}) {
$in{$db_key} = $data[0]; # <-- originally this number was a 0 and I changed it to 2 to make it pass this check
$found = 1;
%original = &array_to_hash (0, @data);
last LINE;
}
}
close DB;
!$found and &site_html_modify_failure ("link was not found in the database")
and return;

It's looking for data[0] which is really the Link ID not the URL. so I changed that to 2 instead to make the 1st check work so the result is at least the link is found...

Yet still if I enter the Link Title it does not work.

But I get the following error afterwords:
ID (Too long. Max length: 8)
Priority (Can not be left blank)

Any ideas?

Quote Reply
Re: modify.cgi not working In reply to
Nevermind I fixed it...
I added one more check, but now it works:

if ($data[$db_url] eq $in{'Current URL'}) {
$in{$db_key} = $data[0];
$found = 1;
%original = &array_to_hash (0, @data);
last LINE;
}
if ($data[$db_title] eq $in{'Current URL'}) {
$in{$db_key} = $data[0];
$found = 1;
%original = &array_to_hash (0, @data);
last LINE;