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™

Question about free days

s2Member Plugin. A Membership plugin for WordPress®.

Question about free days

Postby MatijaS » December 15th, 2011, 8:18 am

Hello!

I have one question. I am using s2member plugin, and I wonder, if I can do one thing??!!

-- i would like to every member that will register on website, have 3 days unlimited access and after 3 days paypal button will show up..

I did a thing, that i put out the paypal buton,and choose that they will have 3 days for free, but is that this that I want?? i dont want,that they after 3 days must pay.... i would like,that they have to choose wheter or not they want to pay!!

thanks!!!!

www.forex-trading-signals.info
User avatar
MatijaS
Registered User
Registered User
 
Posts: 9
Joined: December 15, 2011

Re: Question about free days

Postby Eduan » December 15th, 2011, 8:49 am

So you would like the button to appear only if they've been registered for 3 days?
If yes then it's very simple, you can use content dripping, which you can find under WP Admin -> s2Member -> API / Scripting -> s2Member Content Dripping.

Hope this helps. :)
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Question about free days

Postby MatijaS » December 15th, 2011, 4:52 pm

First I want to thank you for your answer.

I dont think that this what are you write to me is possible for my case.

So look, if someone visits our site and register it. I want that that person to watch free of charge one category( otherwise
is payable), but after three days, access to these categories close and the paypal button appered.

I am sory,but it is my first time with thoose kind a thing.

Thanks.
User avatar
MatijaS
Registered User
Registered User
 
Posts: 9
Joined: December 15, 2011

Re: Question about free days

Postby Cristián Lávaque » December 17th, 2011, 4:02 am

Matija, I think I understand what you want. It'd be a trial without entering payment information beforehand, a free account with full access for 3 days. After that trial, then require the person to pay to get access back. Right?

You could do this with s2Member Pro's free registration pro-form. This would allow you to have users register and get the 3 days of access at the level you wish to give, and he'd be demoted to Level 0 after the 3 days you specified for the EOT (end of term).
WP Admin -> s2Member -> PayPal Pro-Forms -> Free Registration
WP Admin -> s2Member -> PayPal Options -> Automatic EOT Behavior


At that point, he'd be shown a button to pay for premium access. This button could be in the Login Welcome Page and shown only to those at Level 0 using a conditional.
WP Admin -> s2Member -> General Options -> Login Welcome Page
WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals


I hope this helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Question about free days

Postby MatijaS » December 18th, 2011, 7:00 pm

Thank you,
can you please show me an example for API Scripting (short code).

Thank you very much!
User avatar
MatijaS
Registered User
Registered User
 
Posts: 9
Joined: December 15, 2011

Re: Question about free days

Postby Cristián Lávaque » December 19th, 2011, 6:04 pm

Oh, if you install the free version of s2Member, you'll see several examples under WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals

This video also talks about them and you may find it helpful: http://www.s2member.com/api-scripting-overview-video/

I hope that helps.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Question about free days

Postby MatijaS » December 20th, 2011, 2:46 pm

Sorry, but I don#t understand this!
In video don"t show this.
I don"t find shortcode, which would solve my example!

Thanks
User avatar
MatijaS
Registered User
Registered User
 
Posts: 9
Joined: December 15, 2011

Re: Question about free days

Postby Raam Dev » December 20th, 2011, 8:35 pm

Hi Matija,

There is no shortcode logic for what you are trying to do (it may be added in a future version of s2Member). However, you can still accomplish this business logic using Advanced PHP Conditionals and PHP Constants provided by s2Member.

You will need to install the PHP Execution plugin and then use PHP code in your posts to control the content dripping based on how long the user has been registered.

Here's an example that you could use on a post where you want to show/sell a video:

Code: Select all
<?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0 && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS < 3 || s2member_paid_registration_time() > 0) { ?>

    [ video content would go here ]

<?php } else if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0 && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS > 3) { ?>

    [ PayPal button code to purchase access would go here. ]

<?php } ?>



In the example above, free registered users (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0) who have been registered for 3 days or less (S2MEMBER_CURRENT_USER_REGISTRATION_DAYS < 3) OR registered users who have paid you (s2member_paid_registration_time() > 0) will be shown the video content.

If they're a free registered user who has been registered for more than three days (S2MEMBER_CURRENT_USER_ACCESS_LEVEL === 0 && S2MEMBER_CURRENT_USER_REGISTRATION_DAYS > 3), the PayPal button to purchase access will be shown instead of the video content.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Question about free days

Postby MatijaS » December 22nd, 2011, 9:39 am

I can do it for category, right? and what, i put on a category link? instead of video for example?

and thank you, realy helps me a lot!!
User avatar
MatijaS
Registered User
Registered User
 
Posts: 9
Joined: December 15, 2011

Re: Question about free days

Postby Raam Dev » December 22nd, 2011, 3:43 pm

Glad I can help! :)

You will need to put that code on each video post and it will then automatically work when you browse the categories.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Question about free days

Postby Cristián Lávaque » December 22nd, 2011, 7:06 pm

Raam's suggestion would also work for what you want, Matija.

Here's my own version of that condition that seems to do the job, but is simpler to write:

Code: Select all
<?php if (current_user_can('access_s2member_level1') || S2MEMBER_CURRENT_USER_REGISTRATION_DAYS < 4) { ?>

Video content would go here.

<?php } else { ?>

PayPal button code to purchase access would go here..

<?php } ?>


I basically checks if the user can access Level 1 content, or if his account has less than 4 days of having been created (i.e. 3 days). This condition would be true for any account in its first 3 days, even free users, or for any paid members at Level 1 or above. It'd be false for anyone else: someone not logged in, or a free user whose account is older than 3 days.

Sorry about that video, I was sure it had an explanation of the shortcode conditionals, but I watched it again and that version of s2Member seems to not have had it yet. The documentation for them in the Scripting API page is simple enough if you read it and go through the examples. I was only suggesting these to show the button in the Login Welcome page for the approach I suggested first. Shortcodes don't support the conditions that check how old the account is, for that I was suggesting the EOT instead.

The PHP condition needs to be used in each post, like Raam said. You can also create a hack to apply this condition to every post in a certain category. For an example of a conditional used in a similar way, please watch the second video on Custom Capabilities, starting around time 7:00.



Checking the user registration days with a condition, doesn't require s2Member Pro, but it needs the hack or adding the condition in every post.

What I suggested first would work well, but it does require s2Member Pro's free registration pro-form to create free accounts at Level 1 with an EOT. viewtopic.php?f=4&t=16382&p=58576#p56735
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Question about free days

Postby Raam Dev » December 22nd, 2011, 8:54 pm

Thanks for the cleaner code example, Cristian! I had a feeling there was a cleaner way of writing that. :)

Quite elegant the way you used the S2MEMBER_CURRENT_USER_REGISTRATION_DAYS to check if they're not logged in!
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: Question about free days

Postby Cristián Lávaque » December 25th, 2011, 4:28 am

;)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest

cron