On October 24, 2000 at 10:44, Rodos wrote:
> Well I gave it a try with the following.
>
> <TTOPEND>
> </li>
> <blockquote>
> <pre>
> <section
> title=""
> author="$FROMNAME$"
> email="$FROMADDR$"
> subject="$SUBJECTNA$"
> archive=""
> posts=""
> startdate="$DATE(TPARENT)$"
> enddate="$DATE$"
> >
> </pre>
> </blockquote>
> </p>
> </TTOPEND>
>
> The contect of the TTOPEND seams to be the parent thread, not the last
> message in the thread, so the TPARENT comes out blank. The subject is that
Since TTOPEND is associated with the top/root message of a thread,
variable expansion is done within the context of the top message,
not the last message. To be more technical, thread output is done
via a recursive subroutine, so when TTOPEND is evaluated, you are
back to the first invocation of the subroutine, where TTOPBEG was
evaluated.
> of the top of the thread but the date seams to be inaccurate.
$DATE(TPARENT)$ probably evaluates to nothing. The code does
not properly handle the case where a message has no parent (which
should cause the message to be its own parent). $DATE$ should
expand to the date of the top message in your example (and I verified
this).
> Be nice if you could throw some perl code into the resource to do a bit of
> stuff.
This requires a user to know about the internals of MHonArc. I try
to avoid this. What I will do is add the following message specifiers:
TTOP - Top/root message of current thread
TEND - End/last message of cuurent thread
and, the following resource variable:
$MSGTORDNUM$ - The oridinal number of message within a thread
Therefore, you should be able to do the following in TTOPEND to get
the number of messages in a thread:
$MSGTORDNUM(TEND)$
Last night, I made the additions to my development copy of MHonArc,
and they appear to work.
BTW, $DATE$ gives you the raw date string of the message. You may want
to use the $MSG*DATE$ variables instead since you can customize the
formatting.
--ewh