Forum Replies Created
-
In reply to: Will activating buddypress wipe out my WP theme
There are a couple ways to make themes for BuddyPress.
One way is to make a child theme for bp-default. Instructions can be found here: https://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/ This is a good option because it’s relatively simple, but it will restrict you to some extent to the general structure of the bp-default theme.
Another way is to integrate BP features into your own Svelt theme. The BuddyPress Template Pack will help you do that. https://wordpress.org/extend/plugins/bp-template-pack/ Basically, it provides the extra templates necessary (on top of your existing WP templates) to run BuddyPress functionality. Follow the Template Pack instructions carefully on a test installation, and see what you think. Once you’ve gone through the Template Pack setup, you can start customizing the way that BP integrates with your theme to your liking – but BPTP will give you a nice headstart.
I’m not positive, but I don’t think that turning off Blog Tracking will affect the Group Wiki. The Group Wiki requires a blog, but blog *tracking* is something different altogether – it records activity items (like “Scott posted a new blog entry…”) and creates blog directories. Blogs themselves are independent.
In reply to: Blogger style bar on all blogsWhat do you mean by a “Blogger style bar”? Do you mean one with position: absolute instead of position: fixed?
In reply to: Make users able to use brackets in their postsWhat do you mean by brackets?
1 ( these )
2 { these }
3 [ these ]
or something else?What’s happening when users try to use them? And in what context are they using them, activity updates or forum posts or profile fields or what?
And what version of BP/WP are you running? https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/when-asking-for-support/
In reply to: I enabled Mu (network) and the forums disappeared..Glad it’s working!
In reply to: I enabled Mu (network) and the forums disappeared..Do you have the groups component enabled as well?
Also, check out Dashboard > BuddyPress > Forum Setup. Does it tell you that forums are properly installed? If not, go through the install procedure (it takes two clicks). If not, try setting up an existing installation, and make sure that BP points to the correct path of your bb-config.php file.
In reply to: I enabled Mu (network) and the forums disappeared..What do you mean they “disappeared”? Are you getting 404s when you click on the Forums tab? Do individual group forums work?
Also, any info you could provide along these lines would be helpful: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/when-asking-for-support/
Most plugins do not remove data automatically on deactivation. That’d be a bad thing, since you might occasionally need to deactivate for upgrade/testing purposes, and you wouldn’t want to lose your data.
Some plugins provide a manual data deletion/uninstall function. If the plugin creates a Dashboard panel, check the panel for an Uninstall or Remove Data button.
BuddyPress does not have such a button. If you uninstall BP and want to get rid of the database clutter, just delete all the tables that start with wp_bp_. BP only keeps a few pieces of metadata in the sitewide and blog-specific tables, not really enough to worry yourself about.
I had to do this recently. Here’s a few hints.
– First, you have to create an interface for changing the usermeta in question. Here’s a simple example, where I added a dropdown to the WP Dashboard Edit User page. the dropdown contains the options “Teacher” and “Student”, and when the profile is saved, the account type is stored in the wp_usermeta table, keyed as ‘acct_type’. (You’ll notice that I’ve only made it available to blog admins – you can change that if you want) http://pastebin.com/n3whEtjd You could just as easily store this information as a piece of BP xprofile data, which has the advantage that you don’t need to worry about the functions for creating the dropdown UI or storing the data on the page. In that case, just add a profile field at Dashboard > BuddyPress > Profile Field Setup
– Then you’ll need a utility function that you can use in your theme templates to check which account type you’re dealing with, and then to display different stuff depending on the account type. Here’s an example from the same project, where I’m checking whether the *logged in* user is a teacher. http://pastebin.com/MqMksYTD If you’re dealing with xprofile data rather than usermeta, you’ll have to use the xprofile tags instead (see especially xprofile_get_field_data() in bp-xprofile/bp-xprofile-templatetags.php). And if you want to check whether the *displayed* user meets a certain criterion (as opposed to the *logged in* user, just call the $bp global (instead of $current_user) and set $user_id = $bp->displayed_user->id (see https://codex.buddypress.org/developer-docs/the-bp-global/ for more details on $bp).At that point, you can differentiate between the content shown to/about one account type by using conditionals, eg
if ( bbg_is_teacher ) { /*blah blah blah*/ } else { /*blah blah blah*/ }. This can happen mostly at the template level.Good luck!
In reply to: Functions.php broken but bp-Custom.php worksThere could be a load-order issue. IIRC functions.php gets loaded well after bp-custom.php, so if you have functions that hook to actions early in the WP/BP loading process, they might not fire when placed into functions.php.
In reply to: author privilege issuesDoes this still happen when you have BuddyPress turned off? I’d be surprised if this problem were caused by BP.
In reply to: codex.buddpress.org search is returning a blank page@caplain – You’re right, the codex search isn’t working for me either. I’ve added this to the buddypress.org bug list, and will have a closer look when the bp.org Ninjas project https://buddypress.org/community/groups/buddypress-org-ninjas/ kicks into high gear.
In reply to: API Documentation?techguy is right – there isn’t really robust documentation at the moment. (Though you are welcome to participate in expanding the documentation at codex.buddypress.org as you figure things out!)
Just off the top of my head, you might look in the following places:
– for determining the admins of a group, look at bp-themes/bp-default/groups/single/group-header.php, where this is done in the context of group headers. The function to look for is bp_group_list_mods(), which is defined in buddypress/bp-groups/bp-groups-templatetags.php.
– Members of a group can be figured out with a group members loop. The codex page on this subject is quite good: https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-group-members-loop-bp_group_has_members/. See also the same group templatetags file, where bp_group_has_members() is defined.
– A list of all groups can be had with bp_has_groups. See the codex https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-groups-loop/ and, again, bp-groups-templatetags.php (see a pattern emerging here?)How much do you know about jQuery and AJAX? You’d have to extend the bp-default javascript so that, on the AJAX response, it also updates the contents of div#latest-update. Not too difficult, but it would take a bit of time custom coding the necessary JS, as well as the PHP callback that would produce the necessary HTML.
In reply to: Displaying user profile@xrun You got it all right, except that bp-custom.php should go into your plugins folder (probably wp-content/plugins).
In reply to: profile fields by idCool, good luck!
In reply to: Displaying user profileYou’re right that avatars on subdirectory blogs are acting a bit funky. It might be a BP bug, I have to look into it a little more. In the meantime, the following strategy might be a workaround for you. In your bp-custom.php, put a function like the following:
function bbg_avatar_paths( ) {
$root_url = get_blog_option( BP_ROOT_BLOG, 'home' );
define( BP_AVATAR_UPLOAD_PATH, ABSPATH . '/wp-content/uploads' );
define( BP_AVATAR_URL, $root_url . '/wp-content/uploads/' );
}
add_action( 'bp_loaded', 'bbg_avatar_paths', 7 );In reply to: profile fields by idThat will work. The only problem is that it’s not entirely future-proof. If the structure of the $field object changes in future versions of BP, you’ll have to rewrite the code.
If I were you, I would use a profile loop, as described at https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-profile-data-loop-bp_has_profile/. That way you can use the built-in template tags, which won’t break when BP is upgraded.
The xprofile template tags aren’t as fleshed out as I wish they were, but they should work nicely for your purpose. Put the three fields that you want to appear in column 1 in a profile field group, the next three fields in another group, etc. Then it’ll be easy to create the markup using bp_profile_groups() loop.
In reply to: Delete Account ends up with 404Is there anything in your error logs that might be helpful?
In reply to: profile fields by idI understand your question, and you’re right, there is no such function. But from inside of a profile loop, you can use bp_the_profile_field_name(), and it will get the $field_id implicitly from the loop iteration.
If you don’t want to build a loop, you can get the field name from the $field_id like this:
$field = new BP_XProfile_Field( $field_id );
$field_name = $field->name;
In reply to: Where are the forums located?Depending on whether you’ve turned on the components at Dashboard > BuddyPress > Component Setup, BP provides extended user profiles, an interactive activity stream, private messaging, user-creatable groups (with integrated activity streams, forums, and other functionality available via plugins), blog tracking, friend connections, and member/group directories. The toolbar at the top of the screen is one of the methods built into the UI for accessing these features. If you’re using a BP-compatible theme like the bundled bp-default, then you should also see tabs for Members, Groups, Forums etc near the top of your screen.
testbp.org is one place to see BP being used (for test purposes, obviously, but you can get a sense of the organization).
How are you trying to delete the user? From the WP Dashboard? Does the problem persist when BuddyPress is turned off?
In reply to: Delete Account ends up with 404If you’re experiencing problems deleting users via the WP user management panel, then it’s probably not strictly speaking a BuddyPress problem. You might try deactivating BP (deactivate BP-dependent plugins first!) for a moment, to see if you’re able to delete members with BP turned off. If not, then your problem is WordPress related.
In reply to: Displaying user profileThe strategy is this: Create a bp_has_members() loop, passing the user id along in the
includeparameter (see https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-members-loop/ for more details about the members loop). Then, inside of that loop, use the member header at buddypress/bp-themes/bp-default/members/single/member-header.php as a template for creating the friend link, message buttons, etc.In reply to: profile fields by idYes, you can do this with the xprofile template functions, which are located at buddypress/bp-xprofile/bp-xprofile-templatetags.php. Use the profile loops in buddypress/bp-themes/bp-default/members/single/profile/profile-loop.php as a template.