PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Adding Roles

s2Member Plugin. A Membership plugin for WordPress®.

Adding Roles

Postby wesleysoccer » March 8th, 2011, 10:51 am

Is it possible that when a Member Level #1 or #2 join my site that I can give them a subscriber role as well (inside of WP users admin)?

This will help with my bbpress forums...So can they be given two roles each time they join my site?
Member Level #1 and Subscriber Roles...

Right now I have to maually change users roles inside of bbpress...not fun. Thanks.
User avatar
wesleysoccer
Registered User
Registered User
 
Posts: 83
Joined: January 31, 2011

Re: Adding Roles

Postby Jason Caldwell » March 8th, 2011, 8:50 pm

Whenever a Members signs up on your WordPress site, they are assigned a Role matching the type of registration that was completed. Either Level #0 ( Free Subscriber ) , or one of the paid s2Member Roles with Level # 1-4. Then, the first time they attempt to access your bbPress installation, s2Member will automatically assign them a bbPress role of "Member" on your bbPress installation. In order for this to work as expected, you must have the s2Member -> bbPress Bridge installed. Please check your Dashboard under: s2Member -> API Bridges -> bbPress.

Thanks for the info...my problem is when bbbridge is installed the general public can not see the forums? Is there a fix?
After you install the s2Member -> bbPress Bridge in your Dashboard, you can open this file, it's inside: /bb-plugins ( or my-plugins ) /_s2member-bbpress-bridge.php.

Look for this section in that file:
Code: Select all
if (!bb_is_user_logged_in () || !bb_current_user_can ("participate"))
    {
        if ($url = bb_get_option ("wp_siteurl")) /* WordPress® is integrated? */
            {
                $bbPress = bb_get_option ("uri"); /* bbPress® location. */
                /**/
                if (preg_match ("/^" . preg_quote ($bbPress, "/") . "/", $_SERVER["HTTP_REFERER"]))
                    wp_redirect ($url, apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
                /**/
                else /* Otherwise, trigger the Membership Options Page + s2member_level_req = $min. */
                    wp_redirect ($url . "/?s2member_membership_options_page=1&s2member_seeking=bbpress&s2member_level_req=" . urlencode ($min), apply_filters ("ws_plugin__s2member_content_redirect_status", 301, get_defined_vars ()));
                /**/
                exit ();
            }
    } 

Try changing that to just this:
Code: Select all
if (!bb_is_user_logged_in () || !bb_current_user_can ("participate"))
    { /* Do nothing. */ } 

* NOTE. This is untested code. Please use at your own risk.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Adding Roles

Postby Jason Caldwell » March 8th, 2011, 9:02 pm

For the benefit of other readers.

The short answer is no, because in order to integrate bbPress with s2Member, you must first integrate bbPress with WordPress. That integration with WordPress creates a map of bbPress Roles -> WP Roles. Then ( optional ) the s2Member Bridge can come in with 4 new Roles ( s2Member Level 1-4 ) and it can also offer protection of the forums; even at Level #0 if you like. But, if you are planning to leave your forums open to the public, there really is no reason to install the Bridge. The only reason to install the Bridge ( under normal circumstances ) is to protect the forums with s2Member, by requiring a specific s2Member Access Level. s2Member's Bridge also redirects registration requests on the forums back to the Membership Options Page on the main WordPress site.

Integrating bbPress is fairly complicated. It requires a lengthy process inside your bbPress admin panel, following instructions provided by the creators of bbPress. Then you have to install this plugin into WordPress. http://wordpress.org/extend/plugins/bbp ... tegration/ This gets bbPress integrated with WordPress. So the only reason to add s2Member into the mix after this, is to prevent public access.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 0 guests

cron