Ticket #4071: group-types.patch
File group-types.patch, 6.6 KB (added by , 13 years ago) |
---|
-
bp-groups-classes.php
384 384 $t_sql .= " WHERE " . join( ' AND ', (array) $total_sql['where'] ); 385 385 386 386 // 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 ); 388 388 $total_groups = $wpdb->get_var( $total_groups_sql ); 389 389 390 390 $group_ids = array(); -
bp-groups-loader.php
326 326 'item_css_id' => $this->id 327 327 ); 328 328 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 ); 330 330 331 331 // Add the "Home" subnav item, as this will always be present 332 332 $sub_nav[] = array( -
bp-groups-template.php
445 445 if ( empty( $group ) ) 446 446 $group =& $groups_template->group; 447 447 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 ); 449 449 } 450 450 451 451 function bp_group_admin_permalink() { … … 457 457 if ( empty( $group ) ) 458 458 $group =& $groups_template->group; 459 459 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 ); 461 461 } 462 462 463 463 function bp_group_slug() { … … 1266 1266 1267 1267 if ( bp_is_item_admin() || bp_is_item_mod() ) : ?> 1268 1268 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> 1270 1270 1271 1271 <?php endif; ?> 1272 1272 1273 1273 <?php if ( ! bp_is_item_admin() ) 1274 1274 return false; ?> 1275 1275 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> 1277 1277 1278 1278 <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?> 1279 1279 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> 1281 1281 1282 1282 <?php endif; ?> 1283 1283 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> 1285 1285 1286 <?php if ( $group s_template->group->status == 'private' ) : ?>1286 <?php if ( $group->status == 'private' ) : ?> 1287 1287 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> 1289 1289 1290 1290 <?php endif; ?> 1291 1291 1292 1292 <?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?> 1293 1293 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> 1295 1295 1296 1296 <?php 1297 1297 } … … 1663 1663 echo bp_get_total_group_count_for_user( $user_id ); 1664 1664 } 1665 1665 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 ); 1667 1667 } 1668 1668 1669 1669 … … 2839 2839 $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug; 2840 2840 2841 2841 // 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 ); 2843 2843 2844 2844 // Add possible query arg 2845 2845 if ( !empty( $query_args ) && is_array( $query_args ) )