Page 1 of 1

Using S2Member for Donations/Supporter system

PostPosted: August 24th, 2010, 5:02 pm
by BoweFrankema
Hi Jason,

I've been following S2Member from the first public release, and you might remember me from some BuddyPress related comments I placed in the comment section of the plugin page (which is now closed down, and replaced by a forum). You said that I could email you if I'd have ideas or suggestion for S2Member and/or had questions. I've been working on a non-profit project for quite some time now, and basically I would like to use S2member differently then the standard "paywall". Sadly I lost your email, so I thought I'd post on the forum instead, since you're here all the time :shock:

I'm working on a social network (BuddyPress/WordPress powered) for people with Cystic Fibrosis (http://en.wikipedia.org/wiki/Cystic_fibrosis) and would like to use S2Member for donations and a "supporter" system.

I would like to use the different user levels in S2Member as "donation" levels. Which means that I would like to allow individuals AND companies to become subscribers to our cause; A social network for people with Cystic Fibrosis.

I've thought of setting it up like this:

Level 1: Free. Access to all the regular stuff including Blog creation etc.

Level 2: Supporter! about $2,99 per month and gives the user a Badge on his avatar (should be possible using S2Member conditionals I think?) and access to a VIP forum, and hopefully to some cool widgets/plugins for their blog (hopefully that will be added to the WP Multisite features in the future?).

Level 3: Sponsor: This is for companies/organizations and is a bigger donation on a monthly basis. This means that they are listed on a special thank you page, and they'll receive some goodies like a t-shirt or something, and are mentioned in a newsletter.

The most important thing is that it's easy to sign up, you don't need a PayPal account and it should all be easy to manage from both sides (user and admin). So S2Member Pro is absolutely great for this, but I need some help with setting everything up. Do you think the above can be achieved with S2Member?

I'm happy to pay something for setting this up, and I've emailed to the support team, but they did not really respond to my email (only the price and that there was a new version available) and I would like to know first if S2Member can do the above, and it's very important for my project.

Looking forward to a reply and keep up the great work with S2Member!

Greetings,
Bowe

Re: Using S2Member for Donations/Supporter system

PostPosted: August 29th, 2010, 11:38 pm
by Jason Caldwell
Hi Bowe. Yep ~ I remember you.
Great to hear from you again.
~ Thanks for your support.

Level 1: Free. Access to all the regular stuff including Blog creation etc.

Gotchya. Yes, s2Member is fully compatible with Multisite Networking now * yea!

Level 2: Supporter! about $2,99 per month and gives the user a Badge on his avatar (should be possible using S2Member conditionals I think?)

Correct. Requires some minor tweaks to your BuddyPress theme.

and access to a VIP forum,

What forum are you using? BuddyPress forums? bbPress? phpBB?

and hopefully to some cool widgets/plugins for their blog (hopefully that will be added to the WP Multisite features in the future?).

s2Member Pro includes a new Login Widget + Profile Summary ( very cool ),
~ but I'm not sure what you mean exactly on this topic?

Level 3: Sponsor: This is for companies/organizations and is a bigger donation on a monthly basis. This means that they are listed on a special thank you page, and they'll receive some goodies like a t-shirt or something, and are mentioned in a newsletter.

Right. So you'll need some custom theme work here to pull a members list and it sounds like you may also want to use s2Member's Custom Capabilities for parts of this functionality.
The most important thing is that it's easy to sign up, you don't need a PayPal account and it should all be easy to manage from both sides (user and admin). So S2Member Pro is absolutely great for this, but I need some help with setting everything up. Do you think the above can be achieved with S2Member?

Yes, s2Member Pro can definitely handle this. You'll need a PayPal® Pro account first, and then if you need help getting s2Member configured to deal with all of your requirements here, please send an email through this page; and please include a link referencing this thread. ~ Thanks.

Re: Using S2Member for Donations/Supporter system

PostPosted: August 31st, 2010, 6:27 pm
by BoweFrankema
Thanks for the reply Jason, just the confirmation I needed! I saw that you've added Conditional queries to the feature list, and that should allow me to get me started at least for a few things I had in mind. I'll contact the support team as soon as I got everything worked out (in my head :D).

Thanks :D

Re: Using S2Member for Donations/Supporter system

PostPosted: September 1st, 2010, 3:21 am
by Jason Caldwell
You're VERY welcome.
Thanks Bowe.

Re: Using S2Member for Donations/Supporter system

PostPosted: September 3rd, 2010, 11:57 am
by chrisk2020
Hi,

I'd like to do something similar to this:
Level 2: Supporter! about $2,99 per month and gives the user a Badge on his avatar (should be possible using S2Member conditionals I think?)


Show a different badge for the user depending on their subscription level. Can you expand a little on how to achieve this. I've looked at the conditionals, but I can only see how to show the user level of the Viewing user. Not the user whose profile is being viewed.

Thanks,
appreciate any help.

Re: Using S2Member for Donations/Supporter system

PostPosted: September 3rd, 2010, 7:06 pm
by BoweFrankema
Good question Chris.. I would like to know how to do this as well! It would be nice if you could show this badge on several places. I think the best place would be under someone his avatar. A bit like Jason his cool "Lead Developer" rank on this forum!

Re: Using S2Member for Donations/Supporter system

PostPosted: September 4th, 2010, 4:25 am
by chrisk2020
Exactly. It can't be too hard. I can see that s2member stores some info in the wp_capabilities table in wp_usermeta. Should be able to retrieve the displayed users level from there?

Re: Using S2Member for Donations/Supporter system

PostPosted: September 4th, 2010, 8:07 am
by chrisk2020
I did this function, That I can call in member-header (I modded some code found in wp forums)
Code: Select all
function my_user_role(){
$ID=bp_displayed_user_id();;
$user = new WP_User($ID);

if ($user->wp_capabilities['administrator']==1)
echo '<p>Admin Badge Code</p>';
else if ($user->wp_capabilities['author']==1)
echo '<p>Author Badge Code</p>';
else if ($user->wp_capabilities['s2member_level0']==1)
echo '<p>WOW</p>';
else if ($user->wp_capabilities['s2member_level2']==1)
echo '<p>WOW1</p>';
else if ($user->wp_capabilities['s2member_level3']==1)
echo '<p>WOW2</p>';
else if ($user->wp_capabilities['s2member_level4']==1)
echo '<p>WOW3</p>';
else
echo '<p>Regular User</p>';
}


It works. Is it a good way to go?

Re: Using S2Member for Donations/Supporter system

PostPosted: September 5th, 2010, 1:45 pm
by BoweFrankema
Great thanks Chris!! Just what I was looking for!

Re: Using S2Member for Donations/Supporter system

PostPosted: September 7th, 2010, 8:40 pm
by Jason Caldwell
Awesome guys. ~ Thanks for posting those great code samples.
~ Much appreciated.

Just thought I would throw this out there as well.
s2Member v3.2.4+ adds a new function to WordPress® as well:
current_user_is()

So for instance, you could do this:
Code: Select all
if(current_user_is("administrator")){
    // do something here
} else if(current_user_is("s2member_level0")) {
    // do something here
} 

Another option is this method:
Code: Select all
$user = new WP_User($user_id);
// Or:  new WP_User($username);

if($user->has_cap("administrator")){
    // do something here
} else if($user->has_cap("s2member_level0")){
    // do something here
} 

In other words, the ->has_cap() method will accept either a Capability, or also a specific Role ID.

Here are the different Role IDs.
Code: Select all
administrator
editor
author
contributor
subscriber
s2member_level0
s2member_level1
s2member_level2
s2member_level3
s2member_level4

And here are the different s2Member Capabilities.
Code: Select all
access_s2member_level0
access_s2member_level1
access_s2member_level2
access_s2member_level3
access_s2member_level4

also see: http://codex.wordpress.org/Roles_and_Capabilities

Re: Using S2Member for Donations/Supporter system

PostPosted: January 20th, 2012, 3:30 pm
by colinjones
Will this work with bbPress 1.1? I need to have a free section of the forum for "Level 0" members and a Premium section for "Level 1" members with the standalone version of bbPress integrated with s2member.

Thanks!

Re: Using S2Member for Donations/Supporter system

PostPosted: January 24th, 2012, 2:19 pm
by Jason Caldwell
Thanks for the heads up on this thread.

This will work with bbPress 2.0+, but s2Member no longer supports the stand-alone version of bbPress 1.x. That being said, yes, bbPress stand-alone (when/if integrated with WordPress via the older s2Member Bridge plugin) will support this as well. So yes.

The older s2Member -> bbPress Bridge is no longer supported though.
We recommend using the plugin version of bbPress v2.0+.

Re: Using S2Member for Donations/Supporter system

PostPosted: January 25th, 2012, 6:22 pm
by Cristián Lávaque
Colin, you could probably use the bridge for the standalone bbPress from an earlier s2Member, in the latest s2Member. You can find freelance developers over at eLance.com or oDesk.com if you need one.

I hope that helps. :)

Re: Using S2Member for Donations/Supporter system

PostPosted: January 25th, 2012, 6:40 pm
by Jason Caldwell
Right. That's a great idea. You can download s2Member v110815 here:
http://downloads.wordpress.org/plugin/s ... 110815.zip

Inside the ZIP, grab this file:
/s2member/includes/dropins/bridges/_s2member-bbpress-bridge.php
(copy this into your bbPress plugins directory, and edit the configuration section of this file at the top)

I'm also attaching this file for you.
_s2member-bbpress-bridge.zip
(3.33 KiB) Downloaded 443 times

* But please note. We no longer support bbPress v1.x. I don't think you'll have any trouble. But if you do, please upgrade to bbPress v2.x (i.e. the new plugin version of bbPress for WordPress).

Re: Using S2Member for Donations/Supporter system

PostPosted: January 26th, 2012, 3:55 am
by foliovision
Hello Jason,

let me point out an issue with the _s2member-bbpress-bridge.zip file above. I was just having some issues using it, so I thought I'll share my experience. It does not work with iPad.

The issue is that it's using 301 redirections. And iPad likes to cache that. So here is what happens when you try to open forums on iPad:
1. you open the site
2. you click "Forum" or similar link
3. you are redirected to "subscribe" page - iPad will cache that, as it was a 301 redirection
4. you realize you are not logged in, so you log in
5. you click "Forum" again
6. iPad will show what is cached - will load the "subscribe" page right away. So there is no way to refresh.
7. you have to go to settings and clear Safari cache.
8. then it loads.

The fix is simple - you need to change all the 301 codes to 302. It took me a bit to figure it out, but now it work. iPad won't cache 302 redirection. There might be more devices working like this.

I hope you find this fix useful.

Thanks,
Martin