Exclude some users from processing
-
Hi,
First, thanks for the plugin. It works well.
I had to change it a little to exclude some users. The reason why is because I have some users excluded from all BP Activity (i.e. admin users that I don’t want showing up as online, or have their activities listed in the activity stream).
The problem is that with you new logic, these users will never have a last_login because this information is excluded from being written to the DB. The result is that every time they log in, the friend(s) get added.
To fix this, I just added some logic before the statement below to filter out certain users by user_id.
if (!( $bp->loggedin_user->id == “1” || $bp->loggedin_user->id == “2” || $bp->loggedin_user->id == “3” || $bp->loggedin_user->id == “4” )) {
if( ! isset( $last_login ) || empty( $last_login ) )
skw_bpaf_create_friendships( $bp->loggedin_user->id );}
It would be nice if you could include the option to exclude certain user ids from processing in the admin panel. i.e. just provide a comma separated list of ids.
.. Anyway, it’s just a suggestion.
Thanks again for the plugin.
Regards,
Mike.https://www.ads-software.com/extend/plugins/bp-automatic-friends/
- The topic ‘Exclude some users from processing’ is closed to new replies.