Shamim Hasan

Forum Replies Created

Viewing 15 posts - 1,531 through 1,545 (of 2,460 total)
  • Author
    Posts
  • in reply to: In need of both Reply and ReplyAll buttons #17333
    Shamim Hasan
    Keymaster

    It require many code change.
    If you need this feature badly you can contact through https://www.shamimsplugins.com/hire/

    in reply to: How to see old announcements after the role change #17327
    Shamim Hasan
    Keymaster

    See your role name 'Viitasaari started with '. Remove that ' from role name. Then try.

    Let me know.

    in reply to: How to see old announcements after the role change #17316
    Shamim Hasan
    Keymaster

    There are add more buttons for Admins and Groups in Front End PM PRO > Settings > Recipient. Does those work?
    Are you having any js error in role to role block setting page? Please see browser console and let me know.

    in reply to: How to see old announcements after the role change #17309
    Shamim Hasan
    Keymaster
    in reply to: Only allow user send to admin by shortcode #17302
    Shamim Hasan
    Keymaster

    Unchecked Front End PM PRO > Settings > Recipient > Can users send message to admin.
    Yours can still send message using https://www.shamimsplugins.com/docs/front-end-pm/shortcode/fep_shortcode_new_message_form/

    in reply to: How to see old announcements after the role change #17272
    Shamim Hasan
    Keymaster

    Use this code

    add_action( 'add_user_role', 'fep_cus_update_ann_when_role_change', 10, 2 );
    add_action( 'set_user_role', 'fep_cus_update_ann_when_role_change', 10, 2 );
    function fep_cus_update_ann_when_role_change( $user_id, $role ) {
    	global $wpdb;
    	
    	if ( ! defined( 'FEP_PARTICIPANT_TABLE' ) ) {
    		return false;
    	}
    	$mgs_ids = $wpdb->get_col( $wpdb->prepare( "SELECT fep_message_id FROM $wpdb->fep_messagemeta where meta_key = %s AND meta_value = %s", '_fep_participant_roles', $role ) );
    	if ( $mgs_ids ) {
    		$query = 'INSERT INTO ' . FEP_PARTICIPANT_TABLE . ' (mgs_id, mgs_participant) VALUES ';
    		
    		foreach ( $mgs_ids as $mgs_id ) {
    			$values[] = $mgs_id;
    			$values[] = $user_id;
    			
    			$place_holders[] = '(%d, %d)';
    		}
    		$query .= implode( ', ', $place_holders );
    		$wpdb->query( $wpdb->prepare( $query, $values ) );
    		
    		delete_user_meta( $user_id, '_fep_user_announcement_count' );
    	}
    }
    
    in reply to: Group Visibility (Role Restriction) In personal settings #17270
    Shamim Hasan
    Keymaster

    Add following code in your theme’s (child theme’s if any) functions.php

    add_filter( 'fep_get_option', function( $value, $option, $default, $is_default ) {
    	if ( 'gm_groups' !== $option ) {
    		return $value;
    	}
    	if ( is_admin() && 'users' !== @get_current_screen()->parent_base ) {
    		return $value;
    	}
    	if ( ! is_admin() && 'settings' !== @$_GET['fepaction'] ) {
    		return $value;
    	}
    	
    	// Change this with which role you want to give access to all groups
    	$allowed_roles = array( 'editor', 'administrator' );
    	
    	if ( array_intersect( $allowed_roles, wp_get_current_user()->roles ) ) {
    		return $value;
    	}
    	
    	// Change this with your desire groups slug
    	$groups = array( 'test1', 'test2' );
    	
    	foreach ( $groups as $group ) {
    		unset( $value[ $group ] );
    	}
    	
    	return $value;
    }, 10, 4 );
    

    Change roles and groups as required

    in reply to: Group Visibility (Role Restriction) In personal settings #17254
    Shamim Hasan
    Keymaster

    So you want to restrict those groups so that only editor and administrator can see those group in user settings page, other users cannot see those groups in settings page (in front-end), right?

    in reply to: Group message #17251
    Shamim Hasan
    Keymaster

    From version 10.1.1 this works your way. Users can get only messages which is sent when they are in that group.

    in reply to: How to see old announcements after the role change #17249
    Shamim Hasan
    Keymaster

    From version 10.1.1 both group message and announcement work this way. Users can access group messages/ announcements only which is sent when they are in that role/group.

    I have tested above code again and find working.
    I have created an announcement to test role RA. Then i have checked if user UA (which user role is not RA) have got that announcement. find that user UA have no access to that announcement. Now i changed that user role to RA and now that user have access to that announcement.

    Please check and let me know.

    in reply to: How to see old announcements after the role change #17233
    Shamim Hasan
    Keymaster

    Add following code in your theme’s (child theme’s if any) functions.php

    add_action( 'set_user_role', function( $user_id, $role, $old_roles ) {
    	global $wpdb;
    	
    	if ( ! defined( 'FEP_PARTICIPANT_TABLE' ) ) {
    		return false;
    	}
    	$mgs_ids = $wpdb->get_col( $wpdb->prepare( "SELECT fep_message_id FROM $wpdb->fep_messagemeta where meta_key = %s AND meta_value = %s", '_fep_participant_roles', $role ) );
    	if ( $mgs_ids ) {
    		$query = 'INSERT INTO ' . FEP_PARTICIPANT_TABLE . ' (mgs_id, mgs_participant) VALUES ';
    		
    		foreach ( $mgs_ids as $mgs_id ) {
    			$values[] = $mgs_id;
    			$values[] = $user_id;
    			
    			$place_holders[] = '(%d, %d)';
    		}
    		$query .= implode( ', ', $place_holders );
    		$wpdb->query( $wpdb->prepare( $query, $values ) );
    		
    		delete_user_meta( $user_id, '_fep_user_announcement_count' );
    	}
    }, 10, 3 );
    
    in reply to: How to create a new announcement #17210
    Shamim Hasan
    Keymaster

    Next version i will enable this by default.

    in reply to: Message URL link from Email #17197
    Shamim Hasan
    Keymaster

    May be next week.

    in reply to: autosuggestion inconsistant #17180
    Shamim Hasan
    Keymaster

    Thank you.
    “Display name publicly as” is the name which is made to show publicly.
    First Name and Last Name is saved in meta and is not searchable by default.
    When you search a user it searches by id, Username, Nickname, Email, Website url. So when you do not found any user please check if you are searching by any of these.

    in reply to: In need of both Reply and ReplyAll buttons #17168
    Shamim Hasan
    Keymaster

    Thank you.
    I really appreciate.

Viewing 15 posts - 1,531 through 1,545 (of 2,460 total)