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™

shortcodes for partial viewing of content

s2Member Plugin. A Membership plugin for WordPress®.

shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 11:48 am

I want to provide some of the content on my pages to be visible and available as free but I would also like to restrict part of the content as premium. So the first portion would be free and the following portion premium and requiring either a single purchase of the rest of the content or a subscription option to read it.

Does s2member provide shortcodes that can fulfill that?

Many thanks,

Catherine
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 11:58 am

For a simple way try going under WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals and see if you find what you need there.

For a more advanced way try this couple of videos:
http://www.s2member.com/api-scripting-overview-video/
http://www.s2member.com/advanced-conditionals-video/

You can find everything under WP Admin -> s2Member -> API / Scripting.

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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 12:50 pm

Thanks for your help, Eduan - it seems I have a bit more to learn there, but at least it's possible :)
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 1:04 pm

Okay,
well anything else you need just ask.
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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 1:18 pm

No worries, I will ;)
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 2:13 pm

:)
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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 2:57 pm

I'm back, already....

The shortcodes all seem to require a person to be logged in to see content, even when it's being made freely available. Is it possible to put the shortcode below the free non-subscriber content and use one that then asks for login to continue?
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 4:00 pm

You mean put "login required" content and if the user isn't registered put something saying "please register"?

Also what content levels are you offering.
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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 4:04 pm

Yes. After a certain amount of free content at the beginning of the page then block it unless logged in or offer registration. Can it be done? I can't see which of these shortcodes will work. I've played around with some different configurations on one page to test it without success :(
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 4:09 pm

Free content meaning public, that no-one needs to be a registered user for, not even a 0 membership.
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 4:10 pm

Try this:
Code: Select all
[s2If current_user_is(s2member_level0)]
    Some content for Free Subscribers.
[/s2If]

[s2If !current_user_can(access_s2member_level0)]
    Some public content.
[/s2If] 

Or this (you will need the Exec-PHP plugin):
Code: Select all
<?php } else if (current_user_is("s2member_level0")){ ?>
    Some content for Free Subscribers.
<?php } else { ?>
    Some public content.
<?php } ?>
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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 4:25 pm

Hey Eduan,

That's great, thank you. However, after the free content, there's no login or register options that follow. Do I have to add some other shortcode or link?
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 4:27 pm

Do you have the PRO version?
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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 4:35 pm

No, just the free one - does that make a difference to what's available?
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 4:40 pm

Well the paid version has what you call a Pro-form, which is basically the registration form or the PayPal button but without leaving the page you're in. There's also a free registration pro-from.

If you can't afford it the best you can do, at least from what I know, is put this link for them, maybe with an image:
http://www.yoursite.com/wp-login.php?action=register.

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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 4:52 pm

I'll check that out, thanks Eduan.

Can I just ask your opinion on what's the best to use, the shortcodes or the php with the plugin? Are there any performance differences etc?
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 4:53 pm

There's really no difference in perfomance, it's just that wit the PHP you have a little more control since you can customize the code.
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: shortcodes for partial viewing of content

Postby tarotelements » November 5th, 2011, 4:58 pm

If you can write with it... lol.

Thanks for your help tonight, Eduan - you're been great! :D
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Eduan » November 5th, 2011, 4:59 pm

Yeah. :lol:

You're welcome, anything else you need just ask. :)

By the way to buy the Pro version's licenses you can use this link:
http://www.s2member.com/prices/
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: shortcodes for partial viewing of content

Postby Cristián Lávaque » November 5th, 2011, 10:20 pm

Code: Select all
Free content first.

[s2If !current_user_can(access_s2member_level0)]
The user is not logged in, ask him to register and/or log in.
http://yoursite.com/wp-login.php
http://yoursite.com/wp-login.php?action=register
[/s2If]

[s2If current_user_can(access_s2member_level0)]
Content for logged in users.
[/s2If]

[s2If !current_user_can(access_s2member_level1)]
The user can't access Level 1 content. Button to upgrade.
[/s2If]

[s2If current_user_can(access_s2member_level1)]
Content for users at Level 1 or higher.
[/s2If]


Does that help?
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: shortcodes for partial viewing of content

Postby tarotelements » November 6th, 2011, 12:43 pm

Thanks Cristian - I'll give these a try after dinner :)
User avatar
tarotelements
Registered User
Registered User
 
Posts: 21
Joined: September 20, 2011

Re: shortcodes for partial viewing of content

Postby Cristián Lávaque » November 6th, 2011, 10:10 pm

Cool. Let us know if you have more questions. :)
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: No registered users and 0 guests

cron