Gossamer Forum
Home : Products : Links 2.0 : Customization :

Problems with Mod "Sendlink"

Quote Reply
Problems with Mod "Sendlink"
Hello,

I use the Mod "Sendlink" by Anthro TECH, L.L.C. The script runs with the first template (sendlink_form.html). But if I push the button "Send Form" I get a HTTP 404 error. What can be the problem? The two other templates are in the same template folder and I set the chmode to 666.

Thank you for your help.

Thomas Stuenkel

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Sorry, here is the URL:
http://www.cdn.de/cgi-bin/sendlink/sendlink.cgi?ID=137

Thomas Stuenkel

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Your have the WRONG URL for the action attribute in your Form codes:

You need to put your sendlink.cgi script in your main LINKS cgi-bin directory where all your other .cgi files are like add.cgi, modify.cgi scripts are located in order for the following codes to work!!!!

<FORM METHOD="POST" ACTION="<Û_cgi_url%>/sendlink.cgi">

You will need to either MOVE your sendlink.cgi in your MAIN cgi-bin directory OR manually edit all the FORM codes in the sendlink template files OR EDIT your $db_cgi_url variable in the links.cfg file!

Tongue

Regards,

Eliot Lee
Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Hello Eliot,

thank you very much! The script works now.

What I have to do to receive a copy of all mails on my admin email address?

Regards,

Thomas Stuenkel

PS: It seems I have to learn Perl ;-) Which book can you suggest me?

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Confirmation emails to admin have been discussed in many different contexts in this forum...Do you even try to search the forum before raising questions? Wink

Before I give you some codes...You should be aware of the following:

1) The sendlink.log already tracks responses sent to people.
2) The links.log that you should have set-up also tracks complete email messages sent through LINKS scripts.
3) Having a separate email sent to you will only add duplicate data in your account, which is not wise. In addition, it gets pretty annoying receiving tons of email addresses sent through your web forms. (Example, I used to have trigger email routines in many of my scripts, including Apache Guard, and I recieved over 500 email messages a day, which quickly filled up my mailbox directory and on some occassions, my account was freezed due to overexceeding disk space allocation.)

That said...Here is what you do:

1) Add the following variable in your links.cfg file:

Code:

# Sends Confirmation message to Admin
$db_email_confirm = 1;


2) Then add the following codes in the sub process_form routine in the sendlink.cgi file:

Code:

if ($db_email_confirm) {
&send_confirm;
}


AFTER the following codes:

Code:

if ($fields{'copy'} eq "1") {
&send_copy;
}


3) Then add the following sub-routine in the sendlink.cgi file:

Code:

sub send_confirm {
# --------------------------------------------------------
# Sends an email to the admin, letting him know that there is
# a new link waiting to be deleted. No error checking as we don't
# want users to see the informative &cgierr output.

# 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 = $fields{'sender'};
my $subject = "Suggested Internet Resource from $fields{'sendname'}";
my $msg = qq|

This is a copy of the message sent from $fields{'sender'} to $fields{'reciepient'}.

==========================================================
Dear $fields{'recipient'},

$fields{'sendname'} has recommended you view the following
Internet resource:
----------------------------------------------------
Title: $fields{'Title'}
URL: $fields{'URL'}
Description: $fields{'Description'}

* To see this link and other anthropology related
Internet resources, please visit the $build_site_title at
$build_root_url.

----------------------------------------------------
Here is their attached message:
----------------------------------------------------

$fields{'message'}

----------------------------------------------------
Remote Host: $ENV{'REMOTE_HOST'}
Remote Address: $ENV{'REMOTE_ADDR'}
Referer: $ENV{'HTTP_REFERER'}

Sincerely,

$build_site_title
$build_root_url
$db_admin_email
|;

# 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;
}


AFTER the sub send_email routine.

Good luck!

Regards,

Eliot Lee
Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Hello Eliot,

thank you for your great help!

Regards,

Thomas Stuenkel

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
You're welcome.

Regards,

Eliot Lee
Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Hello Eliot,

there is a little problem in the sendlink mod:

I have in some link descriptions words with " (f.e. "Pabst"). The mail was sent with the description WITHOUT the words after the first ".

Can you check this please?

Thank you.

Thomas Stuenkel

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
I just provided codes three days ago that clears this problem up in the add and modify forms.

*sigh*

Anyway...Add the following codes in the sub site_html_sendlink_form and sub site_html_sendlink_failure routines:

Code:

$fields{'message'} =~ s/\"//g;


BEFORE the following codes:

Code:

&html_print_headers;


Good luck...and for the benefit of novice programmers, I will add these codes in the archived files for the Sendlink Mod.

Regards,


Eliot Lee
Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Hello Eliot,

thank you for your help. I changed the script but my provider get a problem with sending mails at this time so I can try it later.

I searched for your posting with this problem in the add.cgi and modify.cgi but I can not find this!?

Regards,

Thomas Stuenkel

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
What fields are they having a problem????

You could simply add the following codes in the sub site_html_mailer_form AND sub site_html_mailer_failure BEFORE the &html_print_headers codes:

Code:

$fields{'sender'} =~ s/\"//g;
$fields{'email'} =~ s/\"//g;
$fields{'recipient'} =~ s/\"//g;
$fields{'recipmail'} =~ s/\"//g;


In Reply To:
I searched for your posting with this problem in the add.cgi and modify.cgi but I can not find this!?
Well...I have basically re-posted the codes that you need to alleviate the PROBLEM!

IF the above suggested codes DO NOT solve your problems...then I don't know what to tell ya...because this Mod works just fine!!

Best of luck!

Regards,


Eliot Lee
Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Hello Eliot,

I changed the site_html_templates.pl like this:

# Beginn Modifikation sendlink
# ----------------------------
sub site_html_sendlink_form {
# --------------------------------------------------------
# Send Recommend Form

my %rec = @_;
$fields{'message'} =~ s/\"//g;
&html_print_headers;
print &load_template ('sendlink_form.html', {
%rec,
%in,
%globals
});
}

sub site_html_sendlink_failure {
# --------------------------------------------------------
# Recommend Error

my ($errormsg) = shift;
if ($fields{'copy'} eq "1") {
$checkbox .= qq|<input type="checkbox" name="copy" value="1" CHECKED>|;
}
else {
$checkbox .= qq|<input type="checkbox" name="copy" value="1">|;
}
$fields{'message'} =~ s/\"//g;
&html_print_headers;
print &load_template ('sendlink_error.html', {
error => $errormsg,
recipient => $fields{'recipient'},
recipmail => $fields{'recipmail'},
sendname => $fields{'sendname'},
sender => $fields{'sender'},
message => $fields{'message'},
ID => $fields{'ID'},
Title => $fields{'Title'},
Description => $fields{'Description'},
URL => $fields{'URL'},
checkbox => $checkbox,
%in,
%globals
});
}

sub site_html_sendlink_success {
# --------------------------------------------------------
# Recommend Thank you

my %rec = @_;
&html_print_headers;
print &load_template ('sendlink_success.html', {
recipient => $fields{'recipient'},
recipmail => $fields{'recipmail'},
sendname => $fields{'sendname'},
sender => $fields{'sender'},
message => $fields{'message'},
ID => $fields{'ID'},
Title => $fields{'Title'},
Description => $fields{'Description'},
URL => $fields{'URL'},
copy => $fields{'copy'},
%rec,
%in,
%globals
});
}
# --------------------------
# Ende Modifikation sendlink

But the problem is same: words after " will not been sent in the eMail message. What can be the reason? Frown

Thank you for your help.

Thomas Stuenkel

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Is the problem with single quotation marks- ' ' OR double quotation marks - ""???

Regards,

Eliot Lee
Quote Reply
Re: Problems with Mod "Sendlink" In reply to
The problem is with double quotation marks - ".

If there a single quotation mark - ' the words are sent but without the single quotation mark(s) in the eMail.

Regards,

Thomas Stuenkel

Quote Reply
Re: Problems with Mod "Sendlink" In reply to
Welp...don't know what to tell ya...

Sorry.

Regards,

Eliot Lee