I think it could be a useful addition, integrate Adv_forum with ACL/Forum Access and display forum moderators under forum list.

i think it could be a user list by role (e.g: list all users who have "Global Moderator" role, customizable).


list all users which are moderator on a single Forum.

(sorry for my hyper-bad english).



Michelle’s picture

Status:Active» Closed (duplicate)

There is already an issue for this in the forum access queue.


__Sander__’s picture

Status:Closed (duplicate)» Active

Sorry for reopening, but I've got a solution for you (everything in the forum access module is ready)

Here is the solution:

1) The task of the moderator submodule is only to switch
variable_set('forum_access_provide_moderators_template_variable', TRUE);
when being turned on and to FALSE when being turned off.

2) The default theme should call in the beginning


If the submodule is off, this function is save and does not consume time.

3) After forum description insert this:

                if (sizeof($moderators)>0) {
                    foreach ($moderators as $uid => $muser) {
                        $moderator_output[]='<a href="/user/'.$uid.'">'.$muser->name.'</a>';
                    echo('<div class="moderator-list">'. format_plural(count($moderators_links), 'Moderator:', 'Moderators:'));
                    $output=implode(', ',$moderator_output);
                    echo(' '. $output .'</div>');

4) Some css styling? (not done yet)

A working example: http://help.sander.su/

Michelle’s picture

Version:6.x-1.x-dev» 6.x-2.x-dev

This is one time I don't mind a duplicate issue being re-opened because I did say to toss it back to my queue once the FA end was done. Not sure when I'll be able to get to this as I'm trying to finish the stuff that's already in progress to get Alpha 4 out. It will likely be after that.


__Sander__’s picture

Anyway I've made it in my forum template, so it's already working for me. And anybody who is in a hurry might follow my guidelines.

__Sander__’s picture

new1.85 KB

Would you consider adding it to alpha 4?
Or it is already too much work to be done before?
After the latest change in the forum-list template my code got outdated.
I've made a patch for that template.
It now checks whether the forum_access is on, and if so, displays the list under the description

Michelle’s picture

Alpha 4 is up in the air at this point since I'm leaving for DrupalCon in 2 hours. We'll see what my time looks like when I get there.


Michelle’s picture

Status:Active» Needs review

There's code, so setting needs review.

mcdruid’s picture

new2.36 KB

Rewritten patch which lists moderators in the forum list, and provides a checkbox to control forum_access_provide_moderators_template_variable in the AF admin settings.

If Forum access module wanted to do this (the admin setting), that'd be fine.

Ony’s picture


Bringing this back up to say the patch doesn't work properly.

I get the check box in the AF settings, and that works, but on the forum itself, it doesn't open anymore, instead this error is thrown:

Notice: Use of undefined constant uids - assumed 'uids' in forum_access_preprocess_forum_list() (line 501 of /home/../../sites/all/modules/forum_access/forum_access.module).
Warning: array_flip() expects parameter 1 to be array, string given in DrupalDefaultEntityController->load() (line 178 of /home/../.../includes/entity.inc).
Warning: Invalid argument supplied for foreach() in DatabaseCondition->compile() (line 1854 of /home/../.../includes/database/query.inc).
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 1: SELECT base.uid AS uid, base.name AS name, base.pass AS pass, base.mail AS mail, base.theme AS theme, base.signature AS signature, base.signature_format AS signature_format, base.created AS created, base.access AS access, base.login AS login, base.status AS status, base.timezone AS timezone, base.language AS language, base.picture AS picture, base.init AS init, base.data AS data FROM {users} base WHERE (base.uid IN ()) ; Array ( ) in DrupalDefaultEntityController->load() (line 196 of /home/../.../includes/entity.inc).

The file locations its complaining about is odd since I didn't even touch any of those files. Any suggestions on how to fix this?

It's worth pointing out that I'm using the stable D7 release and not the dev version.

mcdruid’s picture

@Ony this is a 6.x-2.x issue so I'm surprised the patch applied at all, but not that it didn't work :)