[pmwiki-users] commentbox q.

John Rankin john.rankin at affinity.co.nz
Wed Jul 12 19:30:47 CDT 2006


On Tuesday, 11 July 2006 3:49 AM, noskule at gmx.net wrote:
>Am Samstag, 1. Juli 2006 02:11 schrieb John Rankin:
>hi john
>I'm on the way configuring the commentbox. So I write you some 
>expiricence/suggestions.

I have refreshed my memory and will walk through the options...
>
>At default a comment looks like this:
>
>>>message<<
>!17:32 by '''[[~Admin]]'''!This is the comment title
>This is the comments sentence. This is the comments sentence. This is the 
>comments sentence. This is the comments sentence. This is the comments 
>sentence. This is the comments sentence. 
>>><<
>
>* It seams that there is either missing a "\n" at the end of
>"$MPTimeFmt" 

It is in fact correct.
The default setting uses the "run-in head" markup extension
to save space in the output. You may prefer to change it to 
something like:

"\n\n>>message<<\n''\$Time by '''\$Author''' ''"

This gives the run-in effect a different way.
>
>
>
>This are the output of the commentbox.php
>
><MPDateFmt><MPTimeFmt>This is the comment Title
>This is the comments sentence. This is the comments sentence. This is the 
>comments sentence. This is the comments sentence. This is the comments 
>sentence. This is the comments sentence.
><MPItemFmt><MPItemEndFmt>
>
>* MPItemFmt is at the end of the message. I'm wondering if it  shouldnt be at 
>the beginning of the comments sentence cause MPItemEndFmt follows right after 
>the end of MPItemFmt

The $MPItemFmt variable was introduced for people who want to put the author 
and / or time after the message, instead of before. For example:

$MPTimeFmt = "\n\n>>message<<\n";
$MPItemFmt = "\n\n%right%''\$Time by '''\$Author''' ''";
>
>So far I understand it is hard to cusomize the commentbox template cause the 
>order of the variables are fixed. Would there be a solution to have a 
>template that defines the order in wikitext format like:
>
>CommentTemplate="
>!!!! MPDateFmt
>!! MPTitleFmt
>MPCommentFmt
>$Autor, MPTimeFmt
>";
>
>grz nos
>
The intent is that the variables are sufficiently flexible that an
administrator can achieve a desired output effect. The order is:

$MPDateFmt
$MPTimeFmt
the text from the comment box
$MPItemFmt
$MPItemEndFmt

If the administrator sets $MultipleItemsPerDay = false, it uses

$MPDateTimeFmt
the text from the comment box
$MPItemFmt
$MPItemEndFmt

I quite like the idea of a comment template, but will need to
think about it. Doing the right substitutions in the right
order was very tricky to get right across all the cases. The
risk in introducing a template is that an administrator
may be able to define a template that causes the code to
break. Testing such an approach would have to be done very
carefully. The bit that requires care is handling multiple
posts on the same date at different times, with support for
either latest first or latest last posting.

This means knowing what the date format is, so the code can
determine where to insert a new comment and whether or not 
the new comment needs a date or just a time.

The code evolved as the environment changed and has perhaps
reached an evolutionary dead end -- perfectly adapted to its
niche but unable to deal with an influx of offshore predators.

One place to start could be to define the comment style you'd
like to achieve and see whether it can be implemented in the
current structure.

Hope this clarifies the way the recipe works.

-- 
JR
--
John Rankin

       \_      
        \)   
         \,\__/7
         /    /
        (   c'
         \  / 
     /,  /_/  
    |  & *   Wellington
    )  /    
   /  /,    
  /  (    
 |   /      
 \__/       
   V        







More information about the pmwiki-users mailing list