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.

Member level code problem

Home Forums Community Forum Member level code problem

This topic contains 2 replies, has 2 voices. Last updated by  Dimitrios Vasileiou 4 years, 9 months ago.

Topic Author Topic
Posted: Thursday Apr 12th, 2012 at 8:05 am #10645

Hello everyone

I am using the pro version of s2 member and all is working well, apart from one thing. I need to say here that we are using level 1 and level 2 and have no free subscriptions. The website is http://landscapephotographymagazine.com

I have added the code I am using right after my post and here is my problem:

When a non logged in visitor visits a level 2 page, all they see is the 1st part of my code (a welcome banner) and no content, great so far, no problem at all.

When a level 1 member logs in, all they see is the second part of my code and no content, great so far, no problem at all.

Now, when a level 2 member logs in, they can see the full content of the page (as they should). However, they can still see the second part of my code at the top of the page, when they shouldn’t. There is nothing hidden under the code, it just shouldn’t be there when a level 2 member is logged in. This confuses them as they think that, they have paid for level 2 (premium membership that allows full content to be viewed) and they still can’t see certain things.

I understand that I am doing something wrong here and I have spent hours trying to figure out how the codes work but I failed, please help.

—————————————

Here is the html code I am using…

[s2If !is_user_logged_in()]
<div id="sub-box" class="rounded"><hgroup class="text-center">
<h2>Welcome to Landscape Photography Magazine</h2>
<h3>Premium account required to access the full content of this page</h3>
</hgroup>
<p class="sub-content alignleft">Landscape Photography Magazine can be read on-line or downloaded as a pdf file for off-line reading at leisure on laptops, iPads and most small devices. <a href="http://landscapephotographymagazine.com/subscriptions"><span><strong>Click here for details.</strong></span></a></p>
<a class="sub-button alignright" href="http://landscapephotographymagazine.com/subscriptions"><span>Subscribe now! </span></a>

</div>
[/s2If]

[s2If is_user_logged_in()]
<div id="sub-box" class="rounded"><hgroup class="text-center">
<h2>Welcome to Landscape Photography Magazine</h2>
<h3>You need a premium account (Level 2) to access the full content of this page.</h3>
</hgroup>
<p class="sub-content alignleft">Landscape Photography Magazine can be read on-line or downloaded as a pdf file for off-line reading at leisure on laptops, iPads and most small devices. <a href="http://landscapephotographymagazine.com/subscriptions"><span><strong>Click here for details.</strong></span></a></p>
<a class="sub-button alignright" href="http://landscapephotographymagazine.com/subscriptions"><span>Subsribe now! </span></a>

</div>
[/s2If]

[s2If current_user_can(access_s2member_level2)]

<strong>Level 2 page content goes here.</strong>

[/s2If]

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Thursday Apr 12th, 2012 at 12:17 pm #10668
Raam Dev
Username: Raam
Staff Member

Hi Dimitrios,

The problem is that s2If is_user_logged_in() will match anyone who is logged in, including Level 2 users.

What you want to do is change that to s2If current_user_is(s2member_level1).

Posted: Thursday Apr 12th, 2012 at 1:37 pm #10677

Perfect.

Thank you very much, Raam.

Viewing 2 replies - 1 through 2 (of 2 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.