PageComment3

I patched PageComment2 from Seungik Lee to include captchas (I actually use recaptcha). I got the impression when browsing the moinmoin pages that there is some controversity for supporting captchas (compare this link), so I added the support myself. Thanks to Seungik Lee for his great macro, which was easy enough to change. I got some feedback from Wenliang Lu to make it run under moinmoin 1.8. I will publish his version too.

Documentation

Here is the documentation from the source code (with my little additions).

Usage: [[PageComment3]]

Features:
    
    - Simple usage, just put [[PageComment3]] on any page.
    - Lets anonymous users post a new comment with an input form.
    - Shows a list of the posted comments.
    - Show a captcha from recaptcha to avoid spamming.
    - (removed this option) Support for comment deletion by given password, admin and users can still delete.
    - Support for administrative action, e.g., 
        - to delete a comment without entering a given password

RECAPTCHA_PUB_KEY and RECAPTCHA_PRIV_KEY must be defined in the global Wiki-configuration.

Parameters:

    - pagename: the page name which the comments are retrieved for. by default the page itself.
        If the user has no 'read' ACL for that page, it does not allow to insert/view comments.
        e.g., pagename=AnotherPage
    
    - section: the section name of the page. The comments in different sections are managed in separated sub pages.
        Section name should be alphanumeric format ([a-zA-Z0-9] in regular expression). 
        If not, all the non-alphanumric characters are removed.
        e.g., section=1, section=News, section=Opinion
        
    - inputonly: shows input form only. list of the comments are shown to admin users only.
        - inputonly=0; default, all list is shown to all users including anonymous users
        - inputonly=1; shown to admin users only (who has the page delete privilege)
        
    - commentonly: shows the list of comments only.
        - commentonly=0; default, both of the list and input form will be shown
        - commentonly=1; only the list of comments will be shown
            
    - countonly: returns the number of the comments posted to this page
        - countonly=0; default, normal form (input form; list of comments)
        - countonly=1; just return the number of comments. 
            e.g., 'There are [[PageComments(countonly=1)]] comments here'

    - rows: the # of rows of the textarea. default 4. e.g., rows=4
    
    - cols: the # of columns of the textarea. default 60. e.g., cols=60
    
    - maxlength: limitation on # of characters for comment text. default 0 (no limit). e.g., maxlength=500
    
    - newerfirst: order of the list of comments.
        - newerfirst=0: default, newer ones are listed at the end
        - newerfirst=1: newer ones are listed at the top
    
    - commentfirst: shows comment list before the input form.
        - commentfirst=0: default, the input form first
        - commentfirst=1: comment list first
        
    - articleview: shows comment list in an article view.
        - articleview=0: default, list in table view
        - articleview=1: list in article view

    - tablewidth: the width of the table format for PageComment3, default '' (none). 
        e.g., tablewidth=600, tablewidth=100%

    - smileylist: shows smiley options with drop-down list box
        - smileylist=0: default, a part of the smiley in radio button
        - smileylist=1: smiley in drop-down list box
    
    - nosmiley: shows no smiley
        - nosmiley=0: default, shows smiley selection
        - nosmiley=1: no smiley selection

    - notify: notifies to the subscribers of the page which includes the macro when a comment is added
        - notify=0: default, notification disabled
        - notify=1: notification enabled
        
    - markup: enables wiki markup in the comment text except some specified macros.
        - markup=0: default, use of wiki markup in the text is disabled
        - markup=1: use of wiki markup in the text is enabled and preview button is activated

- captcha: enables the captcha and anonymous comments
    - captcha=0: Switch off anonymous posts and captcha
    - captcha=1: Allow anonymous posts and display captcha if not authenticated

Code

Comments/Test

Here you can see (and use) it in action:

Please feel free to make suggestions for improvements, mention bugs, or give other encouraging comments here.
Posted by ulno at 2008-11-08 23:20:44
not working for MoinMoin 1.8, need to update. \\
1. config.smileys.keys() -> config.smileys \\
2. from MoinMoin.parser import wiki -> from MoinMoin.parser import text_moin_wiki \\
Thank you for your work. That is what I need.
Posted by anonymous at 2008-12-01 05:06:54
I am a little busy with my other projects at the moment, but I will integrate this as soon as I move myself to 1.8. Thanks for your comment, I will leave it here so others can do the patch. If you want access to this page to comment with a name and make uploads contact me directly, I will create an account for you.
Posted by ulno at 2008-12-02 15:30:23
is't or isn't working in MoinMoin 1.8?
Posted by anonymous at 2009-05-04 22:38:35
It works in 1.8 with Wenglian's code.
Posted by ulno at 2009-05-04 23:04:26
I want to use parser in commentsection. when i activate macro use, it is shown that 'wikimacro' doesn't exist. Doesn't know how define macrolist by myself. could someone help, please? (using moinmoin 1.8)
Posted by anonymous at 2009-05-13 18:33:57
I'm not using captcha. if somebody isn't logged in, there's a bug-dialog informig displayhtml is not defined. what to do for using maybe a selfdefined page?
Posted by anonymous at 2009-05-13 18:47:45
Hi, I forwarded your comment to Wenliang as I still have not updated to 1.8. If you want you can also contact me via  private mail, you find my email under contact.
Posted by ulno at 2009-05-13 18:52:38
What about:
(1) newlines?
(2) *different* _wiki_ <b>and</b> HtmlFormatting [[SomethinElse]]
(3) съешь ещё этих мягких французских булок, да выпей йаду...
Posted by anonymous at 2009-06-19 19:22:34

ulno.net: projects/moinmoin/PageComment3 (last edited 2009-08-24 21:28:14 by localhost)