Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1,376 through 1,400 (of 3,787 total)
  • @danbp

    Participant

    Which theme do you use ? You have probably to ask for this on the theme support if it is not one of WP’s twenty something themes.

    @danbp

    Participant

    Yes. Delete and also clear trash 🙂

    @danbp

    Participant

    Hi,

    no idea what happen to your install, but read here some advice:
    https://buddypress.org/support/topic/debug-error-bp_setup_current_user-was-called-incorrectly/

    @danbp

    Participant

    Hi @antipole,

    from non-epert to non-expert, i’ll try to explain what i understood from your previous request…

    You want to show a profile filed value on the member directory and this value should be searcheable in the same way as on a profile. Right ?

    On members directory, we need a field name, a field value, a user ID and a search link.

    This line of code will fetch the correct field, associated to the user ID:
    $value = xprofile_get_field_data('Ovni model', bp_get_member_user_id() ) )

    This line will build the url for that value
    $search_url = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );

    And this line will build the output. I use a div with a class name. I recommand you keep it as is and add your custom style from within your child-theme style.css. Inline style is not necessary here.
    $clickable = '<div class="click_dir"><a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $value . '</a></div>';

    And this generate the output: echo $clickable;

    And finally, we add our custom filter to the existing by using add_fliter( $filter_name, $my_filter):
    add_filter ( 'bp_directory_members_item', 'make_directory_profile_field_searchable' );

    That’s it.

    My snippet let you add such a clickable field. The field name is “ovni model”.
    The code is first calling that field, and before the final output on members directory, we add a clickable search url. This is a strictly BP way to add an url to a (field)value. This snippet doesn’t need another function to work.

    The field, from a profile perspective, will be Name Ovni model: value flying saucer. The link structure will be your-site/members/username/?s=flying_saucer.

    The snippet use the same structure on members directory and you’ll get the same result.
    Guess you don’t need the additionnal function add_info_to_members_loop.

    Try first and struggle after, it’s better for your karma ! 😉

    @danbp

    Participant

    Hi @antipole,

    try this:

    function my_custom_clickable_directory_profile_field() {	
    
    if ( $value = xprofile_get_field_data( 'Ovni model', bp_get_member_user_id() ) ) :
    
       // as of xprofile_filter_link_profile_data function
       $search_url = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
       $clickable = '<div class="click_dir"><a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $value . '</a></div>';
    	
       echo $clickable;
    	
       endif;
    }
    add_filter ( 'bp_directory_members_item', 'my_custom_clickable_directory_profile_field' ); 

    @danbp

    Participant

    Try

    function bpfr_hide_tabs() {
    global $bp;
    	 /**
    	 * class_exists() & bp_is_active are recommanded to avoid problems during updates 
    	 * or when Component is deactivated
    	 */
    
    	if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) :
    
    	if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    	}
    	endif;
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    @danbp

    Participant

    @paragbhagwat,

    try this:

    function bpfr_hide_tabs() {
    global $bp;
    	 /**
    	 * class_exists() & bp_is_active are recommanded to avoid problems during updates 
    	 * or when Component is deactivated
    	 */
    
    	if( class_exists( 'bbPress' ) || bp_is_active ( 'groups' ) ) :
    
    	if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    	}
    	endif;
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    @danbp

    Participant

    Sorry, i don’t understand what you write.

    @danbp

    Participant

    @gurusurfer,

    this need a template overload.

    Make first a child-theme.
    Copy notifications-loop.php from bp-templates/bp-legacy/buddypress/members/single/notifications/ to
    /child-theme/buddypress/members/single/notifications/notifications-loop.php

    At the begin of the file (line 1) copy/paste <?php bp_get_template_part( 'activity/post-form' ); ?>. Don’t remove php tags.

    Save. You’re done.

    @danbp

    Participant

    Please don’t double post. Topic closed.
    Conversation continue here:
    https://buddypress.org/support/topic/adding-whats-new-form-to-the-mentions-template/

    @danbp

    Participant

    hi @pws2015,

    try this. Add snippets to bp-custom.php

    First snippet is mandatory, second is an option. Note that hidden members activities and profiles stay public. The below code let you only hide users from the members directory.

    // hide members on directory
    function bpfr_hide_users_on_directory( $qs=false, $object=false ){
    	
    	// Id's to hide, separated by comma
    	$excluded_user = '5,38,30'; 
    
    	// hide to members & friends 
    	if($object != 'members' && $object != 'friends')
    	return $qs;
    	
    	$args = wp_parse_args($qs);
    	
    	if(!empty($args['user_id']))
    	return $qs;	
    	
    	if(!empty($args['exclude']))
    	$args['exclude'] = $args['exclude'].','.$excluded_user;
    	else
    	$args['exclude'] = $excluded_user;
    	
    	$qs = build_query($args);
    	
    	return $qs;
    	
    }
    add_action( 'bp_ajax_querystring','bpfr_hide_users_on_directory', 20, 2 );
    
    // once hidden, we recount the members
    function bpfr_hide_get_total_filter($count){
    	return $count-1;
    }
    add_filter('bp_get_total_member_count','bpfr_hide_get_total_filter');

    @danbp

    Participant

    Hi @ma3ry,

    unable to visit the indicated page due to redirection… BP’s xProfile text box contains are autolinked by default for the 5 first words.
    This is handy when you use a field called city for example. The city name is autolinked and let each user click on it to find other who may entered the same name.

    Of course, an about me box with a long description, which several autolinked words has less interrest. Fortunately, you can deactivate xprofile autolinking.
    Two options for this: all or selected.

    Here 3 snippets. The first can be used if you want to completely remove autolink from all field values.
    The second is a new filter to let you choose the field(s) you want to deactivate. This need two snippet. The first to rewrite a filter and the second to remove / replace the existing BP filter.

    Add the snippet to bp-custom.php.

    // remove any autolink from profile
    function remove_xprofile_links() {
    remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
    }
    add_action( 'bp_init', 'remove_xprofile_links' ); 
    
    // custom filter to selectively remove autolink
    function my_xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) {
    
        // Access the field you are going to display value.
        global $field;
    
        // In this array you write the ids (separated by comma) of the fields you want to hide the link.
        $excluded_field_ids = array(2);
    
        // If the id of this $field is in the array, we return the value only and not the link.
        if (in_array($field->id, $excluded_field_ids))
    	return $field_value;
    	
    	if ( 'datebox' == $field_type )
    	return $field_value;
    	
    	if ( !strpos( $field_value, ',' ) && ( count( explode( ' ', $field_value ) ) > 5 ) )
    	return $field_value;
    	
    	$values = explode( ',', $field_value );
    	
    	if ( !empty( $values ) ) {
    		foreach ( (array) $values as $value ) {
    			$value = trim( $value );
    			
    			// If the value is a URL, skip it and just make it clickable.
    			if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) {
    				$new_values[] = make_clickable( $value );
    				
    				// Is not clickable
    			} else {
    				
    				// More than 5 spaces
    				if ( count( explode( ' ', $value ) ) > 5 ) {
    					$new_values[] = $value;
    					
    					// Less than 5 spaces
    				} else {
    					$search_url   = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
    					$new_values[] = '<a href="' . $search_url . '" rel="nofollow">' . $value . '</a>';
    				}
    			}
    		}
    		
    		$values = implode( ', ', $new_values );
    	}
    	
    	return $values;
    }
    
    /**
     * We remove the buddypress filter and add our custom filter.
     */
    function remove_xprofile_links() {
        // Remove the old filter.
        remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );
        // Add your custom filter.
        add_filter( 'bp_get_the_profile_field_value', 'my_xprofile_filter_link_profile_data', 9, 2);
    }
    add_action('bp_setup_globals', 'remove_xprofile_links');

    @danbp

    Participant
    In reply to: Front-end Dashboard

    @danbp

    Participant

    If you use BuddyPress, each user can change/modify his profile picture on frontend !

    Try yoursite/members/username/profile/change-avatar/

    To share files, you have some plugins like BuddyDrive which comes also with a frontend editor.

    @danbp

    Participant

    BuddyPress Templaters are @mercime and @hnla.

    @danbp

    Participant

    Hi,

    if you’re comfortable with php, see here:

    bp_modify_page_title

    Here, an example:
    https://buddypress.org/support/topic/how-to-change-tags-order/
    Another use case here:
    https://buddypress.org/support/topic/how-to-get-notification-count-code/

    Hope this help !

    @danbp

    Participant

    Hi,

    this can be done by template overload and a child-theme.

    @danbp

    Participant

    If you plan to use myCred, ask also for this on their support.

    You can try this plugin: https://wordpress.org/plugins/thecartpress/ and if you’re comfortable with php, i recommand you to experiment a bit this plugin with upcoming BP 2.4 on a local install.

    Thought if the plugin hold what it promise on the description, it would be a piece of cake to intagrate it with 2.4.

    Other solution is woocommerce, but it’s a big plugin. Basically, you need just a few CPT and a good tutorial explaining how to install a simple e-store on WordPress.

    @danbp

    Participant

    BuddyPress doesn’t handle the register process, it only show it and add some custom field via xprofile component.
    Search on WP’s Plugin Repository or “wordpress age verification” with google. 😉

    @danbp

    Participant

    Are you sure that the translation exist ? Have you a buddypress-xx_XX.mo file ? Where xx_XX is the iso of your language (eg en_US).

    mo is a compiled format and the only file that php need to translate your strings.

    To get such file, you need to use a language compilator like poEdit. Changing strings in only buddypress-xx_XX.po has no effect on the translation. This format is a simple text format intended to be used by the translator.

    And the buddypress.pot (note the final T) is also a text format file which contains the list of all strings you can translate.

    Where do you add your copy and which language do you use ?

    @danbp

    Participant

    Have you correctly set up group forums ? Please read here(if you read french), ensure anything is correct and apply what i explained above.

    Main reference is here

    Installing Group and Sitewide Forums

    In reply to: Karmas and Credits

    @danbp

    Participant

    Yes i understand what you want to do, but you’re on a BuddyPress help forum. Your questions are not related to BuddyPress but to myCred. For such custom usage, please user the myCred help support.

    @danbp

    Participant

    Yes, it’s possible.

    Go to dashboard > Forums > New Forum

    – enter a title.
    – in the right column of the edit page, set the forum attributes to category (rubrique).
    – as parent forum, select the name of the group you want to add the new forum.

    Save. You’re done.
    Now you have on the group forum page, a first part containing a list of forum. One so far. This part will list all sub-forums belonging to that group.
    and a second part containing the topics of the main group forum.

    Et voilà !

    @danbp

    Participant

    You’re welcome, @henrywright, many thanks to you for debuging.

    @danbp

    Participant

    +1 for a group option plugin.

Viewing 25 replies - 1,376 through 1,400 (of 3,787 total)
Skip to toolbar