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:
# --------------------------------------------------------
# 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:
# --------------------------------------------------------
# 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
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