Forum Replies Created
-
In reply to: Trying to alter layout of bp_activity_action()
The method I talk about above – using a filter on groups_activity_new_forum_topic_action – will only work for future activity updates. It doesn’t change the display of anything that’s already written in the database.
Are you having other problems creating content? Can you post new forum topics? New activity updates?
I suggest switching back for a moment to bp-default to see if the problem is theme-related. If so we can troubleshoot from there.
Have you made theme changes recently? Are you inheriting the group creation pages from bp-default? The “are you sure you want to do this?” message often means that there is a nonce issue, which could result from missing security keys in your theme files.
It’s not obvious to me how any of the BP plugins you’ve got installed would affect group creation (as far as I know, Invite Anyone, BP Links, and oEmbed all keep their hands off of the group creation process) but your best best for testing is to disable those plugins one by one to identify the problem.
In reply to: Activity, Groups Cluttered?Hmmmm…so you’re saying that a plugins/bp-custom.php file with only that as the content whitescreens an installation that works perfectly without it? Are you sure you copied over the opening/closing delimiters? Or have you duplicated them maybe? I’ve tested it on three different installations and it’s working on all of them. (Sorry for the problems btw!)
In reply to: Isn't it ALL a BuddyPress issue?@3sixty – To some extent I think you’re right. There’s a certain quickness to say “That’s a WP question!” in these forums. (Although I will say, anecdotally, that it used to happen more than it does now.)
Often there’s a good reason for redirecting questions to the WP forums. For one, the user base there is much bigger, so questions are likely to have a lot more readers, and are thus a lot more likely to get a good answer. Moreover, many common questions have already been answered there many times over, and it doesn’t really pay to rehash those issues in this space.
Still, some reproduction of content is probably a good thing, especially in cases where there is as much overlap as with BP/WP. So I don’t mind providing a certain amount of WP (or even general PHP/HTML/CSS) help in these forums when the mood strikes me. Constantly passing the buck – “that’s a (fill-in-the-blank) issue” – is not a great way to welcome new users to the BP community.
In reply to: Activity, Groups Cluttered?Yikes. Make sure you’ve taken it out of the functions.php file. The same function name cant exist in two places.
In reply to: Activity, Groups Cluttered?@scotm – Hm, I have a dev environment just like that and it works fine. Maybe in a bp-custom file instead. Create a file called bp-custom.php in your plugins directory. Make sure you have php delimiters at the beginning and end of the file, and put the code above in between them. So the whole file would be:
<?php
function my_custom_query_filter( $query_string ) {
global $bp;
if ( bp_is_activity_component() && !$bp->displayed_user->id )
$query_string .= '&action=activity_update';
return $query_string;
}
add_filter( 'bp_dtheme_ajax_querystring', 'my_custom_query_filter' );
?>In reply to: 404 error on bp links@adiallo – It won’t do you any good to bump your post every few hours. This board isn’t well trafficked enough that you should expect an immediate response.
If you’re running standard (non-MU) WordPress, then you shouldn’t need the blog tracking feature. I’m not sure why BP is even trying to access wp_bp_user_blogs_blogmeta. When you go to Dashboard > BuddyPress > Component Setup, do you see a Blogs option? If so, disable it and see if it solves your problem.
If you’re still stuck, try a total reinstallation of BuddyPress. Delete the plugin and reinstall. If you’re *still* having problems, try deleting the plugin, then dropping the tables in the database that start with wp_bp_, THEN reactivating.
Or am I misunderstanding you and you’re actually running WPMU?
In reply to: 404 Error on buddypress links@suave74 – Any permalink setting other than the default should work. Pick the second one, Day and Name, and see if you are successful.
In reply to: Ning.com Migration Tool (NMT)For those of you who don’t follow me on Twitter or on my blog (btw – what the heck is wrong with you? I rule), I just updated the Import from Ning plugin to support BP xprofile fields: http://teleogistic.net/2010/04/more-import-to-ning-goodness/
@Erich73 – You really only need to have it activated on the main blog, but I don’t think it will hurt anything to do it sitewide. I should check into this. As for group admins: Good idea. I should be able to put that in the next version.
@hnla – If you’re using a theme that supports widgets (like the bp-default theme), then the widget allows you to display some email fields on any BP page (for logged in users only, of course). It’s a way of making the email invitation function a little bit more public, so that more people know about it.
It goes without saying that the widget is optional, though. If you don’t find a use for it, then you don’t have to turn it on
In reply to: Activity, Groups Cluttered?@modemlooper @scotm – Check out the Filtering Options at https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-activity-stream-loop/. For example, if you want the main site activity stream to show only updates, use something like this in functions.php of your theme:
function my_custom_query_filter( $query_string ) {
global $bp;
if ( bp_is_activity_component() && !$bp->displayed_user->id )
$query_string .= '&action=activity_update';
return $query_string;
}
add_filter( 'bp_dtheme_ajax_querystring', 'my_custom_query_filter' );Play around with that conditional statement and the query string arguments to make the activity stream show what you want it to show.
@Erich73 – You can customize the message however you’d like on the Dashboard admin panel. Under Buddypress > Invite Anyone. As for your report about the “Sent Invites” tab – are you sure that you sent group invites along with the email invitations? As @hnla says, make sure you’ve checked the option on the Dashboard panel.
@dre1080 – I may try to make this work at a later date. If nothing else, I can put in the proper hooks that would allow someone else to build such an extension for my plugin. Stay tuned.
@everyone – I just put a widget into the development version of the plugin, available at https://wordpress.org/extend/plugins/invite-anyone/download/. If anyone is interested, they can check it out! I want to get a few more new features before tagging a new stable version.
BuddyPress is still young and so it doesn’t have the same kind of rich development guides as the much more mature (and widely-used) WordPress.
Since BP is a WP plugin, the basics of BP plugin development are the same as they are for WP. The system of hooks and filters is exactly the same (though of course the hooks themselves are different).
At this point in the BP project, I’ve found that the best ways to get started with plugin development are (a) to find existing BP plugins that do something similar to what you’re trying to do, and to learn by dissecting them; (b) to look through official resources like the ones Jeff posted above; and (c) to search through BP codebase itself, where I think you’ll find that many of the functions you need are quite well documented.
In reply to: Trying to alter layout of bp_activity_action()It’s probably best to take a multi-faceted approach.
Instead of changing the way that content appears on the way out (by the time you call the global $activities_template, the content is already written in the db), you might consider manipulating it on the way in. Less overhead that way. For group related stuff like forum posts, open up bp-groups.php and search for uses of the function groups_record_activity. You’ll notice that the arguments for this function are almost always filtered. For instance, in the function groups_new_group_forum_post, you can modify the way that the activity action is displayed – you might do something like this in your theme’s functions.php:
function my_format_activity_action($activity_action, $post_id, $post_text, &$topic) {
$action = $post_text->topic_poster_name . " said:";
return $action;
}
add_filter( 'groups_activity_new_forum_topic_action', 'my_format_activity_action', 1, 4 );That’s a lot easier than after-the-fact string manipulation, both for you as a developer and for the system that has to do the processing. Fish around in the files for other places where apply_filters appears – you can build functions like the one I lay out above for any filtered output.
As far as moving things around and putting them in different orders, you’ll definitely want to look at the activity/entry.php template file. That’s where all the markup appears, so any changes (like ordering and appearance) should happen there and in CSS.
And if you just want to change the wording here and there, you might also consider using language files (https://codex.buddypress.org/how-to-guides/customizing-labels-messages-and-urls/). It’s a relatively future-proof way to do customization.
In reply to: Ning.com Migration Tool (NMT)Heh, to be fair it was an adaptation of an existing plugin. I probably wrote about half of it
In reply to: Ning.com Migration Tool (NMT)It’s just a start, but after I heard the news about Ning I wrote a plugin that will import users from Ning to WordPress: http://teleogistic.net/2010/04/importing-ning-users-into-wp/.
Sadly Ning doesn’t offer easy export of the rest of the content. But I think some folks out there are working on ways for you to get your forums, discussions, blog posts, etc out of there as well.
In reply to: How to overwrite a function?@airfoil is right. That might be the cause of your problems.
In reply to: How to overwrite a function?heini – Just to be clear: What @3sixty is suggesting is that you copy the *entire* groups_setup_nav() function (it’s pretty big), paste it into bp-custom.php, change the name (eg to my_group_setup_nav), make the change to bp_core_new_nav_default, and then do the remove_action/add_action stuff outside the function.
If you do this right, then it will replace the entire function, though most of it will be replaced by the same code.
Like so:
function kriski_custom_from_address( $address ) {
return 'kriski';
}
add_filter( 'bp_core_email_from_address_filter', 'kriski_custom_from_address' );That should turn the from address to ‘kriski@yourdomain.com’.
In reply to: How to overwrite a function?@heini – If you overwrite the existing bp_core_new_nav_default line in bp-groups.php with
bp_core_new_nav_default( array( 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_forum', 'subnav_slug' => 'forum' ) );it will work.
I can’t seem to make bp_core_new_nav_default work anywhere else. Maybe someone else has some ideas, or maybe it’s just not part of the API to override this right now (like it is with profiles and BP_DEFAULT_COMPONENT).
Another way to do it, which is less elegant but possible without hacking core files, is to put something like this in your bp-custom.php file:
function redirect_to_forum() {
global $bp;
if ( bp_is_group_home() )
$bp->current_action = 'forum';
}
add_action( 'bp_init', 'redirect_to_forum' );@Erich73 and @hnla – The Send Invites tab during the group creation process is indeed part of BP core. I’m not necessarily saying that you should remove the Send Invites step from group creation. I think it’s a good idea to give group creators a chance to populate their groups. (Though, if you wanted to, there are ways that you could remove the step.) My plugin does not currently allow for group creators to invite members to their group by email directly from the Groups section of the site – only from the Profile section. This is mostly a technical issue (ie I haven’t reconfigured the group invitation screen to do so yet). In the future I may add the functionality that Erich73 is looking for.