Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

deadlink/badlink fix

Quote Reply
deadlink/badlink fix
I haven't seen any mention of this in the forum or FAQ, but if it's been covered somewhere, my apologies.

I downloaded the SQL deadlink code from the resource center, but it gave me errors at or around line 34 of HTML_templates.pm. The fix was pretty simple -- the subroutines were not set up in the dynamic format. Possibly from a pre-1.11 version?

Anyway, here is what I changed the code to:
Code:
sub site_html_badlink_form {
# --------------------------------------------------------
# This routine determines how the dead/bad link form page will look like.
#
my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('badlink.html', {
%$tags,
%GLOBALS
}, undef, $template);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}

sub site_html_badlink_success {
# --------------------------------------------------------
# This routine determines how the dead/bad link success page will look like.
#
my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('badlink_success.html', {
%$tags,
%GLOBALS
}, undef, $template);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}

sub site_html_badlink_failure {
# --------------------------------------------------------
# This routine determines how thedead/bad link error page will look like.
#
my ($tags, $dynamic) = @_;
my $template = defined $dynamic ? $dynamic->param('t') : undef;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

defined $dynamic and &load_user ($dynamic, $tags);
my $output = &load_template ('badlink_error.html', {
%$tags,
%GLOBALS
}, undef, $template);
defined $dynamic and &clean_output($dynamic, \$output);
print $output;
}

The mod instructions had them set up this way:
Code:
sub site_html_badlink_form {
# --------------------------------------------------------
# This routine determines how the dead/bad link form page will look like.
#
my $tags = shift;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

print &load_template ('badlink.html', {
%$tags,
%globals
});
}

sub site_html_badlink_success {
# --------------------------------------------------------
# This routine determines how the dead/bad link success page will look like.
#
my $tags = shift;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

print &load_template ('badlink_success.html', {
%$tags,
%globals
});
}

sub site_html_badlink_failure {
# --------------------------------------------------------
# This routine determines how thedead/bad link error page will look like.
#
my $tags = shift;
(ref $tags eq 'HASH') or croak "HTML_TEMPLATES: Argument '$tags' must be hash reference";

print &load_template ('badlink_error.html', {
%$tags,
%globals
});
}

Having made the change, it works just fine. Two other things I'm not sure about:

1) The mod instructions say On or about line #77 change "My Robot Name" to whatever you want. There is no such line that I can find in badlink.cgi. Is that an old item?

2) I don't know if this matters or not, but the instructions didn't specify where to add &site_html_badlink_form &site_html_badlink_success &site_html_badlink_failure in @EXPORT = qw/. I figured it would be best to put that line immediatedly after the &site_html_mailing &site_html_mailing_error line, as that is the order of the subroutines.

Hope this helps,
Dan
Quote Reply
Re: deadlink/badlink fix In reply to
Hi Dan,

the mod works now (v 1.11) very fine with this changes from You - thanks for this help !!!

1)You have to change the following line in badlink.cgi (or deadlink.txt) - only for version 1.11:

Code:
$ua->agent('SexLynx/2.0(http://www.sexlynx.com)');

new code:

Code:
$ua->agent('Name_of_Your_site/2.0(http://www.yourdomain.com)');

2) it works fine, so your place seems to be okay... Wink

Many greetings,

DMK-Internet Services
M.Lutz


------------------
Musichits - the big music-search-engine including hit-counter and ratings:
http://www.musichits.org/
The Real Top 500 Music-sites
http://www.musichit.org/top/
Quote Reply
Re: deadlink/badlink fix In reply to
Hi, glad it worked for you. Regarding #1, I figured that was the line being referred to, but the existing line you quoted didn't seem to affect anything as far as I could tell... Where does that come into play?

Dan
Quote Reply
Re: deadlink/badlink fix In reply to
Hi,

that seems to be the Mail-Sender (You can see it in Your unformatted mail-program).

This "sexlynx.com" is original taken from the downloaded file deadlink.txt at this mode, You have to rename it, because a few visitors are able to see it (free promotion for this site)...

Bye,

M.Lutz

------------------
Musichits - the big music-search-engine including hit-counter and ratings:
http://www.musichits.org/
The Real Top 500 Music-sites
http://www.musichit.org/top/
Quote Reply
Re: deadlink/badlink fix In reply to
Hi,

I have forgotten - for new users of Links SQL (the changings above only for version 1.11):

You are able to view (and download) the mod at this URL:

www.gossamer-threads.com/scripts/resources/jump.cgi?ID=820

This mod is from the Resource Center at this URL:

www.gossamer-threads.com/scripts/resources/Links_SQL/Modifications/

Bye,

DMK Internet Services
M.Lutz


------------------
Musichits - the big music-search-engine including hit-counter and ratings:
http://www.musichits.org/
The Real Top 500 Music-sites
http://www.musichit.org/top/


[This message has been edited by dmk (edited February 21, 2000).]