Skip to:
Content

BuddyPress.org

Ticket #4071: group-types.patch

File group-types.patch, 6.6 KB (added by travel-junkie, 13 years ago)
  • bp-groups-classes.php

     
    384384                        $t_sql .= " WHERE " . join( ' AND ', (array) $total_sql['where'] );
    385385
    386386                // Get total group results
    387                 $total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', join( ' ', (array) $t_sql ), $t_sql );
     387                $total_groups_sql = apply_filters( 'bp_groups_get_total_groups_sql', $t_sql, $total_sql );
    388388                $total_groups     = $wpdb->get_var( $total_groups_sql );
    389389
    390390                $group_ids = array();
  • bp-groups-loader.php

     
    326326                                'item_css_id'         => $this->id
    327327                        );
    328328
    329                         $group_link = trailingslashit( bp_get_root_domain() . '/' . $this->root_slug . '/' . $this->current_group->slug );
     329                        $group_link = apply_filters( 'bp_get_nav_group_link', trailingslashit( bp_get_root_domain() . '/' . $this->root_slug . '/' . $this->current_group->slug ), $this->current_group );
    330330
    331331                        // Add the "Home" subnav item, as this will always be present
    332332                        $sub_nav[] = array(
  • bp-groups-template.php

     
    445445                if ( empty( $group ) )
    446446                        $group =& $groups_template->group;
    447447
    448                 return apply_filters( 'bp_get_group_permalink', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' );
     448                return apply_filters( 'bp_get_group_permalink', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/', $group );
    449449        }
    450450
    451451function bp_group_admin_permalink() {
     
    457457                if ( empty( $group ) )
    458458                        $group =& $groups_template->group;
    459459
    460                 return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin' ) );
     460                return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin' ), $group );
    461461        }
    462462
    463463function bp_group_slug() {
     
    12661266
    12671267        if ( bp_is_item_admin() || bp_is_item_mod() ) : ?>
    12681268
    1269                 <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
     1269                <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
    12701270
    12711271        <?php endif; ?>
    12721272
    12731273        <?php if ( ! bp_is_item_admin() )
    12741274                        return false; ?>
    12751275
    1276         <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
     1276        <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
    12771277
    12781278        <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
    12791279
    1280                 <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-avatar' ) ?>"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
     1280                <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/group-avatar' ) ?>"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
    12811281
    12821282        <?php endif; ?>
    12831283
    1284         <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/manage-members' ) ?>"><?php _e( 'Members', 'buddypress' ); ?></a></li>
     1284        <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members' ) ?>"><?php _e( 'Members', 'buddypress' ); ?></a></li>
    12851285
    1286         <?php if ( $groups_template->group->status == 'private' ) : ?>
     1286        <?php if ( $group->status == 'private' ) : ?>
    12871287
    1288                 <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
     1288                <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
    12891289
    12901290        <?php endif; ?>
    12911291
    12921292        <?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?>
    12931293
    1294         <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
     1294        <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
    12951295
    12961296<?php
    12971297}
     
    16631663        echo bp_get_total_group_count_for_user( $user_id );
    16641664}
    16651665        function bp_get_total_group_count_for_user( $user_id = 0 ) {
    1666                 return apply_filters( 'bp_get_total_group_count_for_user', groups_total_groups_for_user( $user_id ) );
     1666                return apply_filters( 'bp_get_total_group_count_for_user', groups_total_groups_for_user( $user_id ), $user_id );
    16671667        }
    16681668
    16691669
     
    28392839                        $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug;
    28402840
    28412841                // Add a slash at the end of our user url
    2842                 $url = trailingslashit( $url );
     2842                $url = apply_filters( 'bp_get_groups_action_link', trailingslashit( $url ), $action );
    28432843
    28442844                // Add possible query arg
    28452845                if ( !empty( $query_args ) && is_array( $query_args ) )