Gossamer Forum
Home : Products : Links 2.0 : Discussions :

linkdead2.cgi

Quote Reply
linkdead2.cgi
Fatal error: xxxxxxxx admin/templates/linkdead_success.html

The script works as it is sending the mail with correct reporting. The thing is that the template is there, the linkdead_success.html. There is probably an easy solution to this but as I donīt know much about cgi and stuff I canīt correct it.

Another thing, for those who wondered about the error "unknown tag: Name". In the template You should change <%Name%> (in the linkdead_add.html template) to <%Title%>, then it will work prefectly. It is wanting the title for the page.
Quote Reply
Re: [Gokboet] linkdead2.cgi In reply to
What was where the xxxxx is? It doesn't help us knowing the name of the file...we need to know the error. People can't do anything by just knowing your path...so I don't see why people cover it up Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] linkdead2.cgi In reply to
Sorry for that, I missed to add it. Wink

This is the error:

Template: Can't find template: /home/xxxxxxx/domains/www.xxxxxxx.xxx/cgi-bin/lank/admin/templates/linkdead_success.html



About covering the path, hacking has been made possible by hackers without knowing nothing about passwords and so on so I have been taught not to give the home directory path.

Last edited by:

Gokboet: Jun 21, 2002, 3:50 AM
Quote Reply
Re: [Gokboet] linkdead2.cgi In reply to
Mmm...is it definatly there? Its not called linkdead_success.htm by accident is it?

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] linkdead2.cgi In reply to
I promise it is definately there. I removed and then reuploaded it many times, the other files are also there. That is why I donīt understand anything. Here it is: home/domains/www.xxxxx.xxx/cgi-bin/lank/admin/templates/linkdead_sucess.html
Quote Reply
Re: [Gokboet] linkdead2.cgi In reply to
You may need ot modify the .cgi scripts yourself. Could you upload it to the forum so I can see it, and I'll show you what to change it to Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] linkdead2.cgi In reply to
This is deadlink2.cgi

#!/usr/bin/perl

# -------------
# Links
# -------------
# Links Manager
#
# File: linkdead.cgi
# Notifies the webmaster of a deadlink
# Author: Glenn Utteridge
# Based on and designed to be used with
#Links 2 by: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
#
# Setup:
# Make sure the require statement below points to the config file.
eval {
(
$0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
(
$0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}

# ========================================================

eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.

sub main {
#-------------------------------------------------------------------
# Main Routine

# Sends an email to the admin, letting him know that there is a dead link.

my %in = &parse_form();

# Check to make sure that there is an admin email address defined.
$db_admin_email or &cgierr("Admin Email Address Not Defined in config file!");

my $to = $db_admin_email;
my $from = $in{$db_cols[$db_contact_email]};
my $subject = "Deadlink ID number: $in{'ID'}\n";
my $msg = qq|
The following
link is reported to be dead:

ID number:
$in{'ID'}
Site title:
$in{'Title'}
Site URL:
$in{'URL'}
Category:
$in{'Category'}
Comment:
$in{'Comment'}

To check the
link, please go to:
$db_cgi_url/jump.cgi?ID=$in{'ID'}

Or to
delete the link please go to:
Or to
delete the link please go to:
$db_dir_url/admin.cgi?db=links&ID=$in{'ID'}&Title=&URL=&Date=&Category=---&Description=&Contact+Name=&Contact+Email=&Hits=&isNew=---&isPopular=---&Rating=&Votes=&ReceiveMail=---&isPick=---&keyword=&mh=10&sb=---&so=ascend&delete_form=Search




Hälsningar,

$in{'sname'} .
|;

# Then mail it away!
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail =>
$db_mail_path,
from =>
$from,
subject =>
$subject,
to =>
$to,
msg =>
$msg,
log => $db_mailer_log
} ) or return;
$mailer->send or return;
print &site_html_deadlink_mail;
}



This is deadlink.cgi

#!/usr/bin/perl

# -------------
# Links
# -------------
# Links Manager
#
# File: linkdead.cgi
# Notifies the webmaster of a deadlink
# Author: Glenn Utteridge
# Based on and designed to be used with
#Links 2 by: Alex Krohn
# Email: alex@gossamer-threads.com
# Web: http://www.gossamer-threads.com/
# Version: 2.0
#
# (c) 1998 Gossamer Threads Inc.
#
# This script is not freeware! Please read the README for full details
# on registration and terms of use.
# =====================================================================
#
#
# Setup:
# Make sure the require statement below points to the config file.
eval {
(
$0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
(
$0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \

require "admin/links.cfg"; # Change this to full path to links.cfg if you have problems.
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}

# ========================================================

eval { &main; }; # Trap any fatal errors so the program hopefully
if ($@) { &cgierr("fatal error: $@"); } # never produces that nasty 500 server error page.
exit; # There are only two exit calls in the script, here and in in &cgierr.

sub main {
#-------------------------------------------------------------------
# Main Routine

local (%in) = &parse_form;


if ($in{'ID'} =~ /^\d+$/) {
my (%rec) = &get_record ($in{'ID'});
&site_html_add_linkdead (%rec);
}
else {
&site_html_deadlink_error ("Unkown Link ID: $in{'ID'}");
}

}



Thanks for Your assistance.

Carina

Quote Reply
Re: [Gokboet] linkdead2.cgi In reply to
Ah..thats not the file I needed..LOL. Could you find the sub site_html_deadlink_mail in site_html_templates.pl and paste it here?

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] linkdead2.cgi In reply to
Wink I understand. Heres is the code added as stated on this page http://mir.spaceports.com/~glennu/linkdead2.html

sub site_html_deadlink_error {
# --------------------------------------------------------
# This routine determines how the tell mail error page will look like.
&html_print_headers();
print &load_template ('tell_error.html', {
%in,
%globals
});
}


This probably is the faulty part as it comes from tella2

sub site_html_deadlink_mail {
# --------------------------------------------------------
# This routine determines how the deadlink mail success page will look like.
&html_print_headers();
print &load_template ('linkdead_success.html', {
%in,
%globals
});
}

sub site_html_add_linkdead {
# --------------------------------------------------------
# This routine determines how the deadlink comment page looks like.
&html_print_headers();
print &load_template ('linkdead_add.html', {
%rec,
%globals
});
}

sub site_html_deadlink_error {
# --------------------------------------------------------
# This routine determines how the deadlink mail error page will look like.
&html_print_headers();
print &load_template ('linkdead_error.html', {
%in,
%globals
});
}

1;



It is added at the bottom thats why the one is in there to.

Last edited by:

Gokboet: Jun 21, 2002, 4:35 AM
Quote Reply
Re: [Andy] linkdead2.cgi In reply to
Could this have something do with it? http://mir.spaceports.com/~glennu/tella2.html is also added and the last "function" which has to be added to the site_html_teplates.pl is this :



sub site_html_tell_mail {
# --------------------------------------------------------
# This routine determines how the tell mail success page will look like.
&html_print_headers();
print &load_template ('tell_success.html', {
%in,
%globals
});
}

sub site_html_add_tell {
# --------------------------------------------------------
# This routine determines how the tell comment page looks like.
&html_print_headers();
print &load_template ('tell_add.html', {
%rec,
%globals
});
}

sub site_html_deadlink_error {
# --------------------------------------------------------
# This routine determines how the tell mail error page will look like.
&html_print_headers();
print &load_template ('tell_error.html', {
%in,
%globals
});
}


That is probably the reason why it goes wrong as sub site_html_deadlink_error is the same as in the the other script. I donīt know what shoul be there instead though.
Quote Reply
Re: [Gokboet] linkdead2.cgi In reply to
I gotta tell you I'm not really sure what is wrong. I was thinking that maybe it gave you the option to define the complete path to the template...but I was wrong. Maybe someone else with a bit more experience with this mod could help?

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] linkdead2.cgi In reply to
Thanks for Your effort. Is Glennu still around? As it is his script he would probably know.

Last edited by:

Gokboet: Jun 21, 2002, 6:59 AM