I got dismayed by politics the other day, so I decided to write some code. Code is rational. I decided to write another commenting enhancement.
On my political site I require folks to register in order to comment. Sometimes I want to throw the post open, let the world reply to specific items. So I wrote a simple module called Open Thread. It adds a checkbox to the node creation forms (immediately above the comment options so it's easy to find) which, when checked, marks the node as an open thread which anyone who can see the "New comment" link can comment on without administrative intercession. This means you can still disallow folks from commenting at all.
The attached module is Drupal 6 compatible. I wrote it first to begin the process of nudging myself toward the new version, but I got a D5 version which will go into production today. A few more enhancements will go into place, but it'll be in the D6 version...if I make the D5 version too perfect I will never move my production site.
Lotta stuff missing from what you'd need for a proper project...help text, for instance. I don't think it will ever be a project though. I think it's going to become part of a larger comment enhancing module merging a couple of my modules that I always use. Plus I'm still not up for all the free support. But until then, here it is.
| Attachment | Size |
|---|---|
| openthread.zip | 1.37 KB |
Comments
Preg_match
Only thing I would note is to remove the preg_match and replace with strpos, its conserablly faster, and seeing that every form_id would be run through that, produces a performance boost worthy of a change...
Scott
It's a thought
I guess I had regular expressions on the brain...I've been studying them so I can weed out certain access attempts using the .htaccess file.