Resources

My Agape try

Your Agape try


Support Forum

Current User: Guest Login Register
Please consider registering

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 1326

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 1326

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



Reply to Topic: access RS Group on Page

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 9 + 6        (Required)

Topic Reply:


 

About the Agapetry forum

Currently Online:

11 Guests

Maximum Online: 88

Forums:

Groups: 2

Forums: 7

Topics: 667

Posts: 3053

Members:

There are 601 members

There are 1 guests


Kevin has made 1326 posts

Top Posters:

metal450 - 98

YikYak - 58

Ragnar - 36

Daisy - 35

LorenW - 33

Administrator: Kevin | Moderators: Kevin