[pmwiki-users] blog comments (was: pagelist formats and orders)

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 21 16:16:23 CST 2006


On Tue, Feb 21, 2006 at 04:48:14PM -0500, Bronwyn Boltwood wrote:
> My point was that PmWiki can't yet generate the same format of recent
> comments listing as most blog engines do, namely "<Commenter> on <Post
> Title>". There's no simple way in PmWiki to do a feed like:
> 
> 	!!!!!<Commenter> on <Post Title>
> 	<full text of comment>
> 	
> 	!!!!!<Commenter> on <Post Title>
> 	<full text of comment>

I guess I had better answer before things get too out of hand... :-)

I'm expecting to do markup as something like:

    ---- Commenter on Post Title (date) ----
    <full text of comment>

    ---- Commenter on Post Title (date) ----
    <full text of comment>

Or, it may be:

    >>comment<< 
    Commenter on Post Title
    <full text of comment>

Or perhaps

    [[#comment-200602211605]]
    !!! Commenter on Post Title
    <full text of comment>

> The fundamental problem is that PmWiki doesn't have the concept of
> comments as entities in their own right that are associated with a
> bigger entity, the post upon which they comment.  

However, PmWiki *does* have the concept of sections within pages, 
as in [[#anchor]].  Thus, one could reference just the comment
above with an anchor, or by using (:include <page>#comment-200602211605:).

> They should be stored separately from posts, even though they are
> associated with specific posts.  

I'm not planning to force any particular storage organization on
people.  There will be a way to add comments directly to the current 
page, a way to add comments to a "-Comments" page based on the current
pagename (this will likely be PmWiki's default), and a way to create 
a separate unique page for each comment.

> Comments are counted.  Archives often show how many comments each post
> has.  Sorting the list by number of comments would be nifty -- I
> haven't seen that feature very many places.

Pages will have a "comments" page attribute on them, which will
essentially count the number of comments in the page (as determined
by whatever markup identifies a comment).  Thus, one will be able
to use {$NumComments} to determine the number of comments for a page,
as well as be able to use order=comments or order=-comments in a
(:pagelist:) to sort pages by the number of comments.

> Comments have metadata, and skin authors will want style hooks for it.
>  The comment ID number is one such piece of metadata.  The date and
> timestamp, and the commenter's name are essential.  

This will probably be tied into the markup somehow -- I haven't
decided what that will be just yet.

> Comments need to have some spam protection.  We should be able to turn
> on URL approval for comments (separately from the wiki) and/or limits
> on number of links per comment.  

Turning url approvals on/off for comment page is already easy to do.
Limiting the number of links per comment is a bit more difficult --
probably won't be in the first version (and perhaps never unless
someone writes a recipe for it).

> Setting a time limit for when
> comments can be made -- e.g. "up to 6 weeks after the post is created"
> -- is another common method.
> -- I don't think we have any of this.

This is also easy to do -- we just get the creation time of the post
and lock comment pages for editing after a given time period.  
Essentially it'll be something like:

    # get the name of the comment page's original post
    $postname = PageVar('{$CommentBase}', $pagename);

    # get the time that post was created
    $postpage = ReadPage($postname);
    $ctime = $postpage['ctime'];

    # Block edits after 42 days
    if ($ctime < $Now - 42 * 86400) $EnablePost = 0;

Pm




More information about the pmwiki-users mailing list