Gossamer Forum
Home : Products : DBMan : Customization :

Private e-mail mod question

Quote Reply
Private e-mail mod question
Hi,
I have run into a small problem installing the private e-mail mod.
According to the mod I need to do the following;

#file: html.pl
# sub html_record

# Just after
# my (%rec) = @_;
#
# Add
############################

$rec{$db_key} =~ s/<?.B>//g;

However as I'm using the short long html.pl the $rec{$db_key} =~ s/<.?B>//g; already appears in both the sub html_record and the sub html_record_long.

As I have the e-mail addres field only in the long record, I assume thats where to place the $rec{$db_key} =~ s/<?.B>//g; refered to in the private e-mail mod.

As mentioned above when I looked in the sub html_record_long this code already seems to be there maybe due to a previous modification.

However when I compare whats there with what is suggested in the private e-mail mod I see the following difference:

$rec{$db_key} =~ s/<?.B>//g; from private e-mail mod
$rec{$db_key} =~ s/<.?B>//g; already in sub html_record_long

So now I'm not sure which to use or both?

Just for reference I have installed the following other mods;
Secure password
Validate records
File upload

Regards,
HJ



------------------
Henk Jan Buchel
Classic Boatworld
http://classicboatworld.net
Quote Reply
Re: Private e-mail mod question In reply to
Hi Eliot and/or JPD,

I'm wondering if this question ever reached you. I do realize you have a life outside of dbman so I'm not complaining just curious.

Anyway I tried;
$rec{$db_key} =~ s/<.?B>//g; already in sub html_record_long

and it seem to work so far unless I've now placed a little time bomb waiting to go of, I hope not!

I am still curious as to the difference in code so when you have time please shed a little light on this.
Thanks again,

PS I'm also tryiny to include some fields in the e-mail that is sent. In db.cgi I tried to add a field in the sub send_email by using

$rec{'field'} and I tried $in{'field'} but both did not work with the "print MAIL" command. I suppose I need to tell the sub where to get the record?

------------------
Henk Jan Buchel
Classic Boatworld
classicboatworld.net

[This message has been edited by HJ (edited October 13, 1999).]
Quote Reply
Re: Private e-mail mod question In reply to
HJ,

Hello there. Glad to see that you are still sticking with it... Smile

Anyway, my understanding is that it is best to use

Code:
$rec{$db_key} =~ s/<?.B>//g;

Basically, having the ? character before the period will put spaces for the beginning and end tags for bold (<B></B> ). (Carol may be able to provide a more technical explanation, but I like to utilize the KISS method---Keep it Simple Stupid.)

What kind of fields do you want to add to the Private Email Form? Are these fields from your database or a completely new field?

I have added new fields in the following manner:

1) In the sub send_email routine in the db.cgi file, I have added a "Signature" field:

Code:
unless ($in{'signature'}) {
$message .= "<BR>Your signature is empty.<BR>";
}

AND

Code:
if ($in{'signature'}) {
print MAIL $in{'signature'};
print MAIL "\n\n";
}

2) In the sub html_send_email_form, I have added the following codes:

Code:
<input type="text" name="signature">

If you want to include "fields" from the record that is being sent, you have to add the following codes to the top of the sub send_email routine in the db.cgi file:

Code:
%rec = &get_record($in{$db_key});

Then you can include fields from the record to be mailed in the following manner:

Code:
print MAIL "Field Name: $rec{'FieldName'}";

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Private e-mail mod question In reply to
Hey thanks Eliot for replying!

I learned something again. First I thought =~ s/<?.B>//g; was a very secret code that I shouldnt mess with but through your explanation I get a whif of whats going on.

And the rest of your tips will be very helpful on getting the e-mail mod to work the way I want it. So now your upgraded to the boat ride with BARBECUE!

See Ya!



------------------
Henk Jan Buchel
Classic Boatworld
http://classicboatworld.net
Quote Reply
Re: Private e-mail mod question In reply to
Sounds great!

Hope it works.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Private e-mail mod question In reply to
Throughout many of the mods and delivered DBMan code, the regexp to remove bold tags <B></B> is <?.B>. In one of JPDeni's mods it is coded as <.?B>.

Although they both match <B> and </B>, isn't the "more correct" regexp <.?B> (question mark after the period)?

<?.B> says "match 0 or 1 < followed by any character...

This matches both <B> and </B>, but it also matches <<B>, nB>, etc.

<.?B> says "match < followed by 0 or 1 character...

This matches <B>, </B>, <nB>, etc.

The latter regexp just seems "safer," doesn't it?