latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Trevor Wilcox

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 4 topics - 1 through 4 (of 4 total)
Topic Count Last Reply
Mailchimp Integration

By:  Trevor Wilcox in: Community Forum

voices: 2
replies: 1

4 years, 4 months ago  cassel

Show them what level they need!

By:  Alex Fink in: Unofficial Extensions/Hacks

voices: 3
replies: 4

4 years, 5 months ago  Trevor Wilcox

Query Content Level

By:  Trevor Wilcox in: Community Forum

voices: 2
replies: 3

4 years, 5 months ago  Trevor Wilcox

Paypal

By:  Trevor Wilcox in: Community Forum

voices: 1
replies: 0

4 years, 7 months ago  Trevor Wilcox

Viewing 4 topics - 1 through 4 (of 4 total)

Topics I've Started

Viewing 3 topics - 1 through 3 (of 3 total)
Topic Count Last Reply
Mailchimp Integration

By:  Trevor Wilcox in: Community Forum

voices: 2
replies: 1

4 years, 4 months ago  cassel

Query Content Level

By:  Trevor Wilcox in: Community Forum

voices: 2
replies: 3

4 years, 5 months ago  Trevor Wilcox

Paypal

By:  Trevor Wilcox in: Community Forum

voices: 1
replies: 0

4 years, 7 months ago  Trevor Wilcox

Viewing 3 topics - 1 through 3 (of 3 total)

My Latest Replies (From Various Topics)

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Friday Aug 10th, 2012 at 3:15 am #21676

Alex, thank you for this!

I can get this to work as in your example when people click on “Read More” requesting a premium article and get redirected to the Subscription page whereby they are told that the article they want access to is a Level X article. From what I can tell, your code needs the user to request the article (by clicking Read More…) before this message can be returned.

However I would also like to show what level each article is in the main loop on index.php without the article actually being requested.

Here is an extract of a screenshot of my main loop. The first two articles I have allocated as Level 3. And when a Level 1 user clicks on Read More, they are taken to the subscription page and your wonderful code does its work. But as you see in the right hand column where the meta data is, the same code always returns the last line, “Already a member?…”.

Is there a way to tweak your code in order to show it on the main loop here?

Thanks a lot

Posted: Friday Aug 10th, 2012 at 2:57 am #21675

Alex’s solution here gets me pretty close to what I need:

http://www.s2member.com/forums/topic/show-them-what-level-they-need/

Posted: Friday Aug 10th, 2012 at 2:09 am #21674

Thanks Eduan. But that’s not quite what I meant. Your example returns a specific string based on the user’s subscription level. For the purpose of the string, I need to make it relative to the content instead of the user.

Let me paint a scenario.

There are two posts – one classified as Level 2, and one classified as Level 3.

I put this code in to my template for everyone who can access Level 1 or above.

<?php if (current_user_can("access_s2member_level1")){ ?>
    
	This content is classified as Level 3.
	
	<?php } else { ?>

    Some public content.
<?php } ?> 

This would also be applied to the Level 2 post, telling people it’s classified as Level 3. Which is wrong. Therefore there needs to be some mechanism that dynamically grabs which level the content is (kind of like a “mail merge field”), something like this (somehow):

<?php if (current_user_can("access_s2member_level1")){ ?>
    
	This content is classified as <<POST LEVEL>>.
	
	<?php } else { ?>

    Some public content.
<?php } ?> 

Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.