Community Support Forums — WordPress® ( Users Helping Users ) — 2011-09-03T22:21:51-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14855 2011-09-03T22:21:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14855&p=33947#p33947 <![CDATA[Re: Echo Role name.]]>
Code:
Your account is currently set to: <?php echo (S2MEMBER_CURRENT_USER_ACCESS_LEVEL == 0 ? 'Inactive' : 'Active'); ?>



WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_ACCESS_LEVEL

Statistics: Posted by Cristián Lávaque — September 3rd, 2011, 10:21 pm


]]>
2011-09-03T19:34:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14855&p=33930#p33930 <![CDATA[Echo Role name.]]>
Billy, Your Time will Expire on:
Sunday January 1st, 2012

Your account is currently set to: subscriber
(If the user is set role subscriber I want the text displayed to say "Inctive"}


Billy, Your Time will Expire on:
Sunday January 1st, 2012

Your account is currently set to: s2member_level2
(If the users role is set to s2member_level2 I want "Active Displayed)

I am using this code in my functions.php

Code:
function get_user_role() {
   global $current_user;

   $user_roles = $current_user->roles;
   $user_role = array_shift($user_roles);

   return $user_role;
}


and using this in my footer.php where the message is shown to the users.

Code:
<?php echo get_user_role(); ?>


I hope someone can help me with this issue Ive been trying my best to figured it on my own but need someone to lead me in the right direction.

Statistics: Posted by bakinblack — September 3rd, 2011, 7:34 pm


]]>