Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




access RS Group on Page

UserPost

10:26 pm
March 26, 2009


maraya

Member

maraya

posts 8

1

Okay, so I want to loop through all the members of a RS Group on a page on my site. 

I'm using Thesis, so everything needs to be inside of a function that gets called by hooks.

Would the following work?

Put

require_once(SCOPER_ABSPATH . "admin/admin_lib_rs.php");

at the beginning of the function. (I do have "assume no front-end admin" option enabled.)

Then,

$group_id = 8;

$users_in_webteam = ScoperAdminLib::get_group_members($group_id);
foreach ( $users_in_webteam as $team_member ) {

$id = $team_member->ID;

echo get_user_meta($id, 'display_name') . " is a member of the webteam.";

  ....}

Is that more or less right?

11:17 pm
March 26, 2009


maraya

Member

maraya

posts 8

2

Or maybe it's silly to be using Role Scoper Groups for what is really user meta data that has nothing to do with permissions, and I'm making this way harder than it needs to be.Embarassed

9:13 am
March 27, 2009


Kevin

Admin

posts 2381

3

maraya said:

Okay, so I want to loop through all the members of a RS Group on a page on my site. 

I'm using Thesis, so everything needs to be inside of a function that gets called by hooks.

Would the following work?

Put

require_once(SCOPER_ABSPATH . "admin/admin_lib_rs.php");

at the beginning of the function. (I do have "assume no front-end admin" option enabled.)

Then,

$group_id = 8;

$users_in_webteam = ScoperAdminLib::get_group_members($group_id);
foreach ( $users_in_webteam as $team_member ) {

$id = $team_member->ID;

echo get_user_meta($id, 'display_name') . " is a member of the webteam.";

  ....}

Is that more or less right?

Yes, that will work. But you need to put another slash in your require statement:

require_once(SCOPER_ABSPATH . "/admin/admin_lib_rs.php");

9:16 am
March 27, 2009


Kevin

Admin

posts 2381

4

maraya said:

Or maybe it's silly to be using Role Scoper Groups for what is really user meta data that has nothing to do with permissions, and I'm making this way harder than it needs to be.Embarassed


If your permission groups correspond to another classification with makes sense to your front-end users, I don't see anything wrong with using that grouping to selectively display metadata.

9:51 am
March 27, 2009


maraya

Member

maraya

posts 8

5

Okay, thanks again Kevin!  I'm slowly getting the hang of this stuff… Appreciate your help.

Cool


About the Agapetry forum

Currently Online:

17 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1181

Posts: 5363

Members:

There are 1173 members

There are 1 guests


Kevin has made 2381 posts

Top Posters:

metal450 - 148

Ragnar - 102

YikYak - 68

whiteorb - 44

Daisy - 35

Administrator: Kevin | Moderators: Kevin