PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

current_user_access_label returns incorrect result

s2Member Plugin. A Membership plugin for WordPress®.

current_user_access_label returns incorrect result

Postby doctorproctor » June 23rd, 2011, 10:38 pm

Greetings -- I am using the below on a page to return to a logged in user the s2 membership level:

You currently have [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /] status.

What I've discovered upon testing, however, is that whether the user level is 1, 2, 3, or 4, the label returned is always that which corresponds to level 4. Preceding this statement I have the shortcode:

Greetings, [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]!

which returns the correct result, so I'm sure s2Member is accessing the correct record for a given user.

Can you please help me diagnose? I'd sure appreciate; thanks.

Jim P.
User avatar
doctorproctor
Registered User
Registered User
 
Posts: 37
Joined: May 18, 2011

Re: current_user_access_label returns incorrect result

Postby Cristián Lávaque » June 23rd, 2011, 10:42 pm

Could it be that you first viewed the page as an Admin and now you're getting a cached copy of it? Did you login with an account at another level for the test and refresh the page?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: current_user_access_label returns incorrect result

Postby doctorproctor » June 23rd, 2011, 10:51 pm

I'm using a different browser for my admin and user accounts, so I don't think the above is what's happening. Also, below the troublesome shortcode I have

Code: Select all
Your membership expires on <?php echo date('l F jS, Y', get_user_option('wp_s2member_auto_eot_time', $user_id)); ?>.


and it works fine for the user, so it's only the user access label that's not working. It's true that I'm logged in as admin at the same time I'm querying membership status on a different browser for the user, but it sounds remote that the admin status is being returned for this variable only.

Thanks for your quick reply!

Jim
Last edited by Cristián Lávaque on June 23rd, 2011, 11:16 pm, edited 2 times in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
doctorproctor
Registered User
Registered User
 
Posts: 37
Joined: May 18, 2011

Re: current_user_access_label returns incorrect result

Postby Cristián Lávaque » June 23rd, 2011, 11:14 pm

I see, yes it's odd. I'll ask Jason about the constant. In the meantime, you can try this for the label:

Code: Select all
<?php echo get_user_field('s2member_access_label', $user_id); ?>
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: current_user_access_label returns incorrect result

Postby doctorproctor » June 23rd, 2011, 11:19 pm

Interesting, the php returns the same level 4 label. Do ask; thanks. Is anyone else experiencing this behavior? I'll try to create a few test users and verify the problem as well.

Regards,

Jim
User avatar
doctorproctor
Registered User
Registered User
 
Posts: 37
Joined: May 18, 2011

Re: current_user_access_label returns incorrect result

Postby Cristián Lávaque » June 23rd, 2011, 11:30 pm

Could you show me a screenshot of the labels panel? WP Admin -> s2Member -> General Options -> Membership Levels/Labels
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: current_user_access_label returns incorrect result

Postby Cristián Lávaque » June 23rd, 2011, 11:32 pm

Are you sure that the account you're testing is not at Level 4?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: current_user_access_label returns incorrect result

Postby doctorproctor » June 23rd, 2011, 11:35 pm

It's currently at s2Member Level 1. I've tried at all levels and it always returns level 4 label...thanks...Jim
User avatar
doctorproctor
Registered User
Registered User
 
Posts: 37
Joined: May 18, 2011

Re: current_user_access_label returns incorrect result

Postby Jason Caldwell » June 24th, 2011, 12:01 am

Thanks for reporting this important issue.
doctorproctor wrote:Interesting, the php returns the same level 4 label. Do ask; thanks. Is anyone else experiencing this behavior? I'll try to create a few test users and verify the problem as well.
Yes, very interesting. I've been unable to reproduce this so far. Can you attach some screenshots of your code in it's entirety ( i.e. as it appears in your WordPress editor )? We'll be happy to take a closer look for you. Also, screenshots of your s2Member ->General Options -> Membership Levels/Labels as well please.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: current_user_access_label returns incorrect result

Postby doctorproctor » June 24th, 2011, 8:23 am

Okay, here you go (see screenshots below from bottom to top), and thanks for your help...Jim
Attachments
Screen shot 2011-06-24 at 6.17.28 AM.png
s2 user settings #2
Screen shot 2011-06-24 at 6.17.28 AM.png (32.11 KiB) Viewed 196 times
Screen shot 2011-06-24 at 6.17.15 AM.png
s2 user settings #1
Screen shot 2011-06-24 at 6.15.53 AM.png
Page outcome for user
Screen shot 2011-06-24 at 6.15.53 AM.png (37.58 KiB) Viewed 196 times
Screen shot 2011-06-24 at 6.14.52 AM.png
s2 membership levels
Screen shot 2011-06-24 at 6.14.52 AM.png (44.31 KiB) Viewed 196 times
Screen shot 2011-06-24 at 6.13.06 AM.png
Current page code
User avatar
doctorproctor
Registered User
Registered User
 
Posts: 37
Joined: May 18, 2011

Re: current_user_access_label returns incorrect result

Postby Jason Caldwell » June 25th, 2011, 2:33 am

Thank you so much.
Well, you've really got me puzzled on this one. I have no response to this yet, and I've been unable to reproduce it so far on my end. Is it possible for you to send me a Dashboard login for that installation so I an see this for myself? If so, please use this private contact form: http://www.s2member.com/contact/
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: current_user_access_label returns incorrect result

Postby doctorproctor » June 25th, 2011, 10:07 am

Okay, have sent you info, and thanks again for your great support.

Jim
User avatar
doctorproctor
Registered User
Registered User
 
Posts: 37
Joined: May 18, 2011

Re: current_user_access_label returns incorrect result

Postby Jason Caldwell » June 25th, 2011, 5:34 pm

Thank you, and you're very welcome too. Information received. Investigating now.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: current_user_access_label returns incorrect result

Postby Jason Caldwell » June 27th, 2011, 10:59 pm

Investigation completed.
The problem on your installation was related to a corruption of your s2Member Roles/Capabilities. It appears that you are running the User Role Editor plugin, and that you, or someone working with you modified the s2Member Roles in ways that rendered them unstable. I've restored your s2Member Roles/Capabilities for you and everything is working fine now. Please let us know if you continue to have trouble.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

cron