mhonarc-users

Modifications of MailUrl and Htmlext for MULTIPG

1997-11-24 10:07:45
I would have to agree that I would like to see the displayed address be
a non-urlized address.  Also, you don't need to add the Re: to the
mailUrl routine, this can be done from the Mailtourl resource.

Here is how I fixed the same problem.

Part of resource file...

<Mailtourl>
mailto:$TO$?Subject=Re:%20$SUBJECT$
</Mailtourl>

Changes to mailUrl
sub mailUrl {
    local($addr) = shift;    # save original address
    local($to) = (&urlize($addr));  # urlize to address
    local($url) = ($MAILTOURL);
    local($subjectl, $froml, $msgidl) =
(&urlize($sub), &urlize($from), &urlize($msgid));
    $url =~ s/\$FROM\$/$froml/g;
    $url =~ s/\$MSGID\$/$msgidl/g;
    $url =~ s/\$SUBJECT\$/$subjectl/g;
    $url =~ s/\$SUBJECTNA\$/$subjectl/g;
    $url =~ s/\$TO\$/$to/g;
    qq|<A HREF="$url">$addr</A>|; # add mailtourl with original address
displayed
}


Bill Stoltz
Computer Network Manager
Institute for Defense Analyses
1801 N. Beauregard St. 
Alexandria, Va 22311
email: stoltz(_at_)ida(_dot_)org



Hi there,

I tried to get different mailto links on the message pages and did so with
the
<MAILTOURL> tag. But I think the visible mail address should not get
URL-encoded.
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 (http://www.hexmac.com)
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>