Search Results for 'buddypress'
-
AuthorSearch Results
-
June 11, 2014 at 8:45 am #183902
In reply to: How do I make line/paragraph breaks in Group posts?
nyxxie
ParticipantThanks, 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.
June 10, 2014 at 6:28 pm #183887In reply to: Groups list does not appear
@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?
June 10, 2014 at 5:58 pm #183883In reply to: Who's Online Widget and Members Widget Not Working
@mercime
ParticipantHi, i’m using buddypress 2.01 on wordperss 3.9.1 multisite
@kaisarandretiyahoocom Sorry that you’re having this issue. Some questionsDid 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?June 10, 2014 at 5:37 pm #183879shanebp
ModeratorJune 10, 2014 at 3:52 pm #183872In reply to: [Resolved] /settings/profile is empty?
@mercime
ParticipantStrange. Is this a new installation or a recently updated one? WP/BP versions? Have you done some basic troubleshooting?
June 10, 2014 at 9:52 am #183862In reply to: Translation fails only at "Sitewide Activity"
danbp
ParticipantFinally I opened a ticket !
June 10, 2014 at 1:25 am #183854In reply to: Change first page shown for user profile
cwjordan
ParticipantInstead 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).
June 10, 2014 at 1:23 am #183853cwjordan
ParticipantIt 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).
June 9, 2014 at 10:19 pm #183850In reply to: How do I add "Favorites" to activity comments?
godavid33
ParticipantOk, 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.
June 9, 2014 at 5:50 pm #183840In reply to: Translation fails only at "Sitewide Activity"
danbp
Participanti 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.
June 9, 2014 at 5:31 pm #183839In reply to: Translation fails only at "Sitewide Activity"
shanebp
ModeratorJust 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_contextIt’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 );June 9, 2014 at 5:15 pm #183836In reply to: Translation fails only at "Sitewide Activity"
shanebp
ModeratorYou need to add this:
_x:1,2cTo 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,2cI use this approach and can change titles like ‘Sitewide Activity’
June 9, 2014 at 3:58 pm #183833In reply to: Scroll down user profile page
aldebaranmirko
Participantthank 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 thingthanks again
June 9, 2014 at 10:35 am #183827In reply to: Turning Off Public Messages
danbp
ParticipantJune 9, 2014 at 10:25 am #183825danbp
ParticipantJune 9, 2014 at 7:40 am #183821In reply to: Birthday Notification with thumbnail
danbp
Participanthi @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_BarPlaying with the toolbar (in french but code is in english)
http://www.geekpress.fr/wordpress/tutoriel/modifier-howdy-admin-bar-1102/June 8, 2014 at 7:28 pm #183813In reply to: Remove Friendship Notifications from Activity Stream
shanebp
ModeratorIn 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:
June 8, 2014 at 6:44 pm #183809In reply to: Adding Dynamic Profile Link to Main Menu Item
escudero95
ParticipantHi,
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.
June 8, 2014 at 6:12 pm #183808In reply to: Remove Friendship Notifications from Activity Stream
shanebp
ModeratorTake a look at:
In particular: filtering-options re action and object, and filtering-examples
June 8, 2014 at 9:02 am #183798In reply to: [Resolved] The member pages are missing
@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/June 8, 2014 at 12:21 am #183795In reply to: Avatar Cropping
tydd
ParticipantI 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 );June 7, 2014 at 12:59 pm #183786In reply to: Show @ handle beneath username
danbp
ParticipantBoth 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. 😉
June 7, 2014 at 7:20 am #183780In reply to: Best Guide For BuddyPress Theme Dev?
theatereleven
ParticipantI 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.
June 7, 2014 at 12:25 am #183776In reply to: Member Page Tabs
danbp
Participanthi @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/June 6, 2014 at 5:33 pm #183762In reply to: How to force photo-visibility settings
shanebp
ModeratorBuddyPress 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.
-
AuthorSearch Results