MoinMoin PageComment Macro
Note: See MacroMarket/PageComment2 for Release 2
A comment board utility written by SeungikLee and implemented as a MoinMoin macro.
Contents
Features
Simple usage, just put ``!PageComment on any page.
- Lets anonymous users post a new comment with an input form.
- Shows a list of the posted comments.
- Support for comment deletion by given password.
- Support for administrative actions, e.g.,
- to delete a comment without entering a given password
- to restore a deleted comment
- to show the host IP address where a comment is posted
Platform Support
PageComment 0.80 Tested on/with:
MoinMoin 1.35
- Windows XP
- Python 2.4
- ascii/non-ascii characters (e.g., Korean)
Installation Guide
Download the latest PageComment.py macro and place it either in your global macro directory (MoinMoin/macro) or preferably in your local macro directory (yourwiki/data/plugins/macro).
Do not forget to rename the downloaded .py file. For example, you should change the file name 'PageComment-081.py' to 'PageComment.py'.
Usage Guide
- Place the following code on any wiki page:
[[PageComment]]
- You should see an input form to post a new comment.
- After posting comments, you can see a list of the comments for the page.
Parameters
- Not provided yet
Download
v0.82 PageComment-082.py PageComment-082-tw.py (untested, use diff -u)
Sorry, I'm ashamed of myself for these codes, I've not used python before and it's my first wiki too. Thanks so much for your lesson -- SeungikLee 2005-10-28 14:46:07
v0.81 PageComment-081.py
v0.80 PageComment-080.py
Change Log
Oct. 08, 2005 - Version 0.82
- Changed the directory the data file stored to be secured
Oct. 07, 2005 - Version 0.81
Unicode encoding related bugs in deletecomment function are patched.
- Instruction bugs are patched.
Oct. 06, 2005 - Version 0.80
- The initial version is released.
Sample & Screenshot
FAQ
- N/A
To do list
(2005-10-06 12:01:53)
- To handle the index overflow (*)
- To pre-fill the name input field with his/her login name (*)
- To provide selective options for:
- formatting text or form (*)
- selecting columns to be shown (*)
- selecting a list of comments by a given ID not just page name (**)
- To encrypt/decrypt the entered passwords (****)
To give more friendly message or instructions (*)
- To provide an option to remove a comment permanently (***)
- To receive a confirm before deleting a comment (*)
- To insert an emotion icon (**)
- To add log entry at add/delete comment (done and will be posted; you can see at the recent changes of sample site)
Discussion / Support / Request / Contribution
bug reports, any suggestions are welcome! -- SeungikLee 2005-10-06 11:22:33
Great idea. I just installed it, and it works great. -- RichardHiers
I found out that there is a bug on handling non-ascii characters. In the end of deletecomment function, it should write u'o' and u'x' not just 'o' and 'x' in order to swap the status of the comment. I'll reflect this in the next version. -- SeungikLee 2005-10-06 15:08:26
I haven't tried this yet, but this looks great! I was starting to program something like this, but I was months away from anything real. Thanks! I will give some real feedback after I install it at work. -- TimCera 2005-10-06 20:27:42
First this is a really useful looking macro. The bug report I have is for Python 2.3.5 on Debian Linux. I get an error message during the add comment of "Failed to add the comment (internal error)". It fails someplace in the addcomment() function I think. If you have any suggestions, I'd love to hear them. 10-27-2005 mcgarrah@mcgarware.net
sorry for buggy macro. I'm not good at python so I cannot recognize what the problem is. Please try to re-run with commenting out the exception handling blocks to get the detailed error message. -- SeungikLee 2005-10-28 04:18:51
I'm running under Python 2.3.5 on mod_python 3.1.x in Debian. mod_python may be part of the problem. The apache logs didn't show much. I did trace it down to the files are being created but nothing is being saved into them. They are zero length. If I get it further narrowed down, I'll post it here. Thanks, 2005-10-28 mcgarrah@mcgarware.net
- Collecting ideas on changing this macro to use normal wiki page (i.e. comment page) for managing the comments. There are some issues:
to hide password (give no access on the comment page using acl All: ?)
remove the comment item (search & remove the item entry)
- how to add log entry on editing the comment page
- My scratch for that is:
- using a special parser to separate each entry of the comments. e.g.,
{ { {#!pagecomment ## [password] [name] [date/time] [location] [multi-line content] } } }
- Anybody can give a hint for that?
MoinMoin should be able to authenticate users for you. MoinMoin knows who I am when I login, and can detect it in some way since there are links to my page and user preferences. PageComment would only have to make sure that wherever comments are stored, that they can't be tampered with. -- TimCera 2005-11-02 14:26:29
I think that this macro is useful in the BlogNature. Most comments in a blog, there could be more anonymous users' rather than registered wiki users'. For example, I'm using MoinMoin as my personal home, and I disallow user registration on that. In the blog of my homepage, I want to receive some comments on the article from any anonymous users. If this macro does not allow to delete the comment posted once, anyway, that would be more simple. -- SeungikLee 2005-11-02 15:19:09
Instead of PageComment storing messages together in one place, how about in sequentially numbered sub-pages. That way ACL could be assigned by PageComment for each subpage. -- TimCera
I think this macro is a really great idea. I found the same problem as mcgarrah. I'm using DesktopEdition. The problem seems to be with the statement macro.request.user.host(). I replaced this with '0' and the problem went away. There is also another problem: If you post a comment and then refresh the page, you get a duplicate comment. Any ideas how to fix this? -- AndrewFerris 2005-11-15 22:48:29