Comment Moderation, First Source Release
Although I've been toiling away at numerous things related to dot.kde.org I haven't been able to show too much of it yet and I figured I could do a little something.
So, I'm doing the first release of the comment moderation module I've been writing. Is it dirty? Yes... Does it get the job done? Yes... Most of the code is just related to adding in the necessary links, styling, and feedback. It's possible that I'm not following The Drupal Way (tm) and if I find that I'm not, everything will be rewritten (or at least parts).
Without further ado, here it is.
It is released under the GPLv2. It also requires the Voting API module to work, and it requires a 6.x Drupal core. I've found that it works with my test set up, and I'd love to know that it works with others. So I would greatly appreciate if anyone tests it.
It is important to note, this is alpha code, it has bugs, it is missing features, this will change in the future. Bugs I'm concerned about right now, missing features not as much. Why? There are a lot of things that can be done with comment moderation, and for now I want to have a system that definitely works. Features will be added as time goes on. Since this is a nice centralized web site (and also thanks to Drupal), deploying new features will not be a problem.
If you have any bug reports, or comments about the code, please comment on this post.
Are you planning on
Yep
Bugs / Whishes / Etc.
oh I see, you marked that as todo in the code
other notes:
So far so good. If you need help or something, get in contact with me: mail@milianw.de
Thanks
Alright, took out the debugging statement, so no devel dependency. I really need to find some kind of build tool to removing debugging statements.
So voting for anonymous users, this one is tough, but Voting API does has some mechanism built in for it. However it is still very problematic, and so I may just prevent it altogether.
Removing the promote/bury actions on the fly shouldn't be a problem.
Score updating may be difficult. This is part of the larger set of problems I've been having because I don't know The Drupal Way (tm) to do this. Using hook_comment I can add fields to the comment object before rendering (such as score), but there isn't necessarily a way to determine then that the comment has been modified in such a way, which makes for more than just a nice drag and drop install of the module (since templates would have to be modified). I think the route to go is to add new comment types and ship templates for them with the module. However, I have no idea how to do this.
Good input on the showing of hidden comments, I hadn't even though about this, but it shouldn't be a problem. Working AJAX in to Drupal can be a pain, but the benefits are really amazing.
_comment_moderation_cast_vote directly takes arguments from the URL being entered, so a bool wouldn't work out that well. Also, in the future I would like to make voting a little more customizable by site administrators so they can do it their way, so there will be more than just +1 and -1.
I'll take a look with coder, but I may be using some of the newer (D7) coding practices which coder hasn't been updated for.
It's great to hear that is works with mollom! I'll have to look into it some more, but I don't really want to force the e.V. into paying money for mollom if that ends up happening in the future. Maybe a little love for KDE since we're a FOSS project? Maybe I'll talk to Dries, but I don't want to seem like a beggar.
Thanks for the comments, I'll getting working on the javascript to pull off some of this magic!
Templates
I'm not sure whether I understand you correctly, but templates / themable function should be no problem at all. For example do a `grep -R "function theme"` in your module directory. All of these functions are themable afair.
Your other points are all valid.
Some more thinking
I'll have to do some more thinking about this. The themeing system is definitely one of my weak spots as I am usually a backend hacker.
But I think that using hook_theme() I can implement some default comment templates with my additions.
Progress