Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 77 total)
  • Avatar of dcavins
    dcavins
    Participant

    @dcavins

    I think I’ve solved this by removing the do_shortcode filter on that admin page. (It’s the front-end settings screen created by the group extension.)

    
    add_action('bp_init','dont_process_shortcodes_filter');
    function dont_process_shortcodes_filter() {
          if ( bp_is_current_component( 'groups' ) && bp_is_current_action( 'admin' ) && bp_is_action_variable( $extension_slug, 0 ) ) {   	) {
            	remove_filter( 'the_content', 'do_shortcode', 11);
          }
    }
    

    I was using the wrong priority on remove_filter, which always gets me. :)

    Thanks for your help!

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    I still haven’t solved this. It looks like it’s not just me though. It’s also true that if you insert short codes in bbPress topic content then edit that content, the short codes are interpreted in the editor input box.

    Does anyone have any ideas how I could make some headway on this problem? Thanks!

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    I solved this by adding the following filter. It removes “group-button” from the button wrapper (only on request membership buttons) so that buddypress.js will ignore the click.

    
    add_filter( 'bp_get_group_join_button','request_membership_redirect' );
    
    	/**
    	 * Change group "Request membership" button behavior-- always redirect to request membership pane, no AJAX requests.
    	 *
    	 */
    	public function request_membership_redirect( $button ) {
    		// To prevent buddypress.js from acting on the request membership button click, we'll need to remove the class .group-button from the button wrapper. See buddypress.js line 1252.
    
    		if ( $button[ 'id' ] == 'request_membership' )
    			$button[ 'wrapper_class' ] = str_replace( 'group-button', '', $button[ 'wrapper_class' ] );
    
    		return $button;
    	}
    
    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Does the logout redirect work if BuddyPress is deactivated (i.e. if you’re just running a typical WordPress site)?

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    The label of the button is internationalized. See bp-friends-template.php : bp_get_add_friend_button()

    I’d double-check this guide: http://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/

    I personally had trouble with getting the naming convention on the .po and .mo files right.

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Sure. You’ll need a to make a loop in which you get the ids of the group members and then create a query to fetch those posts.

    For getting group member ids, look at:
    groups_get_group_members( $args = array( $group_id => # ) )

    For the query by author ids: http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Hi Leonson-

    This sounds like a .htaccess or server configuration problem. What kind of server are you running the site on? Can you post the rewrite rules from your htaccess file (assuming it’s a linux server)?

    -David

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Hugo-

    Thanks so much for the push. I was going about this the wrong way, and had totally forgotten about the template hierarchy: http://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/

    Thanks for your quick reply,

    -David

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    It sounds like you’re heading in the direction of a private community. Keep in mind that if it’s private, then search engines can’t index your content. Which may be good or bad, depending on your goals.

    You’ll find a lot of info by searching this support forum or the web for “buddyPress private community”

    For instance:

    http://buddypress.org/support/tag/private-community/

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    You’ll need to logout to visit the register page. (If you’re already logged in, then you don’t need to register.)

    I usually fire up a second browser to see what the non-logged-in user sees. In this case, it’s the only way to visit the register page.

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    I think it really depends on the plugin. Some plugins make the creation step routine filterable (like BuddyPress docs) and some do not, unfortunately. Of course, uou could add a filter to plugins that don’t have them, and submit the changes back to the plugin author.

    In the case where it is filterable, like BP docs, you can hook in like this:

    add_filter('bp_docs_default_group_settings', 'bp_docs_default_settings_for_child_groups', 10, 1);
    function bp_docs_default_settings_for_child_groups($settings) {
      // If this new group is a child group of another group, we'll set up BP docs to match the parent group's setup. This step copies the parent group's attributes over to the child group.
      // We may have to get the parent ID from the cookie 'bp_new_group_parent_id'
        $parent_id_cookie = $_COOKIE["bp_new_group_parent_id"] ;
        $parent_settings = groups_get_groupmeta( $parent_id_cookie, 'bp-docs');
        
        if ( !empty($parent_settings) ) {
          $settings = array(
              'group-enable'  => isset( $parent_settings['group-enable'] ) ? $parent_settings['group-enable'] : 0,
              'can-create'  => isset( $parent_settings['can-create'] ) ? $parent_settings['can-create'] : 'admin',
            );
        }
    
      return $settings;
    
    }

    But as to a general case, I’ve not found the answer. Most plugins want to have their settings set on group creation, too, so you’ll need to handle that task as well.

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    The easiest way I’ve found to hide the “last active 3 hours ago” info box is to comment out those bits in the templates in your theme. For instance, in members > members-loop.php, about line 57, you’ll see
    <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>

    Comment that whole line out, and the last active message is hidden.

    Re the first question, Members shouldn’t appear in the list until they’ve activated their accounts, I believe. So you may have a bunch of unactivated members pending. The Pending Activations plugin should show you a list of those. I can find a few members that don’t appear in the members directory because they have created no activity at all, so maybe you’re seeing that problem as well.

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Hi Jon-

    You’ve probably already solved this, but I’m thinking you’re going to need top attach some meta to the groups, then use the very cool new group meta filter for bp_has_groups(). The group loop might look like:

    $args = array( 
    		'meta_query' => array(
    			array(
    				'key' => 'meta_key',
    				'value' => 'value_1',
    				'compare' => 'LIKE',
    			)
    		) 
    	);
    
    	if ( bp_has_groups ( $args ) ) { //...

    Here’s an example of writing a plugin to collect group meta: http://codex.buddypress.org/plugindev/how-to-edit-group-meta-tutorial/

    Good luck!

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Looks like the problem is that the WP function you’re using is deprecated. Try

    get_the_author_meta('ID')

    http://codex.wordpress.org/Function_Reference/get_the_author_meta

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    It’s generally preferred to let the user decide whether he wants to open a link in a new window or the same window. That said, you can use jQuery to force content to open a new window to happen:

    http://stackoverflow.com/questions/4742746/jquery-open-new-window-on-page-load

    Or, you could filter the output for the fields by adding a filter to bp_get_the_profile_field_value (you’ll be adding target="_blank" to the anchor tag). Here’s an example that removes hyperlinks from the output for specific fields:

    function cpfb_unlink_fields( $field_value ) { 
     
    	$options = array ( //These are the ids of the fields you want to target
    					12,
    					14 
    	)
    		
    	if ( in_array( bp_get_the_profile_field_id(), $options ) )
    		$field_value = strip_tags( $field_value );
    
    	return $field_value;
    
    }
    add_filter( 'bp_get_the_profile_field_value', 'cpfb_unlink_fields', 998, 1 );
    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    You can use r-a-y’s code to remove that pane:

    //Removes mentions pane from profile activity (doesn't remove mention functionality)
    function ray_remove_mention_nav() {
    global $bp;
    bp_core_remove_subnav_item( $bp->activity->slug, 'mentions' );
    }
    add_action( 'bp_setup_nav', 'ray_remove_mention_nav', 15 );

    It works on my 1.8+ test setup.

    -David

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Great! Thanks for clearing this up.

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    As a hack I can hide them using css by adding this to my functions.php file:

    function hide_group_admin_tabs($classes) {
      $user_id =  bp_loggedin_user_id();
      $group_id =  bp_get_current_group_id();
      if ( bp_is_groups_component() ) {
        if ( groups_is_user_admin($user_id, $group_id) ) {
          $classes[] = 'group-member-admin-cap';
        } else if ( groups_is_user_mod($user_id, $group_id) ) {
          $classes[] = 'group-member-mod-cap';
        }
      }
      return $classes;
    }
    add_filter( 'body_class', 'hide_group_admin_tabs', 98 );

    And then adding display:none; rules to the tabs. But I would like to handle the navigation the right way (and not with a css hack). Any ideas?

    Thanks for your help,

    -David

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Hi Craig-

    BuddyPress does require account activation for new users by default (as far as I know). You can verify this by looking in the wp_users table in your site’s database. Check to see if any of your users have a user_activation_key and what their user_status is. When a new user registers, they are given an activation key and a user_status of 2 (unverified). Once they activate using the e-mailed link, the key is deleted and the user_status becomes 0.

    Your web server does need to be able to send mail for all this to happen, though, and there’s a lot that can go wrong on that end.

    -David

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Sorry, I think I misunderstood your question from the beginning. You’re not trying to display topics on the front page of a group. You’re trying to show topics on the site’s front page? If so, what I’ve talked about won’t help at all. :(

    In looking into bbPress, I can’t really see how a particular forum is associated with a group. So I’m afraid I’m not going to be much help. Maybe someone else knows more about bbPress’s group forum integration?

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    That’s too bad. A couple of questions I should have asked at the beginning:

    1. What theme are you using?
    2. If you remove the conditional we added, does bbPress return topics for the correct group?
    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    Put this before the code we’ve been talking about, and see what it displays on the page:

    $test_id = bp_get_current_group_id();
    echo 'The current group ID is:' . $test_id;

    If it returns a number besides zero (zero means that it can’t figure out which group is the current group, a non-zero number is the current group ID), then you could probably adjust the conditional code:

    if ( bp_group_is_visible( bp_get_current_group_id() ) ) {
    //do the topics loop here
    }

    Fingers crossed.

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    When you say it didn’t work, do you mean that people who should see the topics couldn’t, or that no one could see the topics, or that everyone could see the topics? Was it too generous in letting people through or did it keep everyone out? ;)

    Also, could it be that this is this being used in a sidebar? I’m wondering if the placement on the page means that the group context is not certain, so you’d need to pass the group_id into bp_group_is_visible. Although I’d expect the bbp_topics to need to access the group_id as well.

    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    You should be able to wrap your bbp_has_topics output in a conditional like:

    if ( bp_group_is_visible() ) {
    //do the topics loop here
    }

    bp_group_is_visible checks to see if the group is public or private, and if it’s public, returns true. If not public, then it checks to see if the user is a member of the current group; if yes, it returns true. It’s located at /bp-groups/bp-groups-template.php -> line 377.

    function bp_group_is_visible( $group = false ) {
     378      global $groups_template;
     379  
     380      if ( bp_current_user_can( 'bp_moderate' ) )
     381          return true;
     382  
     383      if ( empty( $group ) )
     384          $group =& $groups_template->group;
     385  
     386      if ( 'public' == $group->status ) {
     387          return true;
     388      } else {
     389          if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
     390              return true;
     391          }
     392      }
     393  
     394      return false;
     395  }
    Avatar of dcavins
    dcavins
    Participant

    @dcavins

    I’m assuming you’re talking about navigation items. You can add some conditionals around individual items to only show them only if the user is logged in. Use this WP function: http://codex.wordpress.org/Function_Reference/is_user_logged_in

    That’s not as easily done if the item is in a WP-created navigation menu. This plugin looks promising: http://wordpress.org/plugins/menu-items-visibility-control/

    -David

Viewing 25 replies - 1 through 25 (of 77 total)