Skip to:
Content
Pages
Categories
Search
Top
Bottom

Groups organization/navigation

  • Avatar of Daniel
    Daniel
    Participant

    @dcasas

    Hi everyone I am having trouble with organizing groups the way that I would like them to be organized, I did download the group tags plugin and that is a start but still everything seems a little messy. There are only to tabs in the groups section one for “All Groups” and “My Groups”. I would like to create my own tabs to go along with those two tabs that would output the groups that match a certain tag. Seems simple enough but I have been trying to input code into my index.php file under groups in my cpanel for a good two days now and nothing has worked for me, I get close, but still not working. This is all probably because I am a complete newbie when it comes to code of any type and web design in general. Anyway here is where Im at right now, this is the code thats already there that defines the All Groups and My Groups tabs:

    “li class=”selected” id=”groups-all”><a href="”></li"

    “?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?
    li id=”groups-personal”><a href="”?php printf( __( ‘My Groups (%s)’, ‘buddypress’ ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></li
    ?php endif; ?”

    then here is some code that I have found within the groups tag plugin that I think would be needed to link the tab and the specifically tagged groups:

    ` // hook into group listing function, output the groups that match a given tag
    function gtags_show_groups_for_tag( $groups ) {
    global $bp, $groups_template;

    /*
    echo ‘

    ajax_querystring: '; print_r( $bp->ajax_querystring ); echo '

    ‘;
    echo ‘

    current_action: '; print_r( $bp->current_action ); echo '

    ‘;
    echo ‘

    POST: '; print_r( $_POST ); echo '

    ‘;
    */

    if ( $_POST == ‘groups_filter’ || $_POST == ‘Search’ )
    return $groups;

    if ( $_POST )
    $tag = urldecode( $_POST ); // this is what ajax sends if we are in group directory
    else if ( $bp->current_action == ‘tag’ )
    $tag = urldecode( $bp->action_variables[0] ); // this is for the widget from all other places

    if ( $tag ) {
    echo ‘

    ‘.__(‘Results for tag’, ‘gtags’).': ‘ . $tag . ‘

    ‘;
    $gtags_groups = gtags_get_groups_by_tag( null, null, false, false, $tag );
    $groups_template->groups = $gtags_groups[groups];
    // turn off pagination
    $groups_template->group_count = $gtags_groups[total];
    $groups_template->total_group_count = $gtags_groups[total];
    $groups_template->pag_num = $gtags_groups[total];
    $groups_template->pag_page = 1;
    $groups_template->pag_links = ”;
    $groups = $gtags_groups;
    }

    //echo ‘

    '; print_r( $bp->current_action ); echo '

    ‘;
    //echo ‘

    '; print_r( $bp->action_variables[0] ); echo '

    ‘;

    return $groups;
    }
    add_filter( ‘bp_has_groups’, ‘gtags_show_groups_for_tag’ ); `

    I dont know how to mix those two together to get a working solution thats why I am asking your help. If anyone knows how to go about doing this then please please help! thank

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Daniel
    Daniel
    Participant

    @dcasas

    bump

    Avatar of Daniel
    Daniel
    Participant

    @dcasas

    bump

    Avatar of nit3watch
    nit3watch
    Participant

    @nit3watch

    why not just take a plug-in like group email plug-in ( gives the extra tab under groups ( remove is_admin so it would show for all users ) ), strip out all the unnecessary code and add the links

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    I believe Daniel wants to add a tab on the group directory page.

    That would require manipulating the “bp_ajax_querystring” filter located in /bp-themes/bp-default/_inc/ajax.php.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Groups organization/navigation’ is closed to new replies.