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.

Advanced Conditionals – iPhone and Android

Home Forums Community Forum Advanced Conditionals – iPhone and Android

This topic contains 1 reply, has 2 voices. Last updated by  Raam Dev 4 years, 2 months ago.

Topic Author Topic
Posted: Thursday Oct 25th, 2012 at 2:28 am #29610

I have an issue with the Advanced Conditionals when dealing with phone Apps

I would like the app to check the database based on id if they have capabilities show addons on the phone.

The problem is the place where the advanced conditionals are in mysql has some weird code and not something I can make the app search.

I thought I was close – below I have an array of 3 ( invoice,addon1,addon2 ) This is the code from mysql
a:4:{s:15:”s2member_level1″;s:1:”1″;s:28:”access_s2member_ccap_invoice”;s:1:”1″;s:27:”access_s2member_ccap_addon1″;s:1:”1″;s:27:”access_s2member_ccap_addon2″;s:1:”1″;}

I was just going to make the app search the string for each ( access_s2member_ccap_invoice ) for invoices and this would have worked.

But

I tested to see if I only add one capability ( invoice ) I get a:1:{s:15:”s2member_level1″;s:1:”1″;} So this solution wont work. Because this doesent have ( access_s2member_ccap_invoice )

Does anybody know how I can make this work? or an alternative

Thanks.

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Oct 25th, 2012 at 1:54 pm #29666
Raam Dev
Username: Raam
Staff Member

Hi Edmond,

The wp_capabilities meta_key in the database is created by WordPress, not s2Member. s2Member simply utilizes that existing WordPress feature for Custom Capabilities. If a user is given a specific Custom Capability, it will appear there.

The data stored in that field is a serialized array. To check for specific Custom Capabilities, WordPress provides the user_can() function. You may also want to review WordPress Roles and Capabilities.

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