Forum Replies Created
-
Wow! if anyone needs.. my solution here:
http://wordpress.org/support/topic/tree-loop-inside-member-groups-list-help-me-please?replies=3#post-3394577@ddean help-me?

excuse-me, the code:
`<?php
$loop_template = apply_filters(‘bp_located_template’,locate_template( array( “tree/tree-loop_single.php” ), false ), “tree/tree-loop_single.php” );
load_template($loop_template);
?>`
@overloadedtoday i’ve made a function to get all child group_id’s and put it in the query_string..
…&primary_id=1,14,5,45
it creates an activity page with only updates inside these groups
at this point all updates into subgroups propagates to father groups!

Thanks David!
I’ve solved the problem creating a function to listing all toplevel subgroup ids of that siteroot and putting this list into primary_id value of activity filter..$lines=bp_get_all_lines_from_current($bp->groups->current_group->id);
if ( bp_is_groups_component() ){
$qs = $qs.”&primary_id=$lines”;
}Note:
I do not want to force members of the group root, enter all parentgrpous, like this:/* groups_join_group is called whenever someone joins a group in both BP 1.2 and 1.5.x */
add_action(‘groups_join_group’, ‘my_join_group_action’, 10, 2);function my_join_group_action( $group_id, $user_id ) {
/* This part is critical – you must select ONLY the groups you want to START this chain
* This function will recurse up to the toplevel on its own, so if you have a parent group
* in the list, you will waste resources trying to join the same group multiple times
* as this function is called on each step up the tree
*/
/** Pick from a list of groups */
if( in_array( $group_id, ARRAY_OF_GROUPS_I_CARE_ABOUT ) ) {
/* — OR — */
/** Select groups by depth */
if( count( bp_group_hierarchy_get_parents() ) == DEPTH_OF_GROUP_I_CARE_ABOUT_EG_3 ) {
/* — OR ANYTHING ELSE YOU LIKE *//* However you choose to select groups, once the group_id matched this part will
* walk up the tree, joining the user to each parent group along the way
*/$parents = bp_group_hierarchy_get_parents();
foreach( $parents as $parent_group_id ) {
groups_join_group( $parent_group_id, $user_id );
}
}
}I’m thinking only one way to show all streams of subgroups in a root stream ..
thanks!