Forum Replies Created
-
Try this:
`$group = new BP_Groups_Group( $group_id );`$group will then be an object containing the group name and a few other pieces of info. You’ll need to use bp_core_fetch_avatar() to get the avatar.
True.
If you’re talking about comments on blog posts, then yes. You can set this at Dashboard > Settings > Discussion.
If you’re talking about other kinds of “comments”, such as activity updates and forum posts, then no.
In reply to: Need help learning plugin developmentI actually learned PHP by doing WP development, so I don’t think you have to do it in that order. But you do have to get real good at Googling, and you have to have a lot of patience combing through source code of other plugins, as @modemlooper suggests, and at the source code of BP and WP itself.
In reply to: Displaying Categories in GroupsIf you’re trying to check whether the group id is equal to 14, you’ll want something like this:
`global $bp;
if ( $bp->groups->current_group->id == 14 )
`
The groupmeta code you are currently using is looking for the existence of a piece of groupmeta with the meta_key ’14’. Is that what you mean to be doing?In reply to: Split members into admin defined caregoriesI’ve done this a few times for clients and I’m getting close to having a solution that’s release-worthy. Might even put it in as a patch for bp-core.
Yes, this is a known issue. We’re working on it.
Yeah, those functions can’t be simply overridden (like the functions in wp-includes/pluggable.php).
Your best bet is to do the following:
1) Copy the entire function you want to replace yo your functions.php, and change the function name (to something like custom_directory_members_search_form() )
2) Make sure that the template file that calls the template tag (I think it’s members-loop.php, though I’m not in front of my computer at the moment) exists in your child theme. Replace the reference to the original function in that template file to your newly created function name. Then you can customize to your heart’s content.Yeah, BP TinyMCE won’t take much to make it work. I think it’s just a matter of making sure that the CSS selectors in the JS are correct (they changed early in the life of bp-default). One of these days I will get around to updating it. Sorry it’s been gathering dust for so long.
In reply to: Cron Tasks with BuddyPressHere’s a pretty good guide that covers what Rich has shown here, plus how to designate custom intervals: http://themocracy.com/2010/02/wp-cron-automating-scheduling/
In reply to: The order of the pluginsThe page you linked to lists plugins in the order in which they were last updated. There’s no way I know of to see which ones were most recently created.
In reply to: Username as subdomain@hnla You should know by now that I have Super Powers.
In reply to: Modifying / Customising the registration processIt’s not straightforward, but it is possible. You’ll have to replace bp_core_screen_signup() (where the value of $bp->signup->step is set) with your own custom function. You’ll need to do the following:
`remove_action( ‘wp’, ‘bp_core_screen_signup’, 3 );`
to remove BP’s registration function, followed by
`remove_action( ‘wp’, ‘my_bp_core_screen_signup’, 3 );
function my_bp_core_screen_signup() { // etc`Copy the contents of bp_core_screen_signup() into your custom function. Then start looking for the places where $bp->signup->step is set – that’s what you’ll need to mess with to modify the way that registration steps work.
In reply to: Username as subdomainDo you mean that you want username.websitename.com to point to the user profile?
That’s easy enough if all you want is a redirect from username.websitename.com to websitename.com/members/username – you can do this with a straightforward RewriteRule in .htaccess. If you want to keep username.websitename.com for the entire session (so links like username.websitename.com/profile, username.websitename.com/friends, etc persist in the address bar), it’ll be pretty complicated. It’d mean reconfiguring a pretty big chunk of bp-core/bp-core-catchuri.php and/or bp-core.php to make sure that the $bp global is set correctly, as well as some .htaccess rules to make sure that URLs throughout buddypress that point to websitename.com/members/username/x get redirected to the right place.
(Sorry in advance that this answer is full of code. There is currently no easy way to do what you want to do, though with some coding it can be done pretty easily.)
Plugins generally create new group tabs through the BP Group Extension API: https://codex.buddypress.org/developer-docs/group-extension-api/ So a relatively quick way to keep certain tabs from appearing on certain groups is to modify the enable_nav_item() method, as shown under ‘Advanced Usage’ on that page. You’d have to do this to the plugins themselves.
If you’d prefer not to modify the plugins (which would be quite understandable) you could remove nav items after the fact with bp_core_remove_subnav_item(), defined in bp-core.php. This would take a lot of tweaking (and this is totally untested, so you’d have to experiment) but something in bp-custom.php like the following might work for you:
`function boone_limit_gallery_visibility() {
global $bp;if ( !groups_get_groupmeta( $bp->groups->current_group->id, ‘show_gallery’ ) )
bp_core_remove_subnav_item( ‘groups’, ‘gallery’ );
}
add_action( ‘bp_setup_nav’, ‘boone_limit_gallery_visibility’, 999 );`This assumes a couple things: 1) that your gallery plugin uses the term ‘gallery’ to name the subnav item, and 2) that you have already created a piece of group metadata ‘show_gallery’ for all groups that should see the gallery. You could also hardcode an array of group ids, like so:
`function boone_limit_gallery_visibility() {
global $bp;$gallery_array = array( 3, 6, 10, 12, 14 );
if ( !in_array( $bp->groups->current_group->id, $gallery_array) )
bp_core_remove_subnav_item( ‘groups’, ‘gallery’ );
}
add_action( ‘bp_setup_nav’, ‘boone_limit_gallery_visibility’, 999 );`That might be easier to get up and running at first, while you build the markup and functions necessary to save groupmeta.
At the beginning of your bp-custom.php file, make sure you have
`<?php`
and at the end make sure you have
`?>`The markup for the edit profile page is in the theme directory, members/single/profile/edit.php. The change avatar page is right next to it, members/single/profile/change-avatar.php. The markup for the settings screens is created in bp_core_screen_general_settings(), located in buddypress/bp-core/bp-core-settings.php. It’s possible in theory to move all of this markup to the same file – say, edit.php.
Then you’ll have to combine the form data handlers, which might be more tricky. When you save your settings panels, they are run through bp_core_screen_general_settings; you can find the code you need there. When you save the Edit Profile screen, it gets run through xprofile_screen_edit_profile() in buddypress/bp-xprofile.php. And the first stop for the Change Avatar page is xprofile_screen_change_avatar(), also in bp-xprofile.php. You’d have to merge all of these handlers somehow in order to get them to process data from the same HTML form.
Good luck.
In reply to: Buddypress forums not workingWe’ll need more information in order to help.https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/when-asking-for-support/
Also please do not bump your posts more than once a day. This board is not sufficiently well trafficked to expect a response within a few hours.
In reply to: Filter of Function / Theme or PluginCool. Glad it works!
In reply to: Update User Activitys Stream by RSS FeedYou’ll have to experiment in order to get the other parameters right. Try experimenting on a test installation to see how changing the different values (especially feed_action) changes the text.
And keep in mind that ‘user_id’ => ‘johnb’ will not work. You have to use a numeric id for the user. Also, make sure you have commas separating each value in the array, or you will get a white screen.
In reply to: Mediawiki single sign onMark – you’ll need to follow the instructions in that post clearly. Keep in mind that the plugin is not for WordPress; the modifications are mostly to Mediawiki. Your “valid headers” issue probably arises from the fact that you’re loading the plugins into wp-content/plugins instead of the extensions directory of your MW install.
In reply to: Filter of Function / Theme or PluginI’m not sure what you mean by reformatting “to a stacked output”, but you can definitely modify the output of bp_activity_action() without modifying the core BP files. In your theme’s functions.php, try a function like the following:
`function holt_modify_action( $action, $activity ) {
// $action is the unmodified action text produced by BP.
// $activity is a structured object with information about the activity
// Use those two values to concatenate whatever value you’d like, and then return it like this:
return $my_action;
}
add_filter( ‘bp_get_activity_action’, ‘holt_modify_action’, 10, 2 );`In reply to: Is BP the right plattform for my project?Sounds to me like most of your requirements could be met with WP Multisite plus a few selected plugins and themes.
– P2 allows for front-end posting
– https://wordpress.org/extend/plugins/more-privacy-options/ expands WP’s default privacy options to allow blog admins to hide their blogs from everyone but themselves
– Forums could be accomplished with bbPress or a forum-specific WP pluginDepending on what you need out of “blogs”, you might also be able to repurpose BuddyPress groups to do something similar. For instance:
– Each member is the sole member of a private/hidden group, and uses BP activity to “blog”. Since this happens through BP, there is no WP Dashboard involved.
– Likewise with Notes
– Depending on what you want with “Link List”, that can be pretty easily done with an additional profile field.
– Forums would of course be built in, in the form of non-private groups that the user could join.How to decide? If you don’t need the rich functionality of blogs (post revision history, out of the box multimedia support, etc), then actually giving each user two WP blogs might be too much overhead. In that case, BP would be a good choice. The functionality that you’d need is all already there; your work would be limited to customizing and configuring the interface.
In reply to: BP Developer Chat TodayThanks for the reminder!
In reply to: Update User Activitys Stream by RSS FeedI think you should just be able to add a user_id item to the array:
`’user_id’ => $user_id,`
where $user_id is johnb’s unique user id.