After looking at all the different possibilities for integrating phpbb with drupal, I gave up because none of them were as tight as I wanted (for good reason -- phpbb assumes a lot about its users table -- it would take a lot of hacking to get it to accept drupal's users table as a substitute). So I just switched to using drupal's forums. One of the things that I sorely missed was being able to assign moderators to the forums.
Here's a patch that creates another node.module role "toggle nodes sticky". Users with that role can toggle the "sticky at top of lists" flag on nodes, which in forums, makes items show up at the top of forum topic listings, similar to the "announcement" or "sticky" functionality in common BB software.
Index: modules/node.module
===================================================================
--- modules/node.module (revision 5662)
+++ modules/node.module (working copy)
@@ -580,7 +584,7 @@
* Implementation of hook_perm().
*/
function node_perm() {
- return array('administer nodes', 'access content');
+ return array('administer nodes', 'access content', 'toggle nodes sticky');
}
/**
@@ -1614,6 +1618,7 @@
* Node author information
*/
+ $sticky_form_element = array('#type' => 'checkbox', '#title' =>t('Sticky at top of lists'), '#default_value' => in_array('sticky', $node_options));
if (user_access('administer nodes')) {
$form['author'] = array('#type' => 'fieldset', '#title' => t('Authoring information'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => -5);
$form['author']['name'] = array('#type' => 'textfield', '#title' => t('Authored by'), '#maxlength' => 60, '#autocomplete_path' => 'user/autocomplete', '#required' => TRUE, '#default_value' => $node->name, '#weight' => -1);
@@ -1628,9 +1633,12 @@
$form['options']['status'] = array('#type' => 'checkbox', '#title' => t('Published'), '#default_value' => in_array('status', $node_options));
$form['options']['moderate'] = array('#type' => 'checkbox', '#title' => t('In moderation queue'), '#default_value' => in_array('moderate', $node_options));
$form['options']['promote'] = array('#type' => 'checkbox', '#title' => t('Promoted to front page'), '#default_value' => in_array('promote', $node_options));
- $form['options']['sticky'] = array('#type' => 'checkbox', '#title' =>t('Sticky at top of lists'), '#default_value' => in_array('sticky', $node_options));
+ $form['options']['sticky'] = $sticky_form_element;
$form['options']['revision'] = array('#type' => 'checkbox', '#title' =>t('Create new revision'), '#default_value' => in_array('revision', $node_options));
}
+ else if (user_access('toggle nodes sticky')) {
+ $form['options']['sticky'] = $sticky_form_element;
+ }
$nodeapi = node_invoke_nodeapi($node, 'form');
if (is_array($nodeapi)) {
I'll probably be posting more patches that I have running on my site on this thread. My eventual goal would be to have them checked into CVS, so that I don't have to maintain them.
Comments
Excellent...
Awesome! This is exactly the type of stuff we need to make Drupal forums killer! Drupal forums are good, just need a lot of functionality added.
--
Please read the handbook, search the forums, then ask...
http://drupal.etopian.net (Drupal Support)
This is great, except you
This is great, except you will want to create and attach the patch to the Drupal project as an issue so that others can review and comment on them.
Some links
contributing
patches
Creating
As this is a feature, I 'think' that you will want to do it here.
They will quite simply get lost here in the forums.
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
don't get it...
Got a screenshot?
---
http://raszl.net
Screenshot
Unfortunately, a screenshot of this particular patch would only make sense if I also gave you moderator permissions. The forums I'm running are at
http://treehouse.ofb.net/go/en/forum
if you'd like to see where I'm at.
moderators can now lock/unlock topic; delete/edit comments
As far as them getting lost, they may very well get lost in the issues repository too from what I've seen of some of the other issues that I've submitted. ;) By posting in the forums at least I can keep all the things together on a single node for people that find this via search. If you'd like to help me advocate for these things getting in, please do. I would much prefer not having to maintain all sorts of patches on top of base drupal -- it makes it such a headache to upgrade.
Patch #2, which you can find here:
http://drupal.org/files/issues/35726_0.patch
fixes some other outstanding issues I found with the comment module, and introduces one more permission, "edit or delete comments". By assigning a forum moderator this permission, you can allow them to do everything *content-related* that a comment administrator can do. In particular, they can edit, approve, disapprove, or delete comments, as well as change a node's comment type from
* disable (phpbb doesn't have an analogue to this, and i find it a bit redundant myself, since you could easily emulate it with read-only, but trying to remove it looked like a hassle)
* read-only: "locked topic"
* read-write: normal unlocked topic.
What they can't do is change the default settings for comments like expanded/collapsed, or other purely administrative functions.
as an aside, that patch (and
as an aside, that patch (and for now, any of my own updates to it), can be found via: http://drupal.org/node/35726
If you have a preference for it going in, feel free to add a comment there as well.
Another patch
this one allows you to set a icon for whether or not there are new posts in each forum.
http://drupal.org/node/40575
one more, which shows you a
one more, which shows you a "views" column if you have the statistics module turned on.
http://drupal.org/node/40580
The patch in the original
The patch in the original post can be found in the issue tracker against current CVS at:
http://drupal.org/node/40557
Drupal 5 Module
It's now possible to create the sticky moderator permission in Drupal 5 with a module.
Wesley Tanaka | Drupal Stuff