Community Support Forums — WordPress® ( Users Helping Users ) — 2010-07-22T06:22:18-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=404 2010-07-22T06:22:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=404&p=1707#p1707 <![CDATA[Re: API Scripting for "Teaser"]]>
Code:
This is my article.. here is some text...

<?php if (current_user_can("access_s2member_level1")){ ?>

    Here is the rest of my text, available to Members only!

<?php } else { ?>

    Please pay me 1 million dollars to read the rest :-)
    <a href="<?php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL; ?>">signup now</a>

<?php } ?>

The else condition is optional.
I included it only to improve the example.

Here is another example that ONLY checks if they're a Member.
Code:
This is my article.. here is some text...

<?php if (current_user_can("access_s2member_level1")){ ?>

    Here is the rest of my text, available to Members only!

<?php } ?>

For the benefit of other readers. In order to use s2Member's Advanced Conditionals, you will need to install the Exec-PHP plugin for WordPress. Further documentation on Advanced Conditionals, can be found inside your WP Dashboard, under: s2Member -> API Scripting -> Advanced Conditionals

Statistics: Posted by Jason Caldwell — July 22nd, 2010, 6:22 am


]]>
2010-07-18T21:15:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=404&p=1661#p1661 <![CDATA[API Scripting for "Teaser"]]>
First of, want to say s2Member is an amazing plugin... you guys have done a lot for the community!

I have a question that is related to this topic (http://www.primothemes.com/forums/viewtopic.php?f=4&t=103&p=500&hilit=post+teaser#p500), however I can't seem to figure it out exactly.

I've looked at the code samples and they are exactly what I need, however where do I add them in so that I only show a snippet of my post and they have to register/login to see the rest?

I have Exec-PHP, but don't know exactly how to use it in conjunction with my post.

Here is an example of what I'm trying to do:

When a customer selects http://www.unbreakablewarrior.com, and navigates to the "Blog" section, I want them to only be able to see the following:
"Unbreakable Warrior has recently released a press release:"

Then they would have to login to be able to view the link.

How do I place the PHP code?

Statistics: Posted by SteveS — July 18th, 2010, 9:15 pm


]]>