Community Support Forums — WordPress® ( Users Helping Users ) — 2011-01-24T23:16:35-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=42 2011-01-24T23:16:35-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=5986#p5986 <![CDATA[Re: Protect part of a post or page]]>
I want to protect posts with Specific Post/Page Access and when users go to that post, they have access to part of the post--i.e. where I say that this is paid content and put my Paypal button. Then after they pay, they have full access.

Didn't see a conditional for specific post/page access in the API section.

EDIT: Would
Code:
if(!is_permitted_by_s2member())

do it?

Statistics: Posted by Walton — January 24th, 2011, 11:16 pm


]]>
2010-06-03T14:45:02-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=715#p715 <![CDATA[Re: Protect part of a post or page]]>
jlawlor wrote:
I am looking to protect part of a post or page but can't find any docs that address this.

In Wishlist member content can be restricted by inserting <<more>>
It would be great to have the ability to insert test that is only for a specific user level or above.
ie. [user3] some text for viewing user level 3 and 4[/user]

Have I missed something in the docs?



Hi Jlawlor

I'd use

Code:
<?php if(is_user_logged_in()){ ?>
    Content for anyone that is logged in, regardless of their Membership Level.
<?php } else { ?>
    Some public content.(can be link to your loginout, just add [code]<?php wp_loginout(); ?>[/code]
<?php } ?>


You can use a dynamic loginout script so they wont leave the page they are in.

It's the easiest way to protect your content regardless of any level.

If you are worrying about loosing some of your site ranking with Google or any other search engine, I really recommend using the above code. I also noticed decrease in site searches and the amount of new visitors to my site when using the Cat/Post/Page Access Restrictions.

Hope that helps

Sam

Statistics: Posted by drbyte — June 3rd, 2010, 2:45 pm


]]>
2010-06-03T13:13:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=714#p714 <![CDATA[Re: Protect part of a post or page]]> Statistics: Posted by weblev — June 3rd, 2010, 1:13 pm


]]>
2010-05-26T16:04:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=594#p594 <![CDATA[Re: Protect part of a post or page]]>
Here's an example from my test "welcome" page

Code:
<?php if (S2MEMBER_CURRENT_USER_IS_LOGGED_IN){ ?><!-- checks to see if they're logged in at all, if they are, we show -->
Welcome, <?php echo S2MEMBER_CURRENT_USER_DISPLAY_NAME; ?>! <br>
You are currently a "<b><?php if (is_user_logged_in() && current_user_can("access_s2member_level1")){ ?><?php echo S2MEMBER_CURRENT_USER_ACCESS_LABEL; ?><?php } else { ?>  Free Member<?php } ?> </b>", and have been for <b><?php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; ?></b> days.

<!-- this doublechecks to make sure they're logged in (not sure why I did that) and makes sure they're of a minimum level, then tells them their level label (which you specify in the options) and tells them how long, overall, that they've been a member -->
<br style="clear:all;">

<i>Modify Your User Information</i>-<br>
<iframe src="<?php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; ?>" scrolling="auto" style="width:60%; height:325px; margin:auto; border:1px solid #666666;"></iframe>
<!-- this embeds the box where the user can modify their info -->
<?php } <!-- end this statement -->
else { ?> <!-- else, begin where we show something for users who are not logged in -->

You are not logged in. Please <A HREF="<?php echo S2MEMBER_LOGIN_PAGE_URL; ?>">click here to log in and proceed</A>!
<br><br>
Not a member? <a href="<?php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL; ?>">Click here to sign up today!</A>
<?php  } ?> <!-- end the first if/else statement -->


This code is on a private test page and may be a bit outdated, since my site's plans have changed and we're holding off on a members area for a bit. The last bit isn't needed if you set "Allow Free Subscribers Access To This Page? " to No, I believe.

Statistics: Posted by HTMwebrat — May 26th, 2010, 4:04 pm


]]>
2010-05-26T14:37:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=591#p591 <![CDATA[Re: Protect part of a post or page]]> Statistics: Posted by weblev — May 26th, 2010, 2:37 pm


]]>
2010-05-13T00:56:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=261#p261 <![CDATA[Re: Protect part of a post or page]]> s2Member -> API Scripting -> Advanced Conditionals.
There are 5 different code samples that can be used to build Conditionals similar to WishList.
advanced-conditionals.jpg

Statistics: Posted by Jason Caldwell — May 13th, 2010, 12:56 am


]]>
2010-05-11T07:58:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=213#p213 <![CDATA[Re: Protect part of a post or page]]> http://wordpress.org/extend/plugins/restrictedarea/ which does a super job.

You also need a plug-in http://wordpress.org/extend/plugins/capsman/ so you can change the Level from 0 to 1,2,3 or 4 for the other plug-in.

Hope this helps

Statistics: Posted by PerryM — May 11th, 2010, 7:58 am


]]>
2010-05-08T19:55:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=42&p=189#p189 <![CDATA[Protect part of a post or page]]>
In Wishlist member content can be restricted by inserting <<more>>
It would be great to have the ability to insert test that is only for a specific user level or above.
ie. [user3] some text for viewing user level 3 and 4[/user]

Have I missed something in the docs?

Statistics: Posted by jlawlor — May 8th, 2010, 7:55 pm


]]>