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.

Show them what level they need!

Home Forums Community Forum Unofficial Extensions/Hacks Show them what level they need!

This topic contains 4 replies, has 3 voices. Last updated by  Trevor Wilcox 4 years, 5 months ago.

Topic Author Topic
Posted: Friday Apr 13th, 2012 at 4:22 pm #10755
Alex Fink
Username: finky

Hi everybody,

I’ve been looking for a solution to display a message for users so they know what level they need for a specific article whenever they are redirected to the membership options page.

What I’ve come up with:

How to do it:

I inserted the following code to the membership options page that will respond to the protected content requested, displaying the required level with any message you want:

<p>To see this content, you will need the free - subscription. <a href="http://yourdomain.com/wp-login.php?action=register">Register Now!</a></p>
 
 <p>You have requested a premium article. To see this you will need a <b>NameOfYourLevel - Subscription</b>.</p>
     
 
  <p>You have requested a premium article. To see this you will need a <b>NameOfYourLevel - Subscription</b>.</p>
 
 <p>Already a member? Please <a href="https://yourdomain.com/wp-login.php">login</a></p>

You can see a live-demo of this on my site dazugelernt.de

Cheers,
Alex

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Friday Apr 13th, 2012 at 4:53 pm #10759
Eduan
Username: Eduan
Moderator

Hello Alex,
I think you might be interested in using s2Member conditionals to accomplish what you want:
Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals

You might also be interested in this KBA (Knowledge Base Article) on conditionals:
http://www.s2member.com/kb/s2member-conditionals/

Hope this helps. :)

Posted: Saturday Apr 14th, 2012 at 6:51 am #10791
Alex Fink
Username: finky

Sorry, I don’t understand. I didn’t ask for help and I already accomplished what I wanted. Just thought I’d share my solution. Soooooooo …. thanks anyway ?!

I love your product :D

Posted: Saturday Apr 14th, 2012 at 8:58 am #10795
Eduan
Username: Eduan
Moderator

Oh OK Alex,
sorry I didn’t get that. :P

Well, anyway, thought I’d share a simpler way of doing it. ;)

And thanks for the Kudos by the way. :)

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

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

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

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.