BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 47
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 47

    Hello Brajesh,

    I have enabled the ‘BP_ENABLE_MULTIBLOG’ and also used the Bp Registration options plugin. But the two main issues that I am facing now are listed below:
    -I created two subsites (subsite1 & subsite2)
    -User1 registers in subsite1
    -User1 activates his account (mail approval)
    -User1 is only shown on Users of subsite1
    -Issue1: User1 is shown on Bp Registration plugin’s ‘Member requests’ on subsite1 and on subsite2
    -Issue2: User1 successfully login to subsite2 and then User1 is only shown on Users of subsite2

    Is there any way for the registered users of subsite1, not being able to login to another subsite (e.g. subsite2)?

    Best Regards,
    Sotiris

  • Participant
    Level: Enlightened
    Posts: 47

    Hi again,

    You are right!

    Thank you, again for you support!

    Best regards,
    Sotiris

  • Participant
    Level: Enlightened
    Posts: 47

    Hi Brajesh,
    I have just upgrade to 2.0.9 but the issue remains.

    Please take a look at the URLs that I gave you.

    Best Regards,
    Sotiris

  • Participant
    Level: Enlightened
    Posts: 47
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 47

    Thank you, for your help Brajesh.

    Along with the change in function below (Removed the bp_is_my_profile() check), did the trick!

    
    function hibuddy_get_context_user_id($user_id=false){
    
    if ( !is_user_logged_in() )
     return false;
     if( !$user_id )
     $user_id = bp_get_member_user_id();//for members loop
     if( !$user_id && bp_is_user() ) //for user profile
       return false;
     //$user_id = bp_displayed_user_id();
    
     return apply_filters( 'hibuddy_get_context_user_id', $user_id );
    }
    

    Regards,
    Sotiris

  • Participant
    Level: Enlightened
    Posts: 47

    Apologies. The freezing is about the buddydev.com page.

    The theme I use on the site is the Community Builder Pro Child and the template pack is the “legacy”.
    The code I have used is shown below.

    
    /**
     * Get a link to send a BetterMessage PM to the given User.
     *
     * @param int $user_id user id.
     *
     * @return string
     */
    function bm_get_send_private_message_to_user_url( $user_id ) {
        return bp_loggedin_user_domain() . 'bp-messages/?new-message&fast=1&to=' . bp_core_get_username( $user_id );
    }
    /********************
    //Show private message button on members list
    ********************/
    /**
     * Get the User Id in the current context
     * @param int $user_id
     * @return int user_id
     */
    function hibuddy_get_context_user_id($user_id=false){
    
    if ( bp_is_my_profile() || !is_user_logged_in() )
     return false;
     if( !$user_id )
     $user_id = bp_get_member_user_id();//for members loop
     if( !$user_id && bp_is_user() ) //for user profile
       return false;
     //$user_id = bp_displayed_user_id();
    
     return apply_filters( 'hibuddy_get_context_user_id', $user_id );
    }
    
    function hibuddy_get_send_private_message_button() {
    	// get the user id to whom we are sending the message
    	$user_id = hibuddy_get_context_user_id();	
    
    	if (!$user_id || $user_id == bp_loggedin_user_id())
    		return;
    	$defaults = array (
    	'id' => 'private_message-'.$user_id,
    	'component' => 'messages',
    	'must_be_logged_in' => true,
    	'block_self' => true,
    	'wrapper_id' => 'send-private-message-'.$user_id,
    	'wrapper_class' => 'send-private-message',	
    	'link_href' => bm_get_send_private_message_to_user_url($user_id),
    	'link_title' => __('Send a private message to this user.', 'buddypress'),
    	'link_rel' => __('Private Message', 'buddypress'),
    	'link_class' => 'send-message'
    	);
    
    	$btn = bp_get_button( $defaults );
    
    	return apply_filters('hibuddy_get_send_private_message_button', $btn);
    }
    
    function hibuddy_send_private_message_button() {
      $user_id = hibuddy_get_context_user_id();
      //echo buddydev_private_message_button_shortcode( $user_id );
      echo hibuddy_get_send_private_message_button();
    }
    
    if ( bp_is_active( 'messages' ) ){
    	add_action( 'bp_directory_members_actions', 'hibuddy_send_private_message_button', 10 );
      	//experiment with the last value to change position
    }
    
  • Participant
    Level: Enlightened
    Posts: 47

    Hello Daniel,

    You could try the following code in your function.php

    
    /**
     * Get a link to send a BetterMessage PM to the given User.
     *
     * @param int $user_id user id.
     *
     * @return string
     */
    function bm_get_send_private_message_to_user_url( $user_id ) {
        return bp_loggedin_user_domain() . 'bp-messages/?new-message&fast=1&to=' . bp_core_get_username( $user_id );
    }
    
    • This reply was modified 3 years, 11 months ago by Sotiris.
  • Participant
    Level: Enlightened
    Posts: 47

    Hello Brajesh,

    I finally find a way to solve the issue. I am not sure what exactly cause it, but it was definitely related to the Google Gtag code of analytics. I change the code from GTag to pure analytics.js and the problem is no longer there.

    Thank you for your help and assistant.

  • Participant
    Level: Enlightened
    Posts: 47

    I have just delete the APCu file (object-cache.php) for the caching. But still nothing.

    • This reply was modified 3 years, 12 months ago by Sotiris.