My work, my ideas, my faith, my life

Forum Restrict

My New WordPress Plugin

By Rex Goode

Forum Application ScreenIntroducing my new WordPress plugin, Forum Restrict. made to function as a companion to the bbPress bulletin board system. It solves a problem that I have encountered in needing to restrict access to certain forums on my web sites to certain users. While bbPress provides for the functionality to make a “private” forum. What this means is that you have to be logged in and have a certain role assigned to you on the site. It isn’t quite what I needed. I wanted a way to have a forum administrator have the functionality to mark certain forums as restricted, add and delete members of individual restricted forums, search for users to add, and allow users to make application to be admitted to a certain forum.

The process for doing all of that could be done in steps manually by adding new user roles, assigning them to individual users, and restricting current private users to those roles. It would have not only been too complicated for average users, but too much work for an administrator.

To illustrate, without Forum Restrict, to create a private forum and only allow certain users access to it, you would have to do the following:

If you are looking for a good PHP/Javascript/MySql (and many other systems) developer, take a look at my resume. I am available for small to large contract work. I am open to full-time employment. Let me know if you need me.
  1. Create the forum.
  2. Mark it as “Private”.
  3. Create a role that has access to private forums or add the capability to read private forums to existing roles. This functionality doesn’t automatically come with bbPress. You would have to find a plugin that does that.
  4. After this much work, you still have a private forum that is restricted to certain roles. The problem is, all private forums are accessible by such persons, unless you create new roles and new capabilities that are forum-specific. You would have to find a way to create capabilities them that are specific to individual forums and figure out a way to tie that capability to the forum.
  5. Assuming you don’t want to do step 4, which would leave it so that certain users could read private forums and all of the other users could not. It would not solve the problem of having certain users using certain forums.
  6. To add to the problem, if a user wants to join a certain forum, how do they let you know? You could do the most inadvisable thing and publish your email address on your website. If you like getting slammed by spam, go ahead. You could download a plugin that has a contact form, which I do advise. That way, your address is hidden from people who want to email you from the site. Even then, it is a much more manual process to oblige these requests.
  7. Once you figure out that a person wants to be admitted to private forums, you have to change their role, which is doable through their user profile record, which you, as admin, have access to do. It’s a multi-step process.

With Forum_Restrict, you do the following:

  1. Create the forum.
  2. Mark it as restricted by Forum Restrict.
  3. A user sees the forum and an “Apply” link which takes them to a form where they enter the reason they want to join.
  4. You go to the Forum Restrict administration page and will see all of the applications to join the forum in one list. With one click, you make them a member of the forum or deny their application.

You can also:

In one screen, search for members by username, email address, or display names. With one click on the same screen, you can add or remove them from the forum.

Up to now, all WordPress plugins I have written have had very specific uses for my web sites, not applicable to other web sites. Because of this, I haven’t yet figured out how to make my plugin available on the WordPress plugin directory. While I work on that, let me know if you want to try it out. You will need to have a WordPress web site with the bbPress plugin installed and activated. Use the “Contact Us” link on the web page to get a copy. Let me know if you want it in a zip file or a tar file. Your feedback is welcome.

In addition to uploading it to the WordPress  plugin directory, I will be writing some documentation which will guide you through the screens (all two of them) and the small changes to existing bbPress screens (all two of them). I will also create a forum here for dealing with feedback and problems. Look for both.

Some of the Technical Info

See my article, True to Form, on this site for my description of using Ajax. The entire administration screen for Forum Restrict is based on the Ajax technology as described in that article. A lot happens without ever reloading the page. You move people around and the changes you make show up fairly instantly.

I made use of several WordPress and bbPress filter and action hooks to insert my functionality into existing screens and forms.

3 people like this post.

Leave a Reply

If your comment is a support question, please post it at the forums.