Gossamer Forum
Home : Products : DBMan : Installation :

Problem With "Email This" Mod

(Page 2 of 2)
> >
Quote Reply
Re: Problem With "Email This" Mod In reply to
I'm sorry. It was a typo on my part.

It should be

Code:
unless ($in{'emailmessage'}) {
$in{'emailmessage'} .= "$rec{'Name of Article'}\n";
$in{'emailmessage'} .= "$rec{'Current Date'}\n";
}

I often can't tell whether something is a ( or a { with most fonts.

Sorry.


------------------
JPD






Quote Reply
Re: Problem With "Email This" Mod In reply to
Why do you insist on apologizing? You've made my life so much easier! Smile

It works great...I do have another question though (there is no end to my ignorance)...is there anyway to change the formatting in the textbox? For example, right now it prints fields out like this:

Title of Article
Author's Name
Current Date

Article

I added an extra \n to get the extra line break before the article, what I'd like is something like this

Title of article (in bold)
Author's Name - Current Date

Article

Here's the code I have in there right now:

Code:
unless ($in{'emailmessage'}) {
$in{'emailmessage'} .= "$rec{'Title of Article'}\n";
$in{'emailmessage'} .= "$rec{'Full Name'}\n";
$in{'emailmessage'} .= "$rec{'Current Date'}\n\n";
$in{'emailmessage'} .= "$rec{'Article'}\n";
}

Smile

Chris

Quote Reply
Re: Problem With "Email This" Mod In reply to
JP,

One more thing I forgot...I was hoping it could say "By" before printing out the author's name...?

Chris
Quote Reply
Re: Problem With "Email This" Mod In reply to
I always feel bad when I steer somebody wrong. And I really get upset with myself for those nasty bracket errors. But that's my cross to bear. Smile

There's no way to make text bold in an email message -- at least not that I know of. This is just straight text.

The extra linebreak should work just fine.

To print the author's name, just use

Code:
$in{'emailmessage'} .= "By $rec{'Full Name'}\n";

You can add any text you want.

------------------
JPD






Quote Reply
Question on stripping out html from this mos In reply to
JPD,

Is there a way with this mod to strip out the html from the email message and replace for example
with a line break for the email message and <p> with a double line break for the email message?

My apolgies if this is answered somewhere else already, I'm still getting used to the new forums. Which are very nice BtW.

I think I understand how to get the fields in there that we want, just need to know how to strip out the html and replace it with the relevant line breaks.

Thanks!

Kylie

Quote Reply
Re: Question on stripping out html from this mos In reply to
No, I don't think it has been mentioned before.

Before the line

open (MAIL, "$mailprog") || &cgierr("unable to open mail program");

add

$in{'emailmessage'} =~ s/<BR>/\n/ig;
$in{'emailmessage'} =~ s/<P>/\n\n/ig;


If there might be other html codes that you want to strip from the email, also add

$in{'emailmessage'} =~ s/<([^>]|\n)*>//g;

This last line will just delete the html tags and not replace them with anything. Make sure, if you use it, you add it after the previous lines.

BTW, I still haven't written back to you, have I? Often email messages get lost in my inbox, as they pile up. My apologies! Blush I'm doing okay these days. I do appreciate your asking. Smile


JPD
Quote Reply
Re: Question on stripping out html from this mos In reply to
Thanks JPD,

I'll try it tomorrow.

Hey, don't worry about answering the email -- just glad to hear you're OK :)

> >