[buddypress-trac] [BuddyPress] #4071: Changes to allow for completely seperate group types

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sat Mar 10 08:40:31 UTC 2012


#4071: Changes to allow for completely seperate group types
---------------------------+-----------------------------
 Reporter:  travel-junkie  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Groups         |    Version:
 Severity:  normal         |   Keywords:  has-patch
---------------------------+-----------------------------
 Having various group types is currently possible. Having a unique URL for
 these group types is not, however.

 I am currently writing a plugin that needs this, though. So for normal
 user groups I'd normally have an URL like so:
 http://my-site.com/groups/group-slug/

 For various group types I would then need an URL like this:
 http://my-site.com/group-type/group-slug/

 To make this happen I've had to add various filters and change the
 bp_group_admin_tabs() function to use bp_get_group_permalink(), so the
 link can be filtered.

 It also became necessary to filter out some group types from the normal
 groups directory. I've noticed an inconsistency when filtering
 'bp_groups_get_total_groups_sql' (line 387 in bp-groups-classes.php in
 trunk). $t_sql is already cast as a string, but is then being cast as an
 array again and then joined to create a string, which is unnecessary. Then
 $t_sql is also passed as the second argument to the filter, which doesn't
 make much sense. It would be better if $total_sql is passed instead.

 The group count for users then obviously needs adjusting as well, which is
 currently not possible with 'bp_get_total_group_count_for_user' (line 1666
 in bp-groups-template.php). $user_id should really be passed as a second
 argument to the filter to make this possible.

 Please see the attached patch files.

 There might be other instances where a filter is needed. I'll add these
 filters to the ticket if I come across it during development.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4071>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list