Search Results for 'add profile tab to nav bar'
-
Search Results
-
Under certain circumstances, there is an infinite loop inside the
bp_legacy_theme_new_activity_comment()
function. Specifically, when all of thesecondary_item_id
fields are zero, the$parent_id
will continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/
For information:
- WordPress
4.5.3
- BuddyPress
2.6.1.1
- Single site install in web root
- There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
- We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
- The core BuddyPress files have not been modified to my knowledge.
- The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
- The live site is http://www.lifeofdad.com/
I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned
bp_legacy_theme_new_activity_comment()
function.My specific concern is this loop:
// Load the new activity item into the $activities_template global. bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id ); // Swap the current comment with the activity item we just loaded. if ( isset( $activities_template->activities[0] ) ) { $activities_template->activity = new stdClass(); $activities_template->activity->id = $activities_template->activities[0]->item_id; $activities_template->activity->current_comment = $activities_template->activities[0]; // Because the whole tree has not been loaded, we manually // determine depth. $depth = 1; $parent_id = (int) $activities_template->activities[0]->secondary_item_id; while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) { $depth++; $p_obj = new BP_Activity_Activity( $parent_id ); $parent_id = (int) $p_obj->secondary_item_id; } $activities_template->activity->current_comment->depth = $depth; }
I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.
I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.
I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.
+--------------------------------------+--------+-----------+---------+ | name | status | update | version | +--------------------------------------+--------+-----------+---------+ | akismet | active | none | 3.1.11 | | all-in-one-seo-pack | active | available | 2.3.7 | | appbuddy | active | available | 2.0.7 | | appcamera | active | available | 2.0.0 | | appfbconnect | active | none | 2.3.0 | | apppresser | active | none | 2.5.0 | | apppush | active | available | 2.1.0 | | appshare | active | none | 2.1.0 | | appswiper | active | available | 2.2.1 | | bp-profile-search | active | none | 4.5.2 | | buddypress | active | none | 2.6.1.1 | | buddypress-activity-plus | active | none | 1.6.4 | | bp-moderation | active | none | 0.1.7 | | buddypress-nocaptcha-register-box | active | none | 1.1.3 | | buddypress-toolbar | active | none | 1.6.0 | | buddypress-wall | active | none | 0.9.4 | | buddypress-xprofile-image-field | active | none | 2.0.1 | | category-posts | active | none | 4.6.1 | | contact-form-7 | active | none | 4.4.2 | | contact-form-7-to-database-extension | active | none | 2.10.20 | | cubell-themes-functionality | active | none | 3.1 | | envato-wordpress-toolkit | active | none | 1.7.3 | | hashbuddy | active | none | 1.5.2 | | login-with-ajax | active | none | 3.1.6 | | mailchimp-for-wp | active | none | 3.1.11 | | nav-menu-roles | active | none | 1.8.2 | | nextend-facebook-connect | active | none | 1.5.9 | | buddypress-media | active | none | 4.0.4 | | vine-embed | active | none | 0.2 | | wds-lod-automatic-friends | active | none | 0.1.0 | | wds-lod-base | active | none | 0.1.0 | | wds-lod-bp | active | none | 0.1.0 | | wds-lod-post-types | active | none | 0.1.0 | | wds-lod-widgets | active | none | 0.1.0 | | wordpress-importer | active | none | 0.6.1 | +--------------------------------------+--------+-----------+---------+
Topic: Profile menu new tab/link
Hi all,
I’m attempting to have nav tabs in the standard buddybar that displays the feed/loop for Favorites and Mentions, as seen in the pic on this page:
1. I’ve managed to duplicate the activity loop on a tab with the code below, but the CSS is wrong. I’ve fiddled with the code a little as it was originally setup for blog posts and i think this is the reason the CSS i’ve written for activity loop isn’t being called. Is the hook my_profile_post() where the issue lies?
2. I’m fine with setting up the navs and subnavs as desired, but I’m still being unsuccessful in loading a user favorites and user mentions feed/loop (want to duplicate what is shown on the subnav tabs under the default activity tab). Looked through the Buddypress code files and found and tried various things but none have worked. Any help/directions?
(Code below thanks to Dan and Henry here: https://buddypress.org/support/topic/calling-a-post-authors-activity-stream/)
function bpfr_post_profile_setup_nav() { global $bp; $parent_slug = 'test'; $child_slug = 'posts_sub'; //Add nav item bp_core_new_nav_item( array( 'name' => __( 'TEST' ), 'slug' => $parent_slug, 'screen_function' => 'bpfr_profile_post_screen', 'position' => 100, 'default_subnav_slug' => $child_slug ) ); //Add subnav item bp_core_new_subnav_item( array( 'name' => __( 'SUBTEST' ), 'slug' => $child_slug, 'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/', 'parent_slug' => $parent_slug, 'screen_function' => 'bpfr_profile_post_screen' ) ); } function bpfr_profile_post_screen() { add_action( 'bp_template_content', 'bpfr_profile_post_screen_content' ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); } function bpfr_profile_post_screen_content() { do_action( my_profile_post); } add_action( 'bp_setup_nav', 'bpfr_post_profile_setup_nav' ); function bpfr_get_stuff() { $activity_id = bp_activity_get_activity_id( array( 'user_id' => bp_loggedin_user_id(), //'component' => $bp->activity->id, //'item_id' => get_current_activity_id(), //'type' => 'activity_comment', //'secondary_item_id' => $post->ID, //'type' => $activity_post_object->action_id, ) ); if ( ! $activity_id ) { return ''; } // this is the activity loop, with some options. if ( bp_has_activities( $activity_id . '&action=activity_update&max=5' ) ) : while ( bp_activities() ) : bp_the_activity(); bp_get_template_part( 'activity/entry'); endwhile; endif; } add_action ( 'my_profile_post', 'bpfr_get_stuff' );
bp 2.2.3.1
wp 4.1.2
Website is being created locally, not online.How can I make ONLY one tab Visible (the groups tab, so others can still see publicly the groups that user is a part of) to users who are not logged in on a user profile? And when a user logs in then the whole navigation bar (#object-nav)becomes visible again for all user profiles?
I see no plugins for this , so maybe there is some code I could add to my functions?
Thank you for any help
Topic: Profile as default subtab
Hi folks!
I’m new to Buddypress, so my apologies for any noob-ish-ness on my part. Trying to troubleshoot a problem and seeking some guidance on what’s going wrong.
I’m looking to make the Profile tab the default when opening up a member’s page, rather than their activity feed. I’d also like to make the Profile tab come before the Activity tab in the submenu list, but that’s as not crucial.
Based on some other threads I found here, I’ve created a “bp-custom.php” file, stuck that in the root of the Buddypress plugin folder. Right now bp-custom.php looks like this:
`
bp_nav[‘profile’][‘position’] = 10;
$bp->bp_nav[‘forum’][‘position’] = 30;
$bp->bp_nav[‘posts’][‘position’] = 40;
$bp->bp_nav[‘activity’][‘position’] = 20;
$bp->bp_nav[‘blogs’][‘position’] = 60;
$bp->bp_nav[‘friends’][‘position’] = 70;
$bp->bp_nav[‘messages’][‘position’] = 80;
$bp->bp_nav[‘groups’][‘position’] = 50;
$bp->bp_nav[‘settings’][‘position’] = 90;
}add_action( ‘bp_init’, ‘tricks_change_bp_tag_position’, 999 );
add_action( ‘wp_head’, ‘tricks_change_bp_tag_position’, 9 );
?>
`However that hasn’t accomplished either of the things I’m attempting to do. The Activity tab still appears when you go to a member’s page, and is listed before Profile in the submenu.
I’m using Buddypress 1.6.4, and the default Buddypress theme (1.6.4), on WordPress 3.5.1.
I have the following plugins installed and active:
- BP Labs 1.3
- BP User Profile Map 1.4.1
- Breadcrumbs Everywhere 1.4
- Contact Form 7 3.3.3
- Really Simple Captcha 1.5
- WP Custom Admin Bar 1.3.5
If there’s a step I’ve missed, I’d really appreciate letting me know! Any help troubleshooting what the problems is would also be appreciated.
Thanks!
I have read all of the topics similar to this question here, on wordpress.org and even on Google. I’ve tried dozens upon dozens of suggestions, but am still stuck.
My installation is WordPress v3.4.2 with Multisite using subfolders, BuddyPress v1.6.1, bbPress v2.1.3 using Groups and Sitewide forums.
The problem I have is that BuddyPress Group Forums will not display. The mydomain.com/forums/ page is blank. I’ve seen some people have included the bbPress shortcode in the Forums page and have said that fixed their problem. In my configuration, I have a Sitewide Forums button on my top navigation bar and it shows the sitewide bbPress forums correctly. I can go into wp-admin -> Forums and I can see all of the bbPress sitewide forums. I can add them, delete them and even post topics to them. Adding the bbPress shortcode to my Forums page just duplicates the forums I already have on my Sitewide Forums page.
From what I can tell, the rest of BuddyPress is working – the Activity, Members, and Groups buttons display correct pages. It seems like only the Group Forums are not working.
I’ve gone into wp-admin -> Settings -> Forums of my main site and changed the bbPress Forums Base to sitewide-forums. Also on this settings page I have BuddyPress Enable Group Forums enabled and Group Forums Parent set to (Forum Root).
In Network Admin -> Settings -> BuddyPress, I think I see a problem. Initially I had all Components enabled. On the Pages tab I don’t have any settings for the Forums page and so I can’t change it. Activity Streams, Site Tracking, User Groups, Members, Register and Activate. It just seems odd that I don’t have a setting for the Forums page. I’ve disabled and re-enabled Discussion Forums component, but still no setting for Forums page on the Page tab.
Logged in as admin on my main site (mydomain.com/) I can click on my username and it brings up mydomain.com/members/admin just fine. I see tabs for Activity, Profile, Sites, Messages, Friends, Groups, Forums and Settings. All of these tabs work and I can view/change data. There is no option on the Settings tab to enable/disable Group forums as I’ve seen some articles refer to. When I click on the Forums tab I am surprised to see that there are articles in Forum Topics that I created from within wp-admin -> Forums -> Add New.
Now I am confused… It seems that what I thought were Sitewide Forums are also being displayed in what I thought were the Group Forums and I’m starting to think I have not just one problem, but at least two!
What I am wondering:
1) There is a problem with BuddyPress that is forcing me to disable the Discussion Forums component in Network Admin -> Settings -> BuddyPress.
2) The theme I am using (Frisco for BuddyPress) is not compatible with a multisite configuration.
Unfortunately, I have only limited experience with either of these two things – multisite and BuddyPress et al. So I don’t really know how it’s SUPPOSE to function.
Questions:
Is anyone aware of a theme that is compatible with a Networked multisite (subfolder) configuration and also compatible with Group Forums AND Sitewide Forums? Or would you think Frisco for BuddyPress should be compatible?
Is anyone aware of a way of testing that I have both Group Forums and Sitewide Forums enabled and working without using the Frisco theme?
Exactly where do I add a Group Forum? Apparently wp-admin only allows me to add Sitewide Forums/Topics.
Any thoughts? Anyone have any bookmarks on articles specific to multisite install using both Group and Sitewide forums?
Thank you!
- WordPress