WPIntell

Source evidence

[Plugin: EventPress] Event Invitations

EventPress · support · 2010-11-02T01:43:00+00:00

complaintsentiment
mediumseverity
0.86relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 23 rows with source links

17.4% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

19 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Micah Wood unresolved
Kunalb, Sorry if I am bugging you too much, but there is one other question I have. For any given event, the user has the ability to send invitations out for the event. Currently, all of the members in the directory appear on the ‘Send Invites’ section. I saw that you are using the get_inviteable_ids() function to put this query together. What would be the easiest way for me to limit a user’s ability to send invites to just that user’s friends? We prefer that users can’t invite all the users on the site, as this list is going to be quite large. http://wordpress.org/extend/plugins/eventpress/ Easiest would be to override the inviteableids list generated by that function using the filter ep_inviteable_ids. I made a rather complex query to find people who hadn’t already been invited, etc. etc. which is captured in get_inviteable_ids (ep/models/registration.php) For anyone trying to do the same thing, here is the code that I dropped into my theme’s function.php file: add_filter('ep_inviteable_ids', 'get_just_friends'); function get_just_friends($data){ global $wpdb; $user_id = get_current_user_id(); // WP Function if( !friends_check_user_has_friends($user_id) ) return FALSE; $friends = friends_get_friend_user_ids($user_id); // BP Function $friend_count = friends_get_total_friend_count($user_id); // BP Function $friend_set = NULL; $i = 1; foreach($friends as $friend){ $friend_set .= 'ID = '.$friend; if( $i != $friend_count ) $friend_set .= ' OR '; $i++; } $query = "SELECT ID, user_email, user_nicename, display_name, display_name AS value FROM ".$wpdb->users." WHERE ".$friend_set; $data = $wpdb->get_results($query); return $data; } Thanks for your help on this!

Comments

2 shown
kunalb 2010-11-02T06:37:00+00:00

Easiest would be to override the inviteableids list generated by that function using the filter ep_inviteable_ids. I made a rather complex query to find people who hadn’t already been invited, etc. etc. which is captured in get_inviteable_ids (ep/models/registration.php)

Micah Wood 2010-11-03T23:39:00+00:00

For anyone trying to do the same thing, here is the code that I dropped into my theme’s function.php file: add_filter('ep_inviteable_ids', 'get_just_friends'); function get_just_friends($data){ global $wpdb; $user_id = get_current_user_id(); // WP Function if( !friends_check_user_has_friends($user_id) ) return FALSE; $friends = friends_get_friend_user_ids($user_id); // BP Function $friend_count = friends_get_total_friend_count($user_id); // BP Function $friend_set = NULL; $i = 1; foreach($friends as $friend){ $friend_set .= 'ID = '.$friend; if( $i != $friend_count ) $friend_set .= ' OR '; $i++; } $query = "SELECT ID, user_email, user_nicename, display_name, display_name AS value FROM ".$wpdb->users." WHERE ".$friend_set; $data = $wpdb->get_results($query); return $data; } Thanks for your help on this!