Forum Replies Created
-
In reply to: @thepseudo in the posts
i *think* the filter to hook on is
content_save_preas the bp atname filter already hooks on comments -> `add_filter( ‘pre_comment_content’, ‘bp_activity_at_name_filter’ );`seems in this special case you want an apply_filters in place of the
{$browse_sql}var, then at least you can move the logic and sql code to that called function.though you will always need to copy it back during any upgrade since it is a core file – you could create your own patch file to run each time
nothing in the code to trigger on
bp_activity_new_commentin a group context. i would file a trac ticketIn reply to: bbPress Themesforums are just wrapped in groups – as bbPress is “dumbed” down a bit and only used for some basic functionality.
following theme files:
/forums/forums-loop.php
/forums/index.php
/groups/single/forum/edit.php
/groups/single/forum/topic.phpIn reply to: Changing group linksa safe bet is just to modify a child theme for /groups/groups-loop.php and change the line of code
`<a href="”>` to
`<a href="forum/”>`
another idea is just to add a forum link within the group directory loop
http://etivite.com/groups/buddypress/forum/topic/quick-tip-display-the-groups-forum-link-on-the-group-directory-groups-loop-php/#topicIn reply to: Trying to alter layout of bp_activity_action()@ehegwer – this was just answered the other day in the forums and filtering the output – do a quick search.
thanks for testing it… i’ll add this to my plugin after bp1.2.6 hits. i see this question a bit (along with blocking a certain blog category)search up on placing code snippets in the theme’s function.php or creating a bp-custom.php
the blog_id is not the name of the blog but rather the numerical value in the db for that blog.
functions/bp-custom file – but with that code snippet you won’t be able to recover the data going forward (blocked from the db) – make sure you test it
think i’m going to update my block activity type plugin to allow more granular control over the item_id and types
but here is a code snippet i quickly modified from that plugin (untested – so double check). in theory, just replace INSERT_THE_BLOG_ID_HERE with the blog_id you want to block. (note this blocks new updates to the db, you would need to remove previous ones)
`
//if php is older then change $a to &$a
function my_block_activity_type_blog_id_before_save( $type, $a ) {
global $bp;//if there is an id – we don’t care… updating
if ( $a->id )
return $type;//Come and see the violence inherent in the system. Help! Help! I’m being repressed!
if ( $a->type == ‘new_blog_post’ || $a->type == ‘new_blog_comment’ ) {//item_id is the blog_id in this context
if ( $a->item_id == INSERT_THE_BLOG_ID_HERE ) {
$a->type = null;
return null;
}
}//otherwise continue if nothing happened
return $type;
}
add_filter(‘bp_activity_type_before_save’, ‘my_block_activity_type_blog_id_before_save’, 9999, 2);
`In reply to: Disallow groups creation , is it possible?In reply to: Cron Tasks with BuddyPresssomething like: (what i use for sitemap generator for a daily function call)
`
//on plugin activation register cron
function myplugin_activation() {
wp_schedule_event( time(), ‘daily’, ‘myplugin_wp_cron_call’ );
}
register_activation_hook(__FILE__, ‘myplugin_activation’);//on plugin deactivation remove cron
function myplugin_deactivation() {
wp_clear_scheduled_hook( ‘myplugin_wp_cron_call’ );
}
register_deactivation_hook(__FILE__, ‘myplugin_deactivation’);//hook the action to call from wp_cron
add_action( ‘myplugin_wp_cron_call’, ‘myplugin_some_function_to_hook_for_wp_cron’ );
`In reply to: Create groups only adminIn reply to: Using bp_activity_add() to update an activitysomething like:
`
$activity_id = bp_activity_add( array( ‘id’ => 555, ‘action’ => ‘something new and blue’ );
`no reason to use the do_action – that is just a trigger point for hooking into buddypress.
make sure you capture all the previous activity data and pass that back in – performs a full sql update on all cols (see the code in https://wordpress.org/extend/plugins/buddypress-edit-activity-stream/ )
oops, i guess you could use
bp_core_new_nav_itemas well – i was just copying my example code from a plugin of mine which places it under the ‘Profile’ navwrap the bp_core_new_subnav_item call in a function which is hooked on xprofile_setup_nav action (if that is installed, i don’t recall the name of the regular profile setup_nav action)
interim – what about filtering on bp_has_groups and unset the items? (and readjust the count)
you can add this to whatever functions/bp-custom file – the above code is incomplete and only serves as a rough guideline.
have a look at the bp_core_new_subnav_item function
something like
`
bp_core_new_subnav_item( array( ‘name’ => ‘My Profile Page’ ), ‘slug’ => ‘my-profile-page’, ‘parent_url’ => $bp->loggedin_user->domain . $bp->profile->slug . ‘/’, ‘parent_slug’ => $bp->profile->slug, ‘screen_function’ => ‘my_profile_page_function_to_show_screen’, ‘position’ => 40 ) );
`then the screen function to render the page:
`
function my_profile_page_function_to_show_screen() {//add title and content here – last is to call the members plugin.php template
add_action( ‘bp_template_title’, ‘my_profile_page_function_to_show_screen_title’ );
add_action( ‘bp_template_content’, ‘my_profile_page_function_to_show_screen_content’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}
``
function my_profile_page_function_to_show_screen_title() {
echo ‘something’;
}
`
`
function my_profile_page_function_to_show_screen_content() {//do something here for the page content
}
`a little quick tip i did to display the latest activity for a group
http://etivite.com/groups/buddypress/forum/topic/quick-tip-display-the-groups-recent-activity-on-group-directory-groups-loop/#topicbut this is using the activity stream content – so to filter the activity content to just forum topics: change the line ‘action’ => false to ‘action’ => ‘new_forum_topic’ you may need to tweak some other stuff (content, title, etc)
see how it works here:
http://etivite.com/groups/i vaguely remember a BP jquery plugin for an older version of BP that did this but was unable to find it.
a plugin could be created – the entire content is pulled and the filter bp_get_activity_content_body is available. (though not all activity updates have a permalink – just members, and uses the same templatetags)
In reply to: Username in Profile URLmight be possible to override the filter bp_core_get_userid (what is used in catchuri) and instead of looking up via username and use a different sql statement
In reply to: Allow Only Public Groupsin the wp-admin->buddypress->restrict group creation
wpprefix_options table under the option_name “bb-config-location”
verify the bb-config.php file and the location stored in the db _options table “bb-config-location”