BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #24642

    Oops!

    Thank you for asking me, butI requested my senior for this work for $200.( ノД`)

    I knew for the first time that I was able to request on this site.
    I look forward to the next opportunity.

    Thanks
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #24603

    Hi Brajesh,

    You just said it!
    But I want to unify the processing with the “fruits” and “members”.

    Since “fruits children” are added by add_action ('init', 'rewrite_init');, I want to do the same for “members children”.

    Regards
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20777

    Hi, Brajesh

    Oh, please don’t worry!

    Also, thank you for giving me good feedback.

    I changed the following ➀ and ➁.

    if( is_user_logged_in() ){
    $user_data = get_user_by( 'id', bp_loggedin_user_id() )->data;
    }

    bp_core_new_nav_item(
    	array(  
    	'name' => 'original',
    	'slug' => 'original',  
    	//'parent_url' => trailingslashit( bp_loggedin_user_domain() ),
    	//'parent_slug' => $user_data->user_nicename, 
    	'show_for_displayed_user' => false, // this page his only
    	'screen_function' => 'original_action',  
    	'position' => 80  
    	)  
    );

    I’m looking forward to your tutorial.

    Thank you as always.

    Regards
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20701

    Hi Brajesh,

    Thank your for your reply.

    I ditd it!
    Because of you!!
    All because of you!!!

    I appreciate your continued support.

    Regards
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20655

    Thank you. I appreciate what you have said.
    I will keep doing my best!

    Best regards
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20638

    Hi Brajesh,

    I couldn’t have done it without your help.

    function your_message_action_handler($message) {
    	// Message information
    	$time_micro = date("Y-m-d H:i:s") . "." . substr(explode(".", (microtime(true) . ""))[1], 0, 3);
    	$sender_id = $message->sender_id;
    	$thread_id = $message->thread_id;
    	$recipients_ids = wp_list_pluck( $message->recipients, 'user_id' );
    
    	// Update user_meta("notification_message")
    	foreach ($recipients_ids as $recipient_id) {
    		$notification_new_array = array(array('action'=>'message','time'=>''.$time_micro.'','senderID'=>''.$sender_id.'','recipientID'=>''.$recipient_id.'','threadID'=>''.$thread_id.'','read'=>'yet'));
    		$notification_current_txt = get_user_meta( $recipient_id, 'notification_message', true );
    		if( $notification_current_txt !== '' ){
    			$notification_current_array = unserialize($notification_current_txt);
    			$notification_update_array = array_merge($notification_new_array, $notification_current_array);
    			$notification_update_txt = serialize($notification_update_array);
    			update_user_meta( $recipient_id, "notification_message", $notification_update_txt );
    		}else{
    			$notification_new_txt = serialize($notification_new_array);
    			update_user_meta( $recipient_id, "notification_message", $notification_new_txt );	
    		}
    	}
    }
    add_filter( 'messages_message_after_save', 'your_message_action_handler' );

    Thank you so, so much!❤

    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20630

    Hi ,

    I had no idea.
    That means you can rewrite “user_meta(“notification_message”)” of everyone by arranging “user ids” as an array, right!?
    You’re so knowledgeable!

    function your_message_action_handler($message) {
    
    	// I did it
    	$sender_id = $message->sender_id;
    	$recipients_ids = wp_list_pluck( $message->recipients, 'user_id' );
    	update_user_meta( $recipients_ids, "notification_message", $sender_id );
    
    	// Is there a way to get the ID of that thread?
    	$message_thread = ???;
    	$message_link = 'http://example.com/members/smith/bp-messages/?thread_id='.$message_thread.'';
    
    }
    add_filter( 'messages_message_before_save', 'your_message_action_handler' );

    Is there a way to get the ID of that thread?
    I would like to use that thread ID and create a link to a thread.

    Regards
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20627

    Hi Brajesh,
    Thank you as always.

    Do you know a site listing how to use “$message”?
    I got “$sender_id” but I can not get “$recipients_id” and “$message_thread”.

    function your_message_action_handler($message) {
    
    	$sender_id = $message->sender_id;
    	$recipients_id = ???;
    	$message_thread = ???;
    	$message_link = 'http://example.com/members/smith/bp-messages/?thread_id='.$message_thread.'';
    
    }
    add_filter( 'messages_message_before_save', 'your_message_action_handler' );

    I did not understand the meaning of talking about threads.
    What mean check for empty thread id?

    I look forward to your response.

    Regards
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20609

    Hi, Brajesh.

    I forgot “return” .
    Finally, I managed to do it!

    Thank you for giving me good advice.
    You are a lifesaver.

    And Ravi, I am grateful for your support.

    I’ll keep on trying.

    Regards
    maimaimemain

  • Participant
    Level: Initiated
    Posts: 17
    maimaimemain on #20606

    Hi, Brajesh.

    How are you?

    Nice to hear from you.

    I hope your family are doing well.

    It’s getting much colder here in Tokyo.

    I want to when a user logs in to the site for the first time.

    Regards
    maimaimemain