Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: PHP if… else Help Required


_ck_
Participant

@_ck_

bbPress has a function to check for administrators.

if (!in_array(intval($GLOBALS['forum']->forum_id), array(2,5,9)) || bb_current_user_can('administrate')) { do something here }

where 2,5,9 is the list of forum numbers you want to restrict

what you are trying to do is possible but very tricky

For example the “add new” on the front page offers all the forums for posting and you’d have to write a replacement for the list (bb_new_topic_forum_dropdown)

All the “magic” happens in post-form.php, so you could take that if statement above and wrap the entire template with that (in theory).

Skip to toolbar