BuddyDev

Search

[Resolved] Allow group activity only disable non group activity

Tagged: 

  • Participant
    Level: Initiated
    Posts: 14
    Abhist on #45408

    How to set buddypress to

    Allow group activity only disable non group activity

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #45409

    Hello Abhist,

    Thank you for posting. But sorry I am not able to understand your requirement. Please help me understand it more clearly.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 14
    Abhist on #45411

    hi Ravi

    i want to show activity-update-form inside group only.

    that mean want allow to update actitivty to inside group only .

    and hide same form in localhost/activity page
    and
    localhost/members/admin/activity/ etc.

    • This reply was modified 2 years, 5 months ago by Abhist.
  • Participant
    Level: Initiated
    Posts: 14
    Abhist on #45413

    hi

    got solution

    
    add_action('template_redirect','hide_activity_form');
    
    function hide_activity_form () {
    
    If( !bp_is_group() ) {?>
    <style>
    .activity-update-form
    {
    
    display: none;
    	  visibility: hidden;
    
    }
    </style>
      <?php
    
     }
    
    }
    ?>
  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #45416

    Hi Abhist,
    That’s not the right way to handle it. anyone with basic web dev knowledge and get around this.

    Which theme and template pack are you using? The correct solution will be to remove the form from the page completely.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 14
    Abhist on #45418

    hi i am using buddyx theme.
    please guide better way

    • This reply was modified 2 years, 5 months ago by Abhist.
  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #45429

    Hi,
    You my try this.

    
    
    /**
     * Start buffering markup.
     * Keep a flag to discard it later.
     */
    function bd_custom_start_bp_nouveau_form_buffer() {
    	$GLOBALS['_bd_form_buffer_on'] = true;
    	ob_start();
    }
    
    //end buffering and discard.
    function bd_custom_end_bp_nouveau_form_buffer() {
    	if ( isset( $GLOBALS['_bd_form_buffer_on'] ) ) {
    		ob_end_clean();
    	}
    }
    
    add_action( 'bp_before_member_activity_post_form', 'bd_custom_start_bp_nouveau_form_buffer' );
    //add_action( 'bp_after_member_activity_post_form', 'bd_custom_end_form_buffer' );
    
    add_action( 'bp_before_directory_activity_content', 'bd_custom_start_bp_nouveau_form_buffer' );
    add_action( 'bp_after_activity_post_form', 'bd_custom_end_bp_nouveau_form_buffer' );
    
    

    This is for bp nouveau template pack. I do not use BuddyX and I am unable to confirm if it works with that theme or not.

    If it does not, Please consult the theme author.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 14
    Abhist on #45436

    wow

    it also works in my buddyx theme.

    thankyou Brajesh so much.

    you are dowing brilliant jobs

You must be logged in to reply to this topic.

This topic is: resolved