Modifications of MailUrl and Htmlext for MULTIPG

1997-11-13 09:07:35
Hi there,

I tried to get different mailto links on the message pages and did so with
<MAILTOURL> tag. But I think the visible mail address should not get
Additionally, since this mailto is for replying to the present mail, it
would be
nice to have a "Re: " in front of the subject if not already present.

So I did some modifications to the MailUrl subroutine in mhonarc (2.1.0):

sub mailUrl {
    local($x) = @_;
    local($to) = (&urlize(shift));
    local($url) = ($MAILTOURL);
    local($subjectl, $froml, $msgidl) =
         (&urlize($sub), &urlize($from), &urlize($msgid));
    $url =~ s/\$FROM\$/$froml/g;
    $url =~ s/\$MSGID\$/$msgidl/g;
    if (substr($subjectl, 0, 8) eq "Re%3A%20") {
        $url =~ s/\$SUBJECT\$/$subjectl/g;
        $url =~ s/\$SUBJECTNA\$/$subjectl/g;
    } else {
        $url =~ s/\$SUBJECT\$/Re%3A%20$subjectl/g;
        $url =~ s/\$SUBJECTNA\$/Re%3A%20$subjectl/g;
    $url =~ s/\$TO\$/$to/g;
    qq|<A HREF="$url">$x</A>|;

I am not a Perl programmer (oh, no... ;-), so there may be a better way to
do what I wanted.
I look forward to your comments. Maybe the Re-hack should be optional. (And
$x isn't a nice
name for a variable...)

Another one: The <HTMLEXT> tag is ignored for all except the first index
pages in <MULTIPG>
mode. My fix: Replace 

#                              ${IDXPREFIX} . $PageNum . ".html";
                               ${IDXPREFIX} . $PageNum . "." . $HtmlExt;

in sub write_main_index and write_thread_index. Hope that's right - it works
for me.

Bye, Jens

Jens Chr. Bachem, Hexmac International (
E-Mail jens(_at_)hexmac(_dot_)com, Phone 0049 221 5625969 (Cologne, Germany)
PGP-fingerprint: 71 5B CB 10 54 22 FE 30  E5 B4 F5 2A 4A 41 0A 01

<Prev in Thread] Current Thread [Next in Thread>