###NOTE, not sure if I’m allowed to post things like this, so delete it if I’m not. ALSO, rtMedia in no way supports this hack. Don’t bug them about it. ####
Thought I’d post this jquery code to combine the privacy settings for rtMedia and the BuddyPress Activity Privacy Plugin.
Basically what I’m doing is hiding the privacy controls for rtMedia and using the on change event on the BuddyPress Activity Privacy controls to set the appropriate reMedia selection.
jQuery(document).ready( function() {
jQuery('#rtSelectPrivacy').hide(); //Hide rtMedia's select control
jQuery("#activity-privacy").val( 'loggedin' );// Set BPAP control to rtMedia's equivalent default setting (i.e. loggedin == 'Users' in rtMedia's settings) This ensures the controls have matched selections from the beginning since BPAP doesnt have a default setting. NOTE: This assumes you have rtMedia's 'User Override' turned off.
jQuery('#activity-privacy').on('change', function() { // When a user changes the BPAP setting fire off a change on the rtMedia control.
if (this.value == 'public') { // public -> public
jQuery("#rtSelectPrivacy").val("0"); // set rtMedia to public
} else if (this.value == 'loggedin') { //loggedin-> users
jQuery("#rtSelectPrivacy").val("20"); //set rtMedia to Users
} else if (this.value == 'friends') { //friends -> friends
jQuery("#rtSelectPrivacy").val("40"); //set rtMedia to Friends
} else if (this.value == 'onlyme' || this.value == 'adminsonly') { //onlyme or adminsonly -> private
jQuery("#rtSelectPrivacy").val("60"); //set rtMedia to Private
}
});
});