Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'buddypress'

Viewing 25 results - 16,526 through 16,550 (of 69,016 total)
  • Author
    Search Results
  • #183902
    nyxxie
    Participant

    Thanks, but I’m new to BuddyPress and I need to know exactly *where* to add the filter for it. I’ve been reading through the files and I can’t quite figure out where to add it.

    Any help would be wonderful. Please.

    #183887
    @mercime
    Participant

    @khushboo123 Please provide more information about your installation https://buddypress.org/support/topic/when-asking-for-support-2/ Also, have you done some basic troubleshooting?

    #183883
    @mercime
    Participant

    Hi, i’m using buddypress 2.01 on wordperss 3.9.1 multisite


    @kaisarandretiyahoocom
    Sorry that you’re having this issue. Some questions

    Did you activate BuddyPress Network-wide? Or did you just activate it in one site => main site or in subsite only using define ( 'BP_ROOT_BLOG', xx ); in your wp-config.php file?

    shanebp
    Moderator
    #183872
    @mercime
    Participant

    Strange. Is this a new installation or a recently updated one? WP/BP versions? Have you done some basic troubleshooting?

    #183862
    danbp
    Participant
    #183854
    cwjordan
    Participant

    Instead of the template change suggested above, it works better to add the following

    /* set default BP to profile page instead of activity page */
    define( 'BP_DEFAULT_COMPONENT', 'profile' );
    

    in your wp-content/plugins/bp-custom.php file (create that file if it does not exist – see https://codex.buddypress.org/plugindev/bp-custom-php/ for more about that file).

    cwjordan
    Participant

    It may be that you need to set:

    /* set default BP to profile page instead of activity page */
    define( 'BP_DEFAULT_COMPONENT', 'profile' );
    

    in your wp-content/plugins/bp-custom.php file (create that file if it does not exist – see https://codex.buddypress.org/plugindev/bp-custom-php/ for more about that file).

    #183850
    godavid33
    Participant

    Ok, well I had to figure this one out. It’s a bit of a lengthy solution. I’m not going to explain everything, as I can’t for either lack of knowledge or fear of being incorrect. I’ll just give you the code, tell you what it does, and where it goes.

    First, lets add the favorite button to the comments template. Find comment.php (in /activity) and add the code:

    
    		<?php global $activities_template; ?>
    		<?php if ( bp_activity_can_favorite() ) : ?>
    			<?php
    				$my_fav_count = bp_activity_get_meta( bp_get_activity_comment_id(), 'favorite_count' );
    				
    				$my_fav_count = "<span>".$my_fav_count."</span>";
    				
    				$is_favorite = apply_filters( 'bp_get_activity_is_favorite', in_array( bp_get_activity_comment_id(), $activities_template->my_favs ) );
    			?>
    
    			<?php if ( !$is_favorite ) : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger fav bp-secondary-action bp-primary-action" title="<?php echo god_get_favorited_usernames(bp_get_activity_comment_id()); ?>" style="position:relative;"><?php _e( 'Like', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php else : ?>
    
    				<a href="<?php echo apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( home_url( bp_get_activity_root_slug() . '/favorite/' . bp_get_activity_comment_id() . '/' ), 'mark_favorite' ) ); ?>" class="tooltip-trigger unfav bp-secondary-action bp-primary-action" title="<?php echo god_get_favorited_usernames(bp_get_activity_comment_id()); ?>" style="position:relative;"><?php _e( 'Unlike', 'buddypress' ); ?><?php echo $my_fav_count; ?></a>
    
    			<?php endif; ?>
    
    		<?php endif; ?>	
    

    This code simply adds the buttons, and gets all the necessary info and variables.

    Then, you’re going to need to modify the buddypress javascript. I personally modified both global.js and buddypress.js (through overriding in my template, which is a topic for a whole other thread), though I might be wrong in this. At any rate, look for the line (around 264 in buddypress.js):

    
    var parent = target.closest('.activity-item');
    

    and change it to

    
    var parent = target.closest('li');
    

    The reason we changed this line is so that our custom favorite button doesn’t default to grabbing the top level activity id. Now you can actually favorite comments!

    But wouldn’t it be nice if the user received a notification when someone favorited their activity? Add this bad boy to functions.php

    
    
    add_action("bp_activity_add_user_favorite","favorite_notification", 10, 2);
    
    function favorite_notification( $activity_id, $user_id = 0){
    	// By type and item_id
    	if($user_id != $activities["activities"][0]->user_id){
    		$activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'display_comments' => true) );
    		
    		bp_core_add_notification( $activity_id, $activities["activities"][0]->user_id, "notifier", bp_core_get_username(bp_loggedin_user_id())." liked: '".substr($activities["activities"][0]->content,0,20)."...'", $activity_id ) ;		
    	}
    }
    

    Hope this helped someone. It mostly works for me.

    #183840
    danbp
    Participant

    @wpleo,

    i checked the buddypress-pt_BR.po/mo. Sitewide Activity is correctly translated.
    I also added all gettext filters to the po, as mentionned by @shanebp
    without any result.
    I also tested with mesocolumn theme and magazine theme, with no result.

    The only solution for the moment is to change the original code to the old style way of translating a string ( __(”,”) )

    the string is in bp-activity-loader.php:109

    Change
    ‘directory_title’ => _x( ‘Sitewide Activity’, ‘component directory title’, ‘buddypress’ ),
    to
    ‘directory_title’ => __( ‘Sitewide Activity’, ‘buddypress’ ),

    will resolve the problem.

    #183839
    shanebp
    Moderator

    Just fyi – if you only have a few labels that you want to change, you can use these functions.

    https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
    https://codex.wordpress.org/Plugin_API/Filter_Reference/gettext_with_context

    It’s a lot faster than messing with .po files.
    But you need to know if the label is using a context parameter.

    So you can use this approach for ‘Sitewide Activity’…

    function example_gettext_with_context( $translated, $text, $context, $domain ) {
    
      if ( 'buddypress' !== $domain )  
            return $translated; 
            
      switch ( $text ) {
    
            case 'Sitewide Activity':
                return 'Bongos';		
    	
            default:
                return $translated;
        }
    
        return $translated;
    }
    add_filter( 'gettext_with_context', 'example_gettext_with_context', 11, 4 );
    #183836
    shanebp
    Moderator

    You need to add this:

    _x:1,2c

    To Catalog Properties > Sources keywords in PoEdit.

    This is due to the use of the ‘context’ parameter for some titles via ‘_x’

    For example, the second element is the context parameter:
    _x( 'Sitewide Activity', 'component directory title', 'buddypress' )

    Make sure your Sources Keywords has at least these entries:

    _
    _()
    __
    __()
    _x:1,2c

    I use this approach and can change titles like ‘Sitewide Activity’

    #183833
    aldebaranmirko
    Participant

    thank you very much, but it definitely works because I entered the code incorrectly.

    I use RTpanel theme then /wp-content/themes/rtpanel/header.php post at bottom:

    <body onload=’ location.href=”#anchor” ‘>

    while <div id=’anchor’>whatever</div> in wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php

    the page to jump below the header is that of the user profile BuddyPress, where there is activity, friends, groups, messages, etc …

    then I did not understand the ‘whatever’
    sorry but it is my first website, I have already learned a lot and I would also fix this thing

    thanks again

    #183827
    danbp
    Participant
    danbp
    Participant
    #183821
    danbp
    Participant

    hi @escudero95

    here are 2 function you can use for do what you need. The first add Happy birthday on the Toolbar, near the Howdy.

    The second will add the same thing on the profile header, above @username at the right of the avatar.

    These function can be used from within bp-custom.php or theme’s functions.php

    You have to create a date type profile field and set it to be viewed by friends only.

    Naturally this is intended to be an example of use. It’s certainly perfectible. Also take care of the different comments inside the code. Have fun !

    
    function bpfr_happybirthday( $wp_admin_bar ) {
    	global $bp;
    	
    	// if user is not logged in, we show nothing
    	if ( !is_user_logged_in() )
    	return false;
    	
    	// is xprofile component active ?
    	if ( bp_is_active( 'xprofile' ) )	
    		   // fetch the birthdate
    		   // as the function should work outside of the profile loop, we first need the user_id
    		$user_id = bp_get_activity_user_id();
    			
    			// now we get the birthdate and our text to show (text | username). 53 is the field id.
    			// depending your theme, this may be adjusted by css as it goes probably on two lines
    		$birthdate = xprofile_get_field_data('53', $user_id ) ? __( 'Happy Birthday ' ) . bp_core_get_username( bp_displayed_user_id() ) : '';	
    		
    		// building the output and adding some css	 
    		$user_id = bp_displayed_user_id();
    
    		// condition for the greating on the toolbar
    		if (!is_user_logged_in( $user_id ) ) { 		
    		
    		$my_title = '<span style="float: left; width: 16px;	height: 16px; margin: 5px 5px 0 -1px; display: block; background-color: green; border-radius: 16px;"></span> '.$birthdate.' ';
    		
    			$args = array(
    			'parent'    => 'top-secondary', // position
    			'id'		=> 'birthday_item', // unique identifier
    			'title' 	=> $my_title, // the name who appears on the bar
    			);
    		
    	
    			$wp_admin_bar->add_node($args);
    		}
    	
    }
    add_action( 'admin_bar_menu', 'bpfr_happybirthday', 90 );
    
    function bpfr_happybirthday2u() {
    	global $bp;
    	
    	// if user is not logged in, we show nothing
    	if ( !is_user_logged_in() )
    	return false;
    	
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = 'displayed: '. bp_displayed_user_id();
        } else {
            $user_id = 'get_member_user: '. bp_get_member_user_id();
        }
    	
    	// is xprofile components active ?
    	if ( bp_is_active( 'xprofile' ) )
    	
    	// fetch the birthdate
    	// as the function should work outside of the profile loop, we first need the user_id
    	$user_id = bp_get_activity_user_id();
    	
    	// now we get the birthdate and our text to show (text | username). 53 is the field id.
    	// depending your theme, this may be adjusted by css as it goes probably on two lines
    	$birthdate = xprofile_get_field_data('53', $user_id ) ? __( 'Happy Birthday ' ) . bp_core_get_username( bp_displayed_user_id() ) : '';	
    	
    	// building the output and adding some css
    	$my_title = '<div style="margin: 5px 5px 20px 5px; border:1px solid red; min-height:18px;"><div style="float: left; width: 16px; height: 16px; margin: 5px 5px 0 -1px; display: block; background-color: green; border-radius: 16px;"></div> '.$birthdate.' </div>';
    	
    	echo $birthdate;	
    	
    }
    add_action( 'bp_before_member_header_meta', 'bpfr_happybirthday2u' );

    Codex references:
    https://codex.wordpress.org/Class_Reference/WP_Admin_Bar

    Developer Resources

    Playing with the toolbar (in french but code is in english)
    http://www.geekpress.fr/wordpress/tutoriel/modifier-howdy-admin-bar-1102/

    #183813
    shanebp
    Moderator

    In this context, component IDs are the name of the component.

    I would use the ‘action’ filter and leave out ‘friendship_created’.

    Before you make changes, created a template over-ride for the activity-loop template.

    See:

    Theme Compatibility & Template Files

    #183809
    escudero95
    Participant

    Hi,

    I also have no buddypress items in the Menu area under appearance. I am running 3.9.1. Does this functionality still exist?

    My site is at mukkytalk.com and is using Aggregate theme from eleganthemes.

    Thank you.

    #183808
    shanebp
    Moderator

    Take a look at:

    Activity Loop

    In particular: filtering-options re action and object, and filtering-examples

    #183798
    @mercime
    Participant

    @johnhome glad you have a working BP install using XAMPP.


    @zvi18
    I would suggest that you start off by checking out BuddyPress Documentation https://codex.buddypress.org/ and explore the features https://codex.buddypress.org/buddypress-components-and-features/ Try it out first locally by installing https://make.wordpress.org/core/handbook/installing-a-local-server/installing-xampp/

    #183795

    In reply to: Avatar Cropping

    tydd
    Participant

    I resolved it by fixing wp-content/plugins/buddypress/bp-core/bp-core-avatars.php

    if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
    		define( 'BP_AVATAR_FULL_WIDTH', 580 );
    
    if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
    		define( 'BP_AVATAR_FULL_HEIGHT', 580 );
    #183786
    danbp
    Participant

    Both mentionned files are in /buddypress/bp-activity/

    The SWA shows anything happening on the site. By default, each related site event shows the user avatar, the user name, the action and the date/time and all are clickable and lead to the action or to the profile. Adding a mention handle to this is overcomplicated and completely useless i guess.

    If someone post or comment on a blog, you’ll see it on the activity screens (profile and/or SWA) and you can comment the activity directly or leave a comment on the post page.

    Mentions are used to quote people or to call or messaging them, and not exactly intended to be shortcuts to make things faster. IRL you go to the post office to send a letter. On BP you go on a profile to talk with a user.

    And at least, BuddyPress is not Twitter. Think BuddyPress. 😉

    #183780
    theatereleven
    Participant

    I installed the new BuddyPress and started customizing. Was excited until I realized that the profiles don’t support WYSIWYG editors, image uploads, etc.

    BUMMER. So I’m not able to use BuddyPress at this time. I’m just building profiles with custom post types, and using USP Pro to have a form that registers a user and creates the profile. This gives me what I needed.

    If BuddyPress features are enhanced down the road, I’ll take another look.

    #183776

    In reply to: Member Page Tabs

    danbp
    Participant

    hi @joeyaberle,

    you have 2 options: 1) hardcoding the template file or 2) add the tab with a function to a placeholder.

    1) make a copy of buddypress/bp-templates/bp-legacy/buddypress/members/index.php and add it into your child-theme (see codex on how to do that) and add the html you want at line 24, after the endif;

    2) this function will add My Tab on the members directory nav bar, beside All members | My Friends | My Tab. Add it into your theme’s functions.php or bp-custom.php

    function bpfr_my_directory_setup_nav() {
    	echo'<li><a href="http://example.com/wp-content/themes/mychild/my_extra_page.php">My Tab</a></li>'; // link to what you want
    }
    add_action( 'bp_members_directory_member_types', 'bpfr_my_directory_setup_nav' );

    my_extra_page.php is a file that doesn’t exist. You have to create it first. This file should content at least:

    <div id="buddypress">
    <div id="members-dir-list" class="members dir-list">
    			<?php your stuff here....  ?>
    		</div><!-- #members-dir-list -->
    </div><!-- #buddypress -->

    Placeholder reference:
    buddypress/bp-templates/bp-legacy/buddypress/members/index.php:25
    More on the Codex:
    https://codex.buddypress.org/component/members/

    #183762
    shanebp
    Moderator

    BuddyPress does not provide photo albums.

    So you are using a plugin or theme that adds that functionality.

    You should contact the creators of that plugin or theme.

Viewing 25 results - 16,526 through 16,550 (of 69,016 total)
Skip to toolbar