Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 3,404 total)
  • Sorry, I haven’t tested the plugin i mentionned. You’re right it doesn’t show a button but simply display favorites differently.

    OK, here is a snippet you can add to bp-custom.php which will add a Favorite button to blog posts.

    Note
    the function works with currrent BP version (2.6.2).
    The grey side of this solution is that you have to use a child-theme and to tweak a little the way the button will show. This is very theme dependant and would not be used the same way if you use ie. Twenty Sixteen or ie. Graphene.

    While using 2016, you can simply echo the button on the template.
    If you use a more complex theme, you could probably use an existing action hook of the theme. This means that you need a function who hooks into such a predefined placeholder.

    In any case, the file to modify is your theme’s single.php. Copy it into the child theme to get:
    /wp-content/themes/child-theme/single.php

    If you don’t see any do_action( ‘something’ ), you add the following in an appropriate place:

    echo get_fav_or_unfav_button_for_post( $post );
    Certainly inside the post loop, and probably below the post and before the comments.

    If you see some action hooks in single.php, you add this function to bp-custom:

    function fav_buttons() {
      echo get_fav_or_unfav_button_for_post( $post );
    }
    add_action( 'graphene_before_comment_template', 'fav_buttons' );

    You need to change graphene_before_comment_template to the action name used by your theme.

    add_action( 'graphene_before_comment_template'

    Hope to be clear.

    And here the function for the button:

    function get_fav_or_unfav_button_for_post( $post ) {
    global $bp, $activities_template, $post;
    
    	// only show the button to logged-in users
    	if ( ! is_user_logged_in() ) {
    	return '';
    	}
    	
    	$activity_id = bp_activity_get_activity_id( array(
    		'user_id' => $post->post_author,
    		'type' => 'new_blog_post',
    		'component' => 'blogs',
    		'item_id' => 1,  // blog_ID
    		'secondary_item_id' => $post->ID // post_ID
    		) );
    	
    	if ( ! $activity_id ) {
    	return '';
    	}
    
    	bp_has_activities(); // update $activities_template with user's favs
    	$old_value = false;
    		
    	if ( isset( $activities_template->activity->id ) ) {
    		$old_value = $activities_template->activity->id;
    		$activities_template->activity->id = $activity_id;
    	} else {
    		$activities_template->activity = (object) array( 'id' => $activity_id );
    	}
    	
    	// build the template
    	$code = '';
    	$code .= '<div class="activity-meta">'."\n";
    
    		if ( ! bp_get_activity_is_favorite() ) {
    		// if not favorited, add a "Favorite" button
    		$code .= ' <a href="'.bp_get_activity_favorite_link( ).'" class="button fav bp-secondary-action" title="Add to my favorites">Favorite</a>'."\n";
    		
    		} else {
    		
    		// else, add "Unfavorite" button
    		$code .= ' <a href="'.bp_get_activity_unfavorite_link( ).'" class="button unfav bp-secondary-action" title="Remove from my favorites">Unfavorite</a>'."\n";
    		
    		// Bonus button: "View all my favorites"
    		$code .= ' <a href="'.bp_loggedin_user_domain() . 'activity/favorites/" class="button unfav bp-secondary-action">View all my favs</a>'."\n";
    		}
    		
    	// closing .activity-meta
    	$code .= '</div>'."\n"; 
    
    	if ( false !== $old_value ) {
    		$activities_template->activity->id = $old_value;
    	} else {
    		//$activities_template->activity = null;
    $activities_template->activity = (object) array( 'id' => $activity_id );
    	}
    	return $code;
    
    }

    And voila !

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi @donsauce,

    there is no such setting in BuddyPress, but it exist a plugin !
    See:
    https://wordpress.org/plugins/buddypress-profile-views/

    Salut,

    members are deleted 3 or 4 days after their registration
    Perhaps simply because they deleted their account ? ๐Ÿ˜‰
    Check Settings > BuddyPress > Options
    Suppression de compte []Les membres peuvent supprimer eux-mรชmes leur compte

    or some custom function in theme or bp-custom ?

    To know if it is related to theme, Force Photo or any other plugin, deactivate it(them) and see if it change something.

    Nothing better at the moment.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hummm, now it’s me who doesn’t understand !

    You asked first
    is there any way we can add the existing buddypress favorites to the blog posts

    and now you say
    I wish to have it in blogs โ€“ so […] I can press Favorite

    Sorry if i misunderstand your request, english is not my mother language… Do you want to add a [favorite] button to each blog post ? Or do you want to remove some filters from activity favorites ?

    Activity → Favorites

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    the files should be in wp-content/languages/plugins/buddypress-nl_NL.mo

    Are you on a live site or a local install ?

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Please note that you don’t need to add your site url in each of your topic. It’s useless and considered as a bad practice when nobody asked specifically for it.

    About privacy, read here

    Making a WordPress & BuddyPress Site Private, the Right Way

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    where have you taken the po/mo files ?
    where have you added the files ?

    When WP is in dutch (or any other language) and BP is activated, you have normally nothing to do with the translation files as they are loaded automatically.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    if you can code, it won’t be a big work.

    Perhaps taking the problem from another side would be a better solution ?

    Each blog post has an author. Presuming you want to show the author’s favorites ? In this case, instead of re-building the fav list on the blog template, you could link to this author profile, directly on his fav tab.

    I have a shortcode ready for this, in case of you want use that solution.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    Which group menu are you talking about ?
    How do you add the link ? And why ? Because, you haven’t to do that on a standard MS install, even for private groups. Sorry, but this point is a bit unclear.

    Review your forum settings:

    Installing Group and Sitewide Forums

    Group Settings and Roles

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    your question relates to bbPress. You’ve better chance to get answers by asking on bbpress forum.

    Note: linking to sites requiring registration to see comment forms to illustrate what you want is not cool at all. You’ve better to make screenshots.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hallo @mmirlach,

    Iโ€™ve activated the toolbar bubble in the settings… What are you talking about ? Such a setting doesn’t exist in BuddyPress.

    You can get any css information you need for this by:
    – right click on the page where you see this bubble and check the source code
    or
    – use Firebug or a similar tool.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Is the child theme only good for Buddypress editing? YES

    Or can I use it to edit another plugin as well? NO
    Plugins don’t have (at the moment) a child-plugin.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    no need to triple post. One topic is enought. (i deleted the 2 others).

    You have trouble with a plugin, and this plugin has is own support. You have to ask there and give more details about your install (WP/BP version, used theme name, plugin list).

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi @ma3ry,

    the issue comes probably from the membership plugin who conflicts with BP registration.

    In brief, what ever this plugin does(or not), when BP is activated, you have on registration process the WP login routine (username, email, password) and the little mandatory Name field coming from BP.

    That’s all.
    What probably happen, is that you don’t have this Name field on Single Membership registering…
    Because of this, BP doesn’t know about the user existence and can’t fire the additionnal xprofile fields.

    That the first diagnostic.
    A second one may be more complex, as it is related to the fact you changed the php version and using WP 4.6.x

    You certainly made a big DB dump before that change. And also a new WP install – or at least, a WP update. If you made just a WP upgrade, it would be ok to a certain point.

    If you started a new install after the php change, the problem can be in the old datas you injected to the new DB. But no panic, it’s only an hypothese at the moment.

    So it would be great you give details about this and if possible your server configuration.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi @bastianernst

    guess you made some mistake while activating BuddyPress and using your theme. Probably you have also some other plugins in use ?

    So, aside from reading absolutely throuhg the install BP documentation, i strongly recommand that you check the site fonctionnalities by using only:

    WP+BP+Twenty Sixteen theme. No other plugin, no custom code.

    If you allowed registration, you have a login widget (the one coming with WP) you can activate in the sidebar. Do this for testing the password change (click on lost password ?) once active.

    Also on the basic install, you should have all BP menus in the usermenu (top right corner) and on a user profile.

    Once anything ok on this install, upload BP Default Data plugin and activate it. This will add fake datas in all parts of BP, so you have content everywhere that let you test completely the site.

    Go through and see how it works.

    If all seems ok, you can then activate the final theme. Simply remind that BP pages should be empty, without any content or template model.
    Don’t forget to set up pretty permalinks (whatever but by default) and with a little luck, you’ll be on the right path.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    it’s wrong !

    1) You add only copies of the files you want to modify. The original templates are in
    wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/

    2) the path in a child should respect the original directories, like this
    wp-content/themes/graphene-child-theme/buddypress/members/register.php

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    hi Henry @henrywright,

    wp-content/languages/plugins/buddypress-en_GB.mo

    this path is the one used by GlotPress’s official automated translation updates for BP (and any other plugin translation if it exist). Same behave for the languages/themes/ directory.

    If you add a customized po/mo there, it will be overwritten at next update !

    Since i18n new improvements in WP 4.6, the only way to keep the integrity of a custom translation actually, so far i know, is to use this plugin: wpt-custom-mo-file, who allows you to override and use your own translation files for any WordPress themes or plugins.

    Just to let you know. ๐Ÿ™‚

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    @venutius,

    that trick stopped to work since BP 2.6
    The new syntax to use from now on is given here:

    Navigation API

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    For 1), it’s no easy to do, if even it is doable ! Activities have already a filter for posts, but nothing for post categories. Main reason is given in this 6 years old topic – but technically still available i think:
    https://buddypress.org/support/topic/highlight-specific-post-categories-in-the-activity-stream/#post-72043

    More recently, slightly different, but just in case of.

    Filtering Activity Loops

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    sorry, less is more ! ๐Ÿ˜‰
    Try something like this within a function. The way to get the user_id depends where you insert the link(ie. in or outside members loop, blog, an so on).

    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();
    }
    $username = bp_get_displayed_user_fullname( $user_id ); 
    //$username = bp_core_get_username( $user_id );
    
    echo '<a href=" '.wp_nonce_url( bp_core_get_user_domain( $user_id ) ).' " rel="nofollow">@'.$username .'</a>';
    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    user metas are part of wordpress and stored in wp_usermeta table
    xprofile datas are part of BuddyPress and stored in 4 different tables wp_bp_xprofile_ > data, meta, fields, groups

    BuddyPress Database Diagram


    https://codex.wordpress.org/Database_Description

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    tThat’s a bbPress related question. There is an old plugin which may be appropriate. Give it a try

    https://wordpress.org/plugins/bbpressmoderation/

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    for 2), this is where updates on my profile are showing up. If it is there, it’s most probably you published an update containing a link to a video.

    If you click on “view” at the right, you’ll see this update on a new screen from where you have access to a delete button.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    To get the link to a user profile:
    $link = bp_get_loggedin_user_link();

    Many use examples can be found on the forum. Ie:

    [Resolved] BuddyPress Links URLs

    Is it possible to make Activity and Forum profile tabs private?

Viewing 25 replies - 1 through 25 (of 3,404 total)
Skip to toolbar