Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Combining Role Scoper with the_author?

UserPost

5:04 am
November 10, 2010


roles99

Member

posts 3

1

Hi, firstly thanks for an excellent plugin - we think it's great :)

We want to create a 'writer of the month' award to issue to our team of authors. I decided it might be a good idea to create a RS group called "Writer of the Month" and then, each month, add the winners to that group. So far, so easy…

In single.php I want to display a small yellow star next to any author who is a member of "Writer of the Month" RS group. Is this possible? I know you can use code to see if the logged in user is a member of a RS group, but I need a way to see if the_author is a member of a group.

11:08 am
November 10, 2010


Kevin

Admin

posts 2503

2

You'll have to use this function call and then compare the array of member IDs to the user in question:

$group_members = ScoperAdminLib::get_group_members( $your_group_id, COL_ID_RS );

3:35 pm
November 10, 2010


roles99

Member

posts 3

3

I'm a learner programmer! But let me see if I understand this correctly.

Something like this?

$group_members = ScoperAdminLib::get_group_members( '12', COL_ID_RS );

$winnerid = get_the_author_meta('ID');

if (in_array($winnerid, $group_members)) {

// something

}

Is that it? :)

3:44 pm
November 10, 2010


Kevin

Admin

posts 2503

4

roles99 said:

I'm a learner programmer! But let me see if I understand this correctly.

Something like this?

$group_members = ScoperAdminLib::get_group_members( '12′, COL_ID_RS );

$winnerid = get_the_author_meta('ID');

if (in_array($winnerid, $group_members)) {

// something

}

Is that it? )


That looks right!

8:23 am
November 11, 2010


roles99

Member

posts 3

5

Seems to be working a treat :)


About the Agapetry forum

Currently Online:

14 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1245

Posts: 5653

Members:

There are 1255 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin