Search Results for 'buddypress'
-
AuthorSearch Results
-
November 14, 2016 at 8:28 am #260984
In reply to: Remove Login & Register Links From Toolbar
danbp
ParticipantI don’t understandd this paranoรฏd question: So this is another case where they decided to leave out any option.
– Who are “They” ?
– What are the other case ?
– Which options are leaved out ?Really mysterious, unless the truth is elswhere ? May be in the Twilight Zone ?
You have the option to disable the Toolbar under Settings > BuddyPress > Options.
You have the possibility to use BP’s login widget under Apparence > WidgetsNovember 14, 2016 at 8:18 am #260982In reply to: How to make Buddypress support my Theme completely
danbp
ParticipantHi @vickievik,
the right question here would be how to make my theme compatible with buddypress.
The thing to understand is that BP use dynamic content for its page and that these page are NOT ordinaty WP pages.
For each content, BP fires a so called template-part.
Lets take as example a profile pageThe slug is /members/ which exist as “page” on wp’s page list. This wp page has no content and also no model or template. It’s just a “slug” in the wp ecosystem.
When you’re on a profile you have the page(aka /members/) but also many template parts, depending what you’re doing on that profile. Aside the common parts header – content – footer, you’ll find also personnal activity, frineds, groups, mentions, notifications, messages and not the worst, profile settings. All this on the same “page”.
Most theme mistakes are at this point. People try to design the page, instead to work the template parts.
When you design a theme, you usually design something for a page, independantly from any plugin. This structure is used by any Twenty Theme and you can follow them as model, because these themes are bullet proof and systematically used by all wp devs when building (in our case) BuddyPress
BP can be used with almost any existing theme, so far this theme is respecting WP’s coding standarts.
If you have brocken elements, and specially thoose using JS, it could be due to missing ID or class or even more simple, some missing instructions/conditionnals in your theme.
BP’s template parts are designed to fit with a majority of themes. The best to do, at least while creating your first theme, is to use BP “as is” and build your theme around thoose existing parts and not to remove/modifying BP arts to fit your creation.
November 13, 2016 at 9:54 pm #260972In reply to: How to make Buddypress support my Theme completely
Earl_D
ParticipantThis might be a good place to start if you looked at it already?
November 13, 2016 at 1:50 pm #260970In reply to: Display user country flag
davehakkens
ParticipantOK, we got it to work in a different way. Special thanks to @coffeywebdev for the help.
For those interested:This snippet is used in the functions.php to get the locations from the profile fields and show the flag image.
function dh_get_flag_by_location($country){ if($country <> '' && !empty($country)){ $country_filename = get_stylesheet_directory_uri() . '/img/flags/' . sanitize_file_name($country) . '.png'; $country_path = get_stylesheet_directory() . '/img/flags/' . sanitize_file_name($country). '.png'; if(file_exists($country_path)){ $html = '<img src="' . $country_filename . '"/>'; } else { $html = $country; echo '<!--' . get_stylesheet_directory_uri() . '/img/flags/' . sanitize_file_name($country) . '-->'; } echo $html; } }Then we needed to change 2 templates to show this flag image in
the Bbpress forum replies and on the buddypress members page. So we added the code necessary to show the flag
bbpress/loop-single-reply.php
<div id="country" style="float:left;margin-right:.5em;"> <?php $user = get_userdata( bbp_get_reply_author_id() ); $country = xprofile_get_field_data( 42, $user->ID ); dh_get_flag_by_location($country); ?></div>buddypress/members/members-loop.php
<div class="member-location"> <?php $country = bp_get_member_profile_data('field=Location'); dh_get_flag_by_location($country); ?></div>November 13, 2016 at 1:47 pm #260968In reply to: help with default activity stream tab
danbp
ParticipantYou’re talking about 2 different things: profile and groups. Let me explain you a little…
On the buddy nav bar, navigation looks similar but doesn’t work the same way on profile and on group page. While profile navigation use nav and sub-nav, the group navigation use only sub-nav.
Also, as documented on codex,
define('BP_DEFAULT_COMPONENT', '...' );is a constant related to a component, not a sub-nav tab. It let you define the default landing component, but not the one or other sub-nav tab. For example on profiles, the component Activity has 4 sub-nav attached to it: personnal, mentions, favorites, friends, groupsTo get one of them, you need to specify a new default tab, not another component. ๐
Buddybar main nav items on profile page
Activity Profile Friends Groups Forums (if you use group forums)Default tab is Activity/personnal. To change it for “Friends” you use the constant:
define('BP_DEFAULT_COMPONENT', 'friends' );To change the default landing tab from (Component/sub-tab). For example Activity/personnal to Activity/mentions, you define a new nav default tab with a function like this one:
function bpex_set_member_default_nav() { bp_core_new_nav_default ( array( 'parent_slug' => buddypress()->activity->id, // other "activity" sub_nav slugs : personal favorites friends groups 'subnav_slug' => 'mentions', 'screen_function' => 'bp_activity_screen_mentions' ) ); } add_action( 'bp_setup_nav', 'bpex_set_member_default_nav', 20 );For groups, it’s a similar technique, but a different syntax. The following example is a bit sophisticated, as it let you change the landing tab differently for each defined group.
Depending each group activity or target, you can choose a different default tab.
In this example, the kill bill group has Forum as landing tab, while Leon’s group use the group member directory.function bpex_custom_group_default_tab( $default_tab ){ /** * class_exists() is recommanded to avoid problems during updates * or when Groups Component is deactivated */ if ( class_exists( 'BP_Group_Extension' ) ) : $group = groups_get_current_group();//get the current group if( empty( $group ) ) { return $default_tab; } switch($group->slug){ case 'kill-bill': // group name (use slug format) $default_tab='forum'; break; case 'leon': $default_tab='members'; break; default: $default_tab='home';// the default landing tab break; } return $default_tab; endif; // end if ( class_exists( 'BP_Group_Extension' ) ) } add_filter('bp_groups_default_extension','bpex_custom_group_default_tab');All this tested and working with BP 2.7.2 / Twenty Sixteen
November 12, 2016 at 4:37 pm #260956In reply to: [Resolved] Has BP 2.7.2 eliminated cover images?
danbp
ParticipantHi,
no of course ! Read 2.7.2 changelog.
If you use a child theme or a third party theme, ensure it is updated for BP 2.7+: verify the templates.
November 12, 2016 at 12:49 pm #260953In reply to: help with default activity stream tab
danbp
ParticipantNovember 11, 2016 at 1:05 pm #260939shanebp
ModeratorTry the solution near the bottom of this codex page:
https://codex.buddypress.org/emails/#filter-from-address-and-nameadd_action( 'bp_email', function( $email_type, $email_obj ) { $email_obj->set_from( "custom@example.com", "Custom Website Name" ); }, 10, 2 );November 10, 2016 at 9:59 pm #260930In reply to: Hiding register link
Venutius
ModeratorI think you are looking for BP Registration options – that provides you with new member moderation.
https://wordpress.org/plugins/bp-registration-options/If you are new to BuddyPress I’m developing a site aimed at helping people get the most out of BuddyPress http://buddyuser.com
November 10, 2016 at 7:48 pm #260924In reply to: Profile header image size
modemlooper
ModeratorYou can find this information in the codex https://codex.buddypress.org/themes/buddypress-cover-images/
November 10, 2016 at 7:42 pm #260922In reply to: Buddypress Groups: Set HOME as default
modemlooper
Moderatordefine( 'BP_GROUPS_DEFAULT_EXTENSION', 'members' );change members to the slug of the extension and then that tab will load when you click a link to a group.
more configurations here https://codex.buddypress.org/getting-started/customizing/changing-internal-configuration-settings/
November 10, 2016 at 7:40 pm #260921In reply to: Change Position of BuddyPress Buttons
modemlooper
Moderatoruse this plugin https://wordpress.org/plugins/buddypress-custom-profile-menu/
November 10, 2016 at 7:37 pm #260919In reply to: Lost Buddypress Menu Item
modemlooper
ModeratorUnder Settings in the admin click BuddyPress. Then the tab Pages and re associate the page to the component.
November 10, 2016 at 6:14 pm #260914In reply to: Resctrict private messages
talvasconcelos
ParticipantHi, thread_id is from the buddypress. When a message is going for save bp checks if there’s a thread id, if not it’s because that is the first message.
Anyway, i got it to kind of work. Used some info from the other thread. I use the add_filter() to check if the user has a membership and if not, take out the button. Also i was forgeting to include the file with the Paid membership function. Here’s the code:
add_filter( 'bp_get_send_message_button', function( $array ) { if ( pmpro_hasMembershipLevel('Premium') ) { return $array; } else { return ''; } } );If you have any recommendations for this i’ll be glad to follow.
November 10, 2016 at 3:47 pm #260905Venutius
ModeratorThis has got to be plugin conflict or theme related issue since avatar and cover image uploads work when BuddyPress is running standalone. I’d try deactivating all other plugins and if that does not work then switching to the 2016 theme to check
November 10, 2016 at 6:14 am #260892Topic: help with default activity stream tab
in forum How-to & TroubleshootingMasoud
Participanthi.
i am using latest versions of both wordpress and buddypress.and working on a food website.
in this website , i wanted to allow only authors to post activity updates .
(because it will be much easier for users to track their favorite chef recipes in the activity page.)
so i’ve hide the ” personal ” submenu of activity tab : Activity > Personal (where people can post updates)
with the help of following code in bp-custom.php :function bpfr_hide_tabs() { global $bp; if ( bp_is_user() && ( !current_user_can(author) || !current_user_can(administrator) ) ) { bp_core_remove_subnav_item($bp->activity->slug, 'just-me'); } } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );but now when i go to my profile (as a subscriber)
i will see a 404 page.
i’ve searched a lot and i noticed that , now that i’ve removed the default activity stream tab , i have to point it to another tab. so when a user profile is loading (or if a user clicks on activity tab),
instead of default activity> personal . it load activity > mentions / OR / favorites / OR / … (some other submenu than personal )so my question is:
how can i change the default activity stream tab
from
Activity > Personal
To
Activity > Mentions – Or to – Activity > Favorites – …thanks a lot for any help.
November 10, 2016 at 12:45 am #260888In reply to: default page for logged in users
Venutius
ModeratorYou could try something like this, only it’s not been updated in a while, not tried it myself https://wordpress.org/plugins/buddypress-login-redirect/
November 9, 2016 at 9:46 pm #260884In reply to: Group header file problems
danbp
ParticipantNovember 9, 2016 at 12:18 am #260862In reply to: Deleted members are getting added to group
worsin
ParticipantOh and its important to note that none of the tools for buddypress work to fix this issue.
November 8, 2016 at 9:01 pm #260856In reply to: “Create Group” button not showing
claudiosinopoli
ParticipantDear danbp,
first of all tank you for killing the discussion with your silence.
Almost two months ago I asked you for help, without success.After a while I realized that I can perform a supposedly so simple task myself.
I’m writing now to inform other people that want the “create a group” button in the single member’s “groups” page or somewhere else in a buddypress template page.After reading some buddypress documentation I replicated in my child theme the buddypress templates and css folders structure.
Looking into the group-related php files I noticed that the function for the button “create a group” is called bp_groups_directory_group_filter.
The “groups” page for the single member is generate by the file located in the following folder in my child theme: my_child_theme/buddypress/members/single/groups.php
It is starting with the following code
<?php /** * BuddyPress - Users Groups * * @package BuddyPress * @subpackage bp-legacy */ ?> <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> <ul> <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?> <?php if ( !bp_is_current_action( 'invites' ) ) : ?> <li id="groups-order-select" class="last filter"> <label for="groups-order-by"><?php _e( 'Order by:', 'buddypress' ); ?></label> <select id="groups-order-by"> <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>It’s enough to add the line
<?php do_action( 'bp_groups_directory_group_filter' ); ?>
after line 12
<?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
and you do the trick.Now in the single member’s “groups” page there will be the following buttons:
Memberships | Invitations | Create a groupIn the same way you can add this button to any other template page, taking care that the function it’s placed in the right position in the code.
Thank you again danbp: your silence was not very professional but perhaps stimulating in order to take initiative, learn something and solve a problem by myself.
November 8, 2016 at 8:36 pm #260855In reply to: How to re-order Messages subnav items (tabs)
maccast
ParticipantJust so this is complete. Here’s the code updated for BuddyPress 2.6 or later.
function add_settings_subnav_tab() { //reorder messages tabs buddypress()->members->nav->edit_nav( array( 'position' => 10, ), 'compose', 'messages' ); buddypress()->members->nav->edit_nav( array( 'position' => 11, ), 'inbox', 'messages' ); buddypress()->members->nav->edit_nav( array( 'position' => 12, ), 'sentbox', 'messages' ); buddypress()->members->nav->edit_nav( array( 'position' => 20, ), 'starred', 'messages' ); } add_action( 'bp_setup_nav', 'add_settings_subnav_tab', 100 );November 8, 2016 at 8:43 am #260832In reply to: How to re-order Messages subnav items (tabs)
danbp
ParticipantNovember 8, 2016 at 7:34 am #260830In reply to: Emailing all users
Venutius
ModeratorYou have two options that I’m aware of – http://buddyuser.com/plugin-review-mass-messaging-in-buddypress and http://buddyuser.com/plugin-review-mass-messaging-for-buddypress-by-alkaweb
November 8, 2016 at 2:31 am #260824In reply to: How to Turn Off Email Notifications for All Users
Red Sand Media Group
ParticipantHey @danbp
I just thought I’d jump in here real quick, as I think this will be beneficial to everyone in the thread including @Tranny.
And even if you would be a genius coder creator of an extra super original spam shield, you could be sure to became target #1 of all spammers, because in this case, you would represent the absolute challenger of all code breakers !
We are that “genius coder creator of an extra super original spam shield” that you speak of. ๐
There is no miraculous plugin or trick to stop them.
Ahh, but there is.
It’s real, and it’s even called WP-SpamShield. LOL…you can’t make this stuff up. ๐
Check it out on WPorg. It’s been out for about two and a half years, and is forked from another plugin we developed almost a decade ago. It works perfectly and automatically on BuddyPress, bbPress, and pretty much everything else. You can also feel free to check out the plugin documentation here.
…And for the record, we definitely are a huge target of spammers. ๐
dealing with spammers is a long run work, to not say a never ending work.
True story!
– Scott
November 7, 2016 at 2:56 pm #260816MatrixMedia
Participantto exclude some categories I have tried this:
function exclude_category_slugs_from_activity_stream( $new_status, $old_status, $post ) { // Only record published posts if ( 'publish' !== $new_status ) { return; } // Don't record edits (publish -> publish) if ( 'publish' === $old_status ) { return; } // add in any categories to exclue from activity stream, separated by commas, no spaces $category_slugs_to_exclude = "news,new,News,service,Service"; // create the array that contains the category ids to exclude $ids_to_exclude = array(); // create new array by splitting category slugs by comma $category_slug_array = split( ",", $category_slugs_to_exclude ); // iterate over category_slug_array foreach ( $category_slug_array as $category ) { // get the category id based on the slug $idObj = get_category_by_slug( $category ); $id = $idObj->term_id; // push the category id onto the exclude array array_push ( $ids_to_exclude, $id ); } // get the post's categories $categories = get_the_category( $post->ID ); $in = false; // check if the post has any categories, do nothing if not if( count($categories) > 0 ) { // iterate over categories foreach ( $categories as $category ) { // check if any excluded category exists within post's categories if( in_array( $category->cat_ID, $ids_to_exclude) ) $in = true; } } // Don't record posts from filtered categories if( $in ) return; return bp_activity_post_type_publish( $post->ID, $post ); } add_action( 'bp_init', 'bp_blogs_catch_filtered_published_post' ); function bp_blogs_catch_filtered_published_post() { if ( bp_is_active( 'blogs' ) ) { remove_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10 ); add_action( 'transition_post_status', 'exclude_category_slugs_from_activity_stream', 10, 3 ); } }I found here: https://premium.wpmudev.org/forums/topic/exclude-auto-blog-posts-from-buddypress-activity-stream
of course I changed the deprecated functions:
bp_blogs_record_post -> bp_activity_post_type_publish
bp_blogs_catch_transition_post_status -> bp_activity_catch_transition_post_type_statusbut nothing … not working … HELP!!!
-
AuthorSearch Results