Forum Replies Created
-
You’re welcome! Is snippet working for you ?
In reply to: Buddypress Registration page auto suggest pluginHi,
here a script to load an xprofile country list
and here an autoload JS scriptAnd here some instructions for enqueuing a JS to login/register page.
Happy coding !
not_friends are in fact
members. Are you sure you want to built this, as such widget already exist ! Ok, has no Add Friend button…Another solution would be to use a shortcode who will fire a kind of Members widget and the add friend button. Huh ? 🙂
Add this snippet to bp-custom.php
function show_our_members( $atts ) { $user_id = bp_displayed_user_id(); /** * Options * type:active, newest, popular, online, alphabetical, random) * number:number of items * size:size of avatar in px */ $atts = shortcode_atts( array( 'type' => 'newest', 'number' => '10', 'size' => '30' ), $atts, 'ourmembers' ); if ( bp_has_members( 'type='.$atts['type'].'&max='.$atts['number'] ) ) : while ( bp_members() ) : bp_the_member(); ?> <ul><li class="vcard"> <div class="item-avatar"> <a>"><?php bp_member_avatar(); ?></a> </div> <div class="item"> <div class="item-title fn"><a>" title="<?php bp_member_name(); ?>"><?php bp_member_name(); ?></a></div> <div class="item-meta"><?php bp_add_friend_button( $user_id ); ?></div> </div> </li></ul> <?php endwhile; endif; } add_shortcode( 'ourmembers', 'show_our_members' );The shortcode to use (in post, pages, widgets…), eg.
[ourmembers size=20 type=newest number=8]The only thing you have to do, is to style it accordingly to your theme layout.
Note that the classes are those used in BP’s Members widget. You can use them or add your own.In reply to: [Resolved] Hide Topics and Replies from choicesI finally asked Boone for help.
bbp_buddypress_loadedfires before everything is, in fact, fully loaded. bbPress’s component-specific extensions aren’t loaded until bp_init:7 (ty @boonebgorges for this explanation).Changing add_action to
bp_initwith a priority of 8 did the job !This may work for Site Activities, Members and Group activities
function bpfr_remove_activity_dropdown_label() { // Remove forum filters in site wide activity streams remove_action( 'bp_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 ); // Remove forum filters in single member activity streams remove_action( 'bp_member_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 ); // Remove forum filters in single group activity streams remove_action( 'bp_group_activity_filter_options', array( bbpress()->extend->buddypress->activity , 'activity_filter_options' ), 10 ); } add_action( 'bp_init', 'bpfr_remove_activity_dropdown_label', 8 );Works also by using
bp_actionshook.In reply to: [Resolved] Removing nav & subnav item in groupsIn reply to: Can’t Activate WP User SyncYou should READ the error msg when you see one ! The plugin who generated the error is mentionned in it…
The support forum is here: https://fr.wordpress.org/plugins/bp-xprofile-wp-user-sync/@kookidooki,
you’re lucky ! Read here: https://buddypress.org/support/topic/cannot-create-groups-2/#post-255034In reply to: [Resolved] Hide Topics and Replies from choicesSince 2.1, the option dropdown is no more hardcoded in the template but is generated dynamically.
I’m unable actually to tell you how to modify this new behave. (The old method is explained on the codex and in many topics here).
On Codex, if you have a serious php level (it’s not exactly my case), it’s explained how to add a new option. I guess there is a way to do the inverse, but i read a lot and tried many things, but didn’t find any working solution.
Meanwhile, i opened a topic on bbPress forum.
I tried this after asking @imath but it doesn’t work (i use bbp 2.6 alpha on my test site)
function remove_activity_filters( $bbp_buddypress = null ) { if ( bp_is_active( 'activity' ) && bp_is_activity_component() ) { // Remove forum filters in site wide activity streams remove_action( 'bp_activity_filter_options', array( bbpress()->extend->buddypress->activity, 'activity_filter_options' ), 10 ); } } add_action( 'bbp_buddypress_loaded', 'remove_activity_filters' );In case of one of you have an idea: @shanebp, @henrywright, @r-a-y, @djpaul ?
Merci beaucoup !In reply to: New Navigation APIFor the moment, it will continue to work (more or less)
Have you read this on 2.6 About page?
https://buddypress.trac.wordpress.org/changeset/10745…& as example, check comments in this file:
https://buddypress.trac.wordpress.org/browser/trunk/src/bp-core/bp-core-buddybar.php?rev=10745In reply to: BP2.6.0: localization regressIn reply to: BP2.6.0: localization regressДобрый день @valery-kondakoff,
no it’s not a regression ! Just a question of delay after BP’s update. Translations are made by volonteers, which are humans, not programmed machines. You have to wait that the translation is completed.
Or you can download the trunk version, which is already completed to 100%.
https://translate.wordpress.org/projects/wp-plugins/buddypress/dev/ru/defaultAt the page bottom you have a download button and a file type selector. Select po and mo format and rename both files to buddypress-ru_RU
In reply to: BuddyPress redirects to frontpage on registrationAny thoughts @djpaul, @imath ?
In reply to: BuddyPress and LighttpdSorry, i can’t help you for this, but i can advice you about this codex page containing some information about lighttpd. Don’t miss to read chapter 8. 😉
In reply to: Buddy press for multilingualIn reply to: Any way to import WordPress members yet?did you activated profile syncing in BP settings ? For the rest, same answer as here:
In reply to: BuddyPress redirects to frontpage on registrationHave you properly set up permalinks ? Choose any option, except “default”, save and give a try.
In reply to: Create custom pages on buddypressHi,
read documentation about xprofile, which is the place to go for what you want to do.
Many topics about this question are already on the forum. You can also read here to get an idea.
In reply to: Avatar URLSince WP 4.2, you can use
get_avatar_url. More on this discussion.Perhaps this may work too:
bp_loggedin_user_avatar( 'html=false' );In reply to: Lock comments buttonEventually show/hide comments ?
https://buddypress.org/support/search/add_comment_hide_show/
In reply to: Post Group Update Directly In Activity Stream Page> I want to set up an activity stream page which will be the only public interface to a group
Each group has is own activity stream.
> I want people to be able to post updates to that group from the activity stream
Each group member has access to the group update. (what’s new form)
That’s default behave for any group / group member !
I don’t really understand your question. Do you mean perhaps the site activity page ?
– How many groups do you have ?
– Can members access to only one group or have they the ability to subscribe to more ?In reply to: Move friend count bubble from tab to subtabHow do I do this?
You have to bake 5 894 pizza and search the forum ! Or experiment the following…
First you remove the counter. This can be done by using the language file.
Original string isFriends <span class="%s">%s</span>to replace by eg.Friendsor using this function (add to bp-custom.php)
function bpfr_remove_friends_count( $translated, $original_text, $domain ) { if ( 'buddypress' !== $domain ) return $translated; switch ( $original_text ) { case 'Friends <span class="%s">%s</span>': return 'Friends'; default: return $translated; } } add_filter( 'gettext', 'bpfr_remove_friends_count', 10, 3 );The Friends subnav has only two elements: friendships and request.
Friendships is the default one and can’t be removed. So we have to hide it with css. Add this to your child-theme style.css#friends-my-friends-personal-li {display:none;}This is default css, and you have to check it as it can vary depending your theme.
Finally add a new subnav item with counter in replaciement of the one you’ve just hiden (add to bp-custom.php).
function bpfr_custom_profile_sub_nav() { global $bp; if( bp_is_active( 'friends' ) ) $count = friends_get_total_friend_count(); $class = ( 0 === $count ) ? 'no-count' : 'count'; //Add subnav item bp_core_new_subnav_item( array( 'name' => sprintf( __( 'Friendships <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), bp_core_number_format( $count ) ), 'slug' => 'friends', 'parent_url' => $bp->loggedin_user->domain, 'parent_slug' => $bp->friends->slug, 'screen_function' => 'friends_screen_my_friends', 'position' => 10 ) ); } add_action( 'bp_setup_nav', 'bpfr_custom_profile_sub_nav' );In reply to: [Resolved] visual editor for writing messages?Sorry, my fault! I haven’t realised you mentioned /messages/compose.php
The snippet is intended to work on the what’s new form, not the compose message form.
To do this, we need the correct textarea name and another editor_id. Use this function:
function bpfr_compose_msg_tiny_editor() { $content = ""; if ( isset( $_GET['r'] ) ) : $content = esc_textarea( $_GET['r'] ); endif; $editor_settings = array( 'content' => bp_messages_content_value(), 'textarea_name' => 'content', 'editor_id' => 'message_content', 'teeny'=>true, 'media_buttons'=>false ); wp_editor( bp_messages_content_value(), "message_content", $editor_settings); } add_action( 'compose_edit_tools', 'bpfr_compose_msg_tiny_editor' );In compose.php, remove line 38
<textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea>and replace it by
<?php do_action( 'compose_edit_tools' ); ?>Visual and Text tab may be unecessary. You can hide them by adding this to your theme style.css:
#wp-message_content-editor-tools {display:none!important;}To get the edit tools on the reponse editor, same trick, replace the textarea line 123 in /messages/single.php with the above action hook.
In reply to: Default Profile VisibilityDid you cheched the field settings ?
In reply to: Error on Profile View fieldHey, it’s monday ! Site url ? Theme name ? Give details please.
See also the codex, as there is plenty of documentation about how BuddyPress can be setup and used.