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.

How to get access level that a page needs?

Home Forums Community Forum How to get access level that a page needs?

This topic contains 5 replies, has 2 voices. Last updated by  Eduan 3 years, 10 months ago.

Topic Author Topic
Posted: Wednesday Feb 6th, 2013 at 9:48 pm #40956

Hi,

Does anyone know how to get the access level that is required when the user accesses a page?

e.g. Page ID: 100 is set Level 1
e.g. Page ID: 200 is set Level 2

The system will redirect to the member options page but I want to show the member the level that the page requires.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Friday Feb 8th, 2013 at 9:22 pm #41233
Eduan
Username: Eduan
Moderator

Hello Svetoslav,

What do you mean? You mean you want to tell the user what level the page he tried to access requires? And maybe give him different options based on that?

If so, it’s pretty simple using MOP vars (Membership Options Page vars). You can read more abou them under Dashboard -› s2Member® -› API / Scripting -› Membership Options Page Variables (MOP Vars).

– Eduan

Posted: Friday Feb 8th, 2013 at 11:48 pm #41243

Eduan, thanks for the reply.

The thing is that I check the content using is_permitted function which checks but doesn’t return what is the required level for the given page.

I found some snippets and created a plugin that protects sub-pages if the parent is protected by S2.

Posted: Sunday Feb 10th, 2013 at 9:38 pm #41387
Eduan
Username: Eduan
Moderator

I see. I think that would be too advanced for me. :/

BTW, instead of using is_permitted, have you thought about using s2Member’s PHP conditionals? You can find them under Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals.

– Eduan

Posted: Monday Feb 11th, 2013 at 5:50 pm #41426

Nope. I like things separate.

I’d rather create a separate plugin that will handle the logic … in case I have to switch to a different membership plugin.

Posted: Thursday Feb 14th, 2013 at 7:11 pm #41726
Eduan
Username: Eduan
Moderator

OK, no problem. :)
It was just a suggestion. ;)

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