Search Results for 'buddypress'
-
AuthorSearch Results
-
July 11, 2016 at 2:40 pm #256477
allancaeg
ParticipantOn the profile page, the count of messages, notifications, etc are displayed:
https://mercime.files.wordpress.com/2015/03/bpmenu-frontlinks.jpgSame goes for the BuddyPress header:
BuddyPress has this menu feature:
How do I add the notification count beside the menu item on the header navigation?
July 11, 2016 at 10:24 am #256461Topic: Change ‘Show all X comments’ limit
in forum How-to & TroubleshootingJuly 11, 2016 at 3:43 am #256456In reply to: Members display name
webexpression
ParticipantAhh yes I see. I’m not entirely sure. Apparently what I am in need of changing is code from BuddyPress.
Does anyone know another way to get a problem fixed if you don’t get a response on here? I really need help.. oh and on my website also 😉
July 10, 2016 at 11:10 pm #256453In reply to: How to hide profile menu items from other users
danbp
ParticipantNo, not for the moment. We’re handling here about profile and group nav, not about Group or Member Directory nav.
If you have a snippet who works for the Directory, feel free to add it to the Nav Api examples. Codex Contributors are always welcome.
July 10, 2016 at 10:27 pm #256451In reply to: How to hide profile menu items from other users
danbp
Participant@socialc, since 2.6 and the new Nav API, there is a much simplier possibility as the translation file to change nav item names.
@marcono, try this; not sure you learned, below snippet is on Nav API examples i indicated previously. 😉function bpcodex_rename_group_tabs() { if ( ! bp_is_group() ) { return; } buddypress()->groups->nav->edit_nav( array( 'name' => __( 'Group Discussion', 'buddypress' ) ), 'forum', bp_current_item() ); } add_action( 'bp_actions', 'bpcodex_rename_group_tabs' ); function bpcodex_rename_profile_tabs() { buddypress()->members->nav->edit_nav( array( 'name' => __( 'My Buddy Forums', 'textdomain' ) ), 'forums' ); buddypress()->members->nav->edit_nav( array( 'name' => __( 'My Buddy Groups', 'textdomain' ) ), 'groups' ); } add_action( 'bp_actions', 'bpcodex_rename_profile_tabs' );July 10, 2016 at 8:59 pm #256450In reply to: How to hide profile menu items from other users
socialc
ParticipantJuly 10, 2016 at 7:46 pm #256446danbp
ParticipantMake sure you have pretty permalinks enabled on your WordPress install. (whatever except default) and save.
And check your install again.
Ray’s script is not a bug tracker, it gives only information about global variables which is usefull when you want to debug a custom script. If you seek for bugs – rarely the case on a new install -, activate wp_debug in wp-config.phphttps://codex.wordpress.org/Debugging_in_WordPress
July 10, 2016 at 6:38 pm #256443tutorbe
ParticipantDear All,
I hope someone can point me a clue regarding the following:
I have just installed WP 4.5.3 along with only Buddypress 2.6.1.1 activated, when I tried to access members/admin/profile/, it just returned 404 page. I have tried with different themes, the same issue still existing.
I tried to investigated the problem using the debug script from r-a-y, it just showed:
Array ( [component] => profile )Thanks and best regards,
Jobi
July 10, 2016 at 3:27 pm #256432In reply to: Custom post type
jaaahaaa
ParticipantSolved!!
What I was testing was tracking comments. I realized that it worked by using the tutorial for tracking when new objects are created.
However, comments did not work so I ended up editing the creation of the custom post type. Posting the full code here if anyone else googles ignitiondeck buddypress integration:
ignitiondeck-admin.php line 5 to 46:
add_action( 'init', 'ign_create_post_type' ); function ign_create_post_type() { require 'languages/text_variables.php'; $slug = apply_filters('idcf_archive_slug', __('projects', 'ignitiondeck')); register_post_type( 'ignition_product', array( 'labels' => array( 'name' => $tr_Projects, 'singular_name' => $tr_Project, 'add_new' => $tr_Add_New_Project, 'add_new_item' => $tr_Add_New_Project, 'edit' => $tr_Edit, 'edit_item' => $tr_Edit_Project, 'new_item' => $tr_New_Project, 'view' => $tr_View_Project, 'view_item' => $tr_View_Project, 'search_items' =>$tr_Search_Project, 'not_found' => $tr_No_Products_found , 'not_found_in_trash' => $tr_No_Product_in_Trash, 'all_items' => __( 'All Videos' ), ), 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => apply_filters('idcf_hierarchical', false), 'menu_position' => 5, 'capability_type' => 'post', 'menu_icon' => plugins_url( '/images/ignitiondeck-menu.png', __FILE__ ), 'query_var' => true, 'rewrite' => apply_filters('id_register_project_post_rewrite', array('slug' => $slug, 'with_front' => true)), 'has_archive' => apply_filters('id_register_project_post_has_archive', $slug), 'supports' => array( 'title', 'author', 'editor', 'thumbnail', 'revisions', 'comments', 'buddypress-activity' ), 'taxonomies' => array('category', 'post_tag', 'project_category'), 'bp_activity' => array( 'action_id' => 'new_ignition_product', 'comment_action_id' => 'new_ignition_product_comment', ) ) ); }July 10, 2016 at 3:19 pm #256431In reply to: Login redirects not working
socialc
Participant… or just add a login link to your site anywhere in your theme files. e.g
<a href="<?php echo wp_login_url(bp_loggedin_user_domain()); ?>"><?php _e('Login', 'buddypress'); ?></a>.This will redirect a user to their profile page after logging in.
July 10, 2016 at 2:55 pm #256428In reply to: [Resolved] BP 2.6 and BuddyPress Group Extras Plugin
danbp
ParticipantMaybe Slava is busy ! Try to contact him on BuddyPress Slack or Twitter (@slaFFik).
July 10, 2016 at 2:49 pm #256425In reply to: Errors after update
danbp
Participant[MOD] Topic moved to a more appropriate forum.
The following plugins/widget are generating these error messages.
bp-edit-group-slug
BP_Toplevel_Groups_Widget
BP_Group_Navigator_Widget
bp-group-email
bp-group-hierarchy
You have to contact their authors via plugin support on WP repo.
and on your side:
The first step to getting rid of those Notices is identifying the source, so:
– switch momentarily to a WP theme like 2016 and see if any persist
– turn off plugins one at a time and see if any persistAbout the bbPress notice (bbp_setup_current_user was called incorrectly), read here:
https://buddypress.trac.wordpress.org/changeset/10709/July 10, 2016 at 2:26 pm #256419In reply to: How to hide profile menu items from other users
danbp
ParticipantIt’s the same principle, but not the same syntax since 2.6
To hide tabs on groups, you need to specify the component. Note that all menu items (nav and subnav items) are considered as sub-nav, they have not the same distinction as on member or activity menus.
Use another function for groups. Try this.
function bpex_remove_group_tabs() { if ( ! bp_is_group() ) { return; } $slug = bp_get_current_group_slug(); // hide items to all users except site admin if ( !is_super_admin() ) { // bp_core_remove_subnav_item( $slug, 'members' ); bp_core_remove_subnav_item( $slug, 'send-invites' ); // bp_core_remove_subnav_item( $slug, 'admin' ); // bp_core_remove_subnav_item( $slug, 'forum' ); } } add_action( 'bp_actions', 'bpex_remove_group_tabs' );To get more usage examples, see here:
July 10, 2016 at 1:35 pm #256417In reply to: Working Login redirect to profile snippet ?
danbp
ParticipantWhen you copy/paste code you do not really control, try at least the original one first before adding wrong things to it.
For the redirect link, use this syntax:
return bp_core_get_user_domain( $user->ID ) .'/mypics';And please don’t double post. It’s annoying.
July 10, 2016 at 1:04 pm #256416In reply to: [Resolved] Hidden admin panel
danbp
ParticipantDo you mean also that members can’t access to their profile settings when they are on their profile page ?
The BP usermenu on the Toolbar, under Howdy (top right) mimics the usermenu of the BuddyBar which is on each profile.
Have you enabled Extended Profiles ?
Or use this snippet to login redirect your users to their profile.
ps: i removed your site url as it is locked to public – which doesn’t help no one to help you.
July 10, 2016 at 12:51 pm #256415In reply to: Login redirects not working
danbp
Participanthi @earl_d,
add this snippet to bp-custom.php and give it a try.
function bpex_redirect_to_profile( $redirect_to_calculated, $redirect_url_specified, $user ){ if( empty( $redirect_to_calculated ) ) $redirect_to_calculated = admin_url(); // redirect logged in to his/her profile - except site admins if( isset( $user->ID) && ! is_super_admin( $user->ID ) ) return bp_core_get_user_domain( $user->ID ); else return $redirect_to_calculated; /* nada !*/ } add_filter( 'bp_login_redirect', 'bpex_redirect_to_profile', 11, 3 );For the redirect URL error you mentionned here, use:
return bp_core_get_user_domain( $user->ID ) .'/mypics';mypics is a slug, not a constant
( $user->ID ) .mypicsJuly 10, 2016 at 12:09 pm #256411In reply to: How to hide profile menu items from other users
danbp
ParticipantAdd this snippet to bp-custom.php and give it a try.
function bpex_hide_profile_menu_tabs() { if( bp_is_active( 'xprofile' ) ) : if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) { // BP's profile main menu items. Comment those to show. // bp_core_remove_nav_item( 'activity' ); bp_core_remove_nav_item( 'profile' ); bp_core_remove_nav_item( 'friends' ); bp_core_remove_nav_item( 'groups' ); // exist only if you use bbPress bp_core_remove_nav_item( 'forums' ); // BP's profile main menu items. Comment those to show. // bp_core_remove_subnav_item( 'activity', 'personnal' ); bp_core_remove_subnav_item( 'activity', 'mentions' ); bp_core_remove_subnav_item( 'activity', 'favorites' ); bp_core_remove_subnav_item( 'activity', 'friends' ); bp_core_remove_subnav_item( 'activity', 'groups' ); } endif; } add_action( 'bp_setup_nav', 'bpex_hide_profile_menu_tabs', 15 );July 10, 2016 at 6:37 am #2564065high
Participantuh oh – just logged a php error for the new code. The error reported was this:
PHP Parse error: syntax error, unexpected ‘endif’ (T_ENDIF) in /home/mysite/public_html/wp-content/themes/child-theme/buddypress/activity/index.php on line 34
But when I look at this file I’m pretty sure it’s the same as what you posted =
<?php if ( is_user_logged_in() && is_super_admin() ) ?> <?php bp_get_template_part( 'activity/post-form' ); ?> <?php endif; ?>and line 34 is:
<?php endif; ?>which I’m pretty sure I didn’t change!Can anyone spot what the problem is here?
Many thanks, j
July 9, 2016 at 9:57 pm #256397In reply to: Members display name
webexpression
ParticipantIt seems that the comments and friendship function abilities are core things of buddypress not external plugins.
Can anyone help with this?
July 9, 2016 at 1:50 pm #256170In reply to: How do I change the activity-greeting copy?
danbp
ParticipantBP files are very well commented actually. But reading through hundreds of files is not easy. Here a good ressource to find a function, hook by keywords. Still interesting even if related to BP 2.4.3
Test and search for get_ to have an idea !July 9, 2016 at 1:42 pm #256169In reply to: How do I add metadata to a BuddyPress post?
danbp
ParticipantGuess you have to code it completely.
A great and very complete tutorial is Creating Maintainable WordPress Meta Boxes
And here an overview of almost all BP hooks and filters related to meta.
July 9, 2016 at 1:39 pm #256168In reply to: How do I change the activity-greeting copy?
socialc
Participant@danbp yeah, sorry about that :). Reason I went a bit further was when working on a theme earlier I was using a function
get_displayed_group_id()or something with a similar name. I was expecting a return value but it was echoing no matter where I placed this.Ended up using a different method.
Just wondered if there were other functions inside BuddyPress that looked like a return value but had output instead.
July 9, 2016 at 1:12 pm #256167In reply to: How do I change the activity-greeting copy?
danbp
ParticipantMaybe it’s me who’s wrong. I haven’t tested, but it’s how i used such a function in the past, called inside another one. I also wrote “something like”, which is very different of “use this”. It’s an example, not the absolute solution! 😉
Let’s wait for Allan’s reaction before continuing this discussion. For the moment, the only important thing related to this post is:
$goal = xprofile_get_field_data( 'Your goal', $user_id );July 9, 2016 at 1:00 pm #256166In reply to: Custom post type
danbp
ParticipantHave you read this tutorial ?
Note that most of BP custom functions for core are better handled when living in bp-custom.php. Sometimes also, a same function may work from within one file, but not from the other. In other case, which file has no real importance.
Even if in background there is a hierarchy and a load order, to take in account for the file choice.That said, as it is related to CPT, bp-custom is the best place IMO.
Theme’s functions.php contains functions related to theme, templating and evtl. wp stuff
BP custom functions goes to bp-custom.phpIt’s also better for you to have such separated functions.
July 9, 2016 at 9:15 am #256158In reply to: How do I change the activity-greeting copy?
socialc
ParticipantInside your theme, make sure there is a file
wp-content/themes/your-theme/buddypress/activity/post-form.php. If there is no file in that location copy this filewp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.phpinto the first location.Then, look at line number 28 – 32 of post-form.php.
From there, you will notice you can change this text for the activity update form which reads “What’s new in “GROUP NAME” if you’re on a group page posting the update or “What’s new USERNAME” if you’re any where else.
So, to swap in a specific profile field you’d need to supply a bit more about the nature of your project and how it’s setup. You could simply drop in some static text, but if you want it to relate to a specific profile field in a dynamic way then please elaborate further.
-
AuthorSearch Results
I’m currently trying to bring the number of comments shown below a post from 5 to 2. I’ve updated the following lines in ‘global.js’, but the feed still outputs 5 comments below each activity item.
(global.js line 1490)
if ( jq(this).children('ul').children('li').length < 5 ) return;to
if ( jq(this).children('ul').children('li').length < 2 ) return;(global.js line 1502)
if ( i < comment_lis.length - 5 ) {to
if ( i < comment_lis.length - 2 ) {I’m running a vanilla install of BuddyPress 2.6.1.1 on WP 4.5.3, so I’m assuming my logic is incorrect in how I’m trying to bring the comment count down. Any help would be massively appreciated as I’ve hit a bit of a brick wall.
Cheers, Graeme