Gossamer Forum
Home : Products : Links 2.0 : Customization :

Send Message

Quote Reply
Send Message
I want to add a link 'Send Message' in the links.html template. When the link 'Send Message' is clicked a Form - sendmess.html shows. This form has the following fields - Name, Email, Address & Message etc. The receipient field is <%Contact Email%>. The form will be submitted using Matt's Formmail.pl script. What modifications need to be done to get the value of <%Contact Email%> in sendmess.html page/template.
Quote Reply
Re: [bigpatsu] Send Message In reply to
Nice Idea. I would love to do that as well. Anybody there to help us both ?
>> Nakul Goyal (SEO, Link Building Expert)
Web Site Promotion
Tips 'n' Tricks
SEO News


Quote Reply
Re: [bigpatsu] Send Message In reply to
I would highly recommend against using Matt's Formmail.pl script. Links has its own mail processor anyway (Mailer.pm). Have a look at nph-email.cgi to see how to send emails. as far as getting data into a template, you can do something like:

Code:
#!/usr/local/bin/perl
BEGIN {
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1");

require "links.cfg";
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";
require "$db_lib_path/Mailer.pm";
};
}

eval { &main; };

$@ and &cgierr("Fatal error: $@");

exit;

sub main {
my (%in) = &parse_form();
my (%rec) = &get_record($in{"ID"});

if (! defined $rec{"ID"}) {
&cgierr("record " . $in{"ID"} . " not found");
}

my $output = &load_template("sendmess.html", { %rec, %globals });

print "Content-type: text/html\n\n";
print $output;
}

note that this is untested...

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Send Message In reply to
Getting the following error:

CGI ERROR
==========================================
Error Message : record not found
Script Location : /cgi-bin/links/admin/sendmess.pl
Perl Version : 5.00503
Quote Reply
Re: [bigpatsu] Send Message In reply to
did you link to like you would with jump.cgi? ie, foo.cgi?ID=<%ID%>

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] Send Message In reply to
I did this:
<a href="<%db_cgi_url%>/admin/sendmess.pl?ID=<%ID%>" Target="_self"><b>Send Message</b></a>

sendmess.pl contains the script you wrote.

Now getting the following error:
Unkown Tag: build_root_url
Quote Reply
Re: [bigpatsu] Send Message In reply to
Anyone with a solution??
Quote Reply
Re: [bigpatsu] Send Message In reply to
Well, to make a new template, you will need to define a subroutine in site_html_templates for it, and you will need this in the sendmess.pl file, under the require statements:

$build_use_templates ?
require "$db_lib_path/site_html_templates.pl" :
require "$db_lib_path/site_html.pl";


The new sub would be along the lines of...

sub sendmess {
# --------------------------------------------------------
# This routine will build a send message page.

return &load_template ('sendmess.html', {
total => $total,
grand_total => $grand_total,
link_results => $link_results,
title_linked => $title_linked,
%globals
} );
}


Of course, you also need to have a sendmess.html file in the template directory.

Seems to me, anyway...Angelic


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Jan 23, 2004, 11:28 PM
Quote Reply
Re: [PerlFlunkie] Send Message In reply to
Thanks. It is working fine now.
Quote Reply
Re: [bigpatsu] Send Message In reply to
 
There is mod for link 2.0 which is used to contact the link owner through website which is very useful and can be used to send messages
Megrisoft
Web Hosting Company
India Software Company
SEO Company


Last edited by:

megri: Mar 30, 2004, 3:18 AM
Quote Reply
Re: [PerlFlunkie] Send Message In reply to
Great idea LaughLaugh

Implemented it right away