Let’s say you’ve created a membership website using Pilotpress (Ontraport’s WordPress membership plugin) and you would like to add a member forum. But you don’t just want a members-only forum (though you want that too) , you want to add multiple forums and/or sub-forums and have them be accessible only to certain Pilotpress membership levels–i.e., each forum/sub-forum can only be accessed by members in one or a few select Pilotpress membership levels.
When my company was still using the Wishlist Member membership plugin, the least expensive forum option we could find to work with WordPress and Wishlist Member was SimplePress. So, that’s what we used.
Upon moving from Wishlist Member to Pilotpress for our member website, we weren’t sure if SimplePress would still be our best option…though it would be easiest if we *could* make it work so we wouldn’t have to spend time configuring a new forum and trying to move posts and users to it.
Giving Pilotpress users access to SimplePress wasn’t a problem because new PilotPress logins generate new WordPress logins, and you can have SimplePress automatically assign new WordPress users/subscribers access to one or more forums.
The problem is you can only select one group to assign them to–i.e., you can select one group for all new members/subscribers to be assigned to.
But what if you want different Pilotpress membership levels to be assigned to different groups?…with only certain groups having access to certain forums/sub-forums? If we could come up with a way of doing this, we could continue to use the SimplePress forum plugin.
After digging into the SimplePress plugin code and doing some tests with the shortcodes provided by the PilotPress plugin, we developed a solution.
First, we had to come up with a way to assign the currently logged in user to a previously set up SimplePress user group using a shortcode. So I developed a WordPress plugin that does just that. The shortcode it makes available looks like this:
..where id is the ID of the SimplePress group you want the user added to (the SimplePress group IDs are listed in SimplePress’s admin interface).
Second, we had to set up a way to assign users to SimplePress groups depending on their PilotPress membership level. We determined it could be done in conjunction with the PilotPress plugin in two ways:
- If there is a base/home page that only someone in a certain membership level can get to, and it’s a page that all users in that membership level have to pass through to get to any other of their protected pages, the “add_to_sp_group” shortcode can simply go on that page, and they’ll be added to the appropriate group upon visiting this page.
- The second method involves using the [show_if has_one=”Many,levels”] content [/show_if] shortcode provided by Pilotpress, on a page that all users logging into the member website have to pass through on their way to any other page in the membership website. For example:
[show_if has_one=”Gold”] [add_to_sp_group id=”3″] [/show_if]
…will assign the user to the SimplePress group with ID=3 if they are in the “Gold” Pilotpress membership level.
There is also a [remove_from_sp_group id=”3″] shortcode we made available in case there’s a reason to remove someone from a SimplePress group (for example: they moved to a new higher level membership and should not be participating in the forum at the lower membership level anymore).
BuddyPress Now Included Too!
Someone requested I include code in the plugin that works with the BuddyPress forum plugin. It turns out to be similar to what was needed for SimplePress, so new shortcodes for BuddyPress have been included too.
The new shortcodes are very similar to the shortcodes for SimplePress, except they use the abbreviation “bp” instead of “sp”. So, for example, to add someone to group with ID=4, you would use the following shortcode:
The requirements to make this work are:
- A WordPress website
- An Ontraport account
- Pilotpress installed at your WordPress website
- SimplePress or BuddyPress installed at your WordPress website
- The Forum Group Assign plugin installed* at your WordPress website
- The creation of some forums or sub-forums and some groups in SimplePress or BuddyPress, along with assigning specific groups to specific forums
- The creation of Pilotpress membership levels in Ontraport for the WordPress website
Once you’ve got all of these elements in place, you can start using the Forum Group Assign shortcode as described above.
If you find this plugin useful and would like to encourage me to provide other useful plugins for Ontraport and Pilotpress, please consider sending your appreciation to my PayPal account
( $5 / $10 / $15 )
*Installing a downloaded zipped WordPress plugin file:
From the WordPress plugin menu click on Add New:
Instead of searching for a plugin you can directly upload your
plugin zip file by clicking on Upload:
Use the browse button to select the plugin zip file that was downloaded, then click on Install Now. The plugin will be uploaded to your blog and installed. It can then be activated (find it on the Installed Plugins page and click the “activate” link under the plugin called “Forum Group Assign“).