<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [2622] trunk: Fixes #1840</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2622</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-02-08 12:33:13 +0000 (Mon, 08 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixes #1840</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivitypostformphp">trunk/bp-themes/bp-default/activity/post-form.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (2621 => 2622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2010-02-08 12:12:04 UTC (rev 2621)
+++ trunk/bp-groups/bp-groups-classes.php        2010-02-08 12:33:13 UTC (rev 2622)
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">
</span><span class="cx">         /* TODO: Merge all these get_() functions into one. */
</span><span class="cx">
</span><del>-        function get_newest( $limit = null, $page = null, $user_id = false, $search_terms = false ) {
</del><ins>+        function get_newest( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 if ( $limit && $page )
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx">                         $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -289,7 +289,7 @@
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_active( $limit = null, $page = null, $user_id = false, $search_terms = false ) {
</del><ins>+        function get_active( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 if ( $limit && $page )
</span><span class="lines">@@ -312,7 +312,7 @@
</span><span class="cx">                         $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_popular( $limit = null, $page = null, $user_id = false, $search_terms = false ) {
</del><ins>+        function get_popular( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 if ( $limit && $page ) {
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx">                         $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql}" );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -354,7 +354,7 @@
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_alphabetically( $limit = null, $page = null, $user_id = false, $search_terms = false ) {
</del><ins>+        function get_alphabetically( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 if ( $limit && $page )
</span><span class="lines">@@ -377,7 +377,7 @@
</span><span class="cx">                         $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' {$hidden_sql} {$search_sql}" );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -386,7 +386,7 @@
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_by_most_forum_topics( $limit = null, $page = null, $user_id = false, $search_terms = false ) {
</del><ins>+        function get_by_most_forum_topics( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp, $bbdb;
</span><span class="cx">
</span><span class="cx">                 if ( !$bbdb )
</span><span class="lines">@@ -413,7 +413,7 @@
</span><span class="cx">                         $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) AND f.topics > 0 {$hidden_sql} {$search_sql}" );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -422,7 +422,7 @@
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false ) {
</del><ins>+        function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp, $bbdb;
</span><span class="cx">
</span><span class="cx">                 if ( !$bbdb )
</span><span class="lines">@@ -449,7 +449,7 @@
</span><span class="cx">                         $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name_groupmeta} gm3, {$bbdb->forums} f, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND g.id = gm3.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND (gm3.meta_key = 'forum_id' AND gm3.meta_value = f.forum_id) {$hidden_sql} {$search_sql}" );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx">                 return $wpdb->get_results($sql);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_by_letter( $letter, $limit = null, $page = null ) {
</del><ins>+        function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 if ( strlen($letter) > 1 || is_numeric($letter) || !$letter )
</span><span class="lines">@@ -520,7 +520,7 @@
</span><span class="cx">
</span><span class="cx">                 $paged_groups = $wpdb->get_results( $wpdb->prepare( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} ORDER BY g.name ASC {$pag_sql}" ) );
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -529,7 +529,7 @@
</span><span class="cx">                 return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function get_random( $limit = null, $page = null, $user_id = false, $search_terms = false ) {
</del><ins>+        function get_random( $limit = null, $page = null, $user_id = false, $search_terms = false, $populate_extras = true ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx">                 if ( $limit && $page )
</span><span class="lines">@@ -552,7 +552,7 @@
</span><span class="cx">                         $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm INNER JOIN {$bp->groups->table_name} g ON gm.group_id = g.id WHERE gm.meta_key = 'last_activity'{$hidden_sql} {$search_sql}" );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( empty( $user_id ) ) {
</del><ins>+                if ( !empty( $populate_extras ) ) {
</ins><span class="cx">                         foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
</span><span class="cx">                         $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
</span><span class="cx">                         $paged_groups = BP_Groups_Group::get_group_extras( &$paged_groups, $group_ids, 'newest' );
</span><span class="lines">@@ -764,12 +764,12 @@
</span><span class="cx">         function accept_invite() {
</span><span class="cx">                 $this->inviter_id = 0;
</span><span class="cx">                 $this->is_confirmed = 1;
</span><del>-                $this->date_modified = time();
</del><ins>+                $this->date_modified = gmdate( "Y-m-d H:i:s" );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function accept_request() {
</span><span class="cx">                 $this->is_confirmed = 1;
</span><del>-                $this->date_modified = time();
</del><ins>+                $this->date_modified = gmdate( "Y-m-d H:i:s" );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Static Functions */
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (2621 => 2622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2010-02-08 12:12:04 UTC (rev 2621)
+++ trunk/bp-groups/bp-groups-templatetags.php        2010-02-08 12:33:13 UTC (rev 2622)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx">         var $sort_by;
</span><span class="cx">         var $order;
</span><span class="cx">
</span><del>-        function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms ) {
</del><ins>+        function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras ) {
</ins><span class="cx">                 global $bp;
</span><span class="cx">
</span><span class="cx">                 $this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $page;
</span><span class="lines">@@ -30,33 +30,44 @@
</span><span class="cx">
</span><span class="cx">                 switch ( $type ) {
</span><span class="cx">                         case 'active': default:
</span><del>-                                $this->groups = groups_get_active( $this->pag_num, $this->pag_page, $user_id, $search_terms );
</del><ins>+                                $this->groups = groups_get_active( $this->pag_num, $this->pag_page, $user_id, $search_terms, $populate_extras );
</ins><span class="cx">                                 break;
</span><span class="cx">
</span><span class="cx">                         case 'alphabetical': default:
</span><del>-                                $this->groups = groups_get_alphabetically( $this->pag_num, $this->pag_page, $user_id, $search_terms );
</del><ins>+                                $this->groups = groups_get_alphabetically( $this->pag_num, $this->pag_page, $user_id, $search_terms, $populate_extras );
</ins><span class="cx">                                 break;
</span><span class="cx">
</span><span class="cx">                         case 'random':
</span><del>-                                $this->groups = groups_get_random_groups( $this->pag_num, $this->pag_page, $user_id, $search_terms );
</del><ins>+                                $this->groups = groups_get_random_groups( $this->pag_num, $this->pag_page, $user_id, $search_terms, $populate_extras );
</ins><span class="cx">                                 break;
</span><span class="cx">
</span><span class="cx">                         case 'newest':
</span><del>-                                $this->groups = groups_get_newest( $this->pag_num, $this->pag_page, $user_id, $search_terms );
</del><ins>+                                $this->groups = groups_get_newest( $this->pag_num, $this->pag_page, $user_id, $search_terms, $populate_extras );
</ins><span class="cx">                                 break;
</span><span class="cx">
</span><span class="cx">                         case 'popular':
</span><del>-                                $this->groups = groups_get_popular( $this->pag_num, $this->pag_page, $user_id, $search_terms );
</del><ins>+                                $this->groups = groups_get_popular( $this->pag_num, $this->pag_page, $user_id, $search_terms, $populate_extras );
</ins><span class="cx">                                 break;
</span><span class="cx">
</span><span class="cx">                         case 'most-forum-topics':
</span><del>-                                $this->groups = groups_get_by_most_forum_topics( $this->pag_num, $this->pag_page, $user_id, $search_terms );
</del><ins>+                                $this->groups = groups_get_by_most_forum_topics( $this->pag_num, $this->pag_page, $user_id, $search_terms, $populate_extras );
</ins><span class="cx">                                 break;
</span><span class="cx">
</span><span class="cx">                         case 'most-forum-posts':
</span><del>-                                $this->groups = groups_get_by_most_forum_posts( $this->pag_num, $this->pag_page, $user_id, $search_terms );
</del><ins>+                                $this->groups = groups_get_by_most_forum_posts( $this->pag_num, $this->pag_page, $user_id, $search_terms, $populate_extras );
</ins><span class="cx">                                 break;
</span><span class="cx">
</span><ins>+                        case 'invites':
+                                $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page );
+                                break;
+
+                        case 'single-group':
+                                $group = new stdClass;
+                                $group->group_id = BP_Groups_Group::get_id_from_slug($slug);
+                                $this->groups = array( $group );
+                                break;
+
+
</ins><span class="cx">                         case 'admin-of':
</span><span class="cx">                                 if ( $user_id )
</span><span class="cx">                                         $this->groups = groups_get_user_is_admin_of( $user_id, $this->pag_num, $this->pag_page, $search_terms );
</span><span class="lines">@@ -66,16 +77,6 @@
</span><span class="cx">                                 if ( $user_id )
</span><span class="cx">                                         $this->groups = groups_get_user_is_mod_of( $user_id, $this->pag_num, $this->pag_page, $filter );
</span><span class="cx">                                 break;
</span><del>-
-                        case 'invites':
-                                $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page );
-                                break;
-
-                        case 'single-group':
-                                $group = new stdClass;
-                                $group->group_id = BP_Groups_Group::get_id_from_slug($slug);
-                                $this->groups = array( $group );
-                                break;
</del><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if ( 'invites' == $type ) {
</span><span class="lines">@@ -214,13 +215,15 @@
</span><span class="cx">
</span><span class="cx">                 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined
</span><span class="cx">                 'slug' => $slug, // Pass a group slug to only return that group
</span><del>-                'search_terms' => $search_terms // Pass search terms to return only matching groups
</del><ins>+                'search_terms' => $search_terms, // Pass search terms to return only matching groups
+
+                'populate_extras' => true // Get extra meta - is_member, is_banned
</ins><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r );
</span><span class="cx">
</span><del>-        $groups_template = new BP_Groups_Template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms );
</del><ins>+        $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, (int)$populate_extras );
</ins><span class="cx">         return apply_filters( 'bp_has_groups', $groups_template->has_groups(), &$groups_template );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1134,6 +1137,9 @@
</span><span class="cx">         if ( !$group->status )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><ins>+        if ( 'hidden' == $group->status && !$group->is_member )
+                return false;
+
</ins><span class="cx">         echo '<div class="generic-button group-button ' . $group->status . '" id="groupbutton-' . $group->id . '">';
</span><span class="cx">
</span><span class="cx">         switch ( $group->status ) {
</span><span class="lines">@@ -1154,6 +1160,11 @@
</span><span class="cx">                                         echo '<a class="membership-requested" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>';
</span><span class="cx">                         }
</span><span class="cx">                 break;
</span><ins>+
+                case 'hidden':
+                        if ( $group->is_member )
+                                echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';
+                break;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         echo '</div>';
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2621 => 2622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-02-08 12:12:04 UTC (rev 2621)
+++ trunk/bp-groups.php        2010-02-08 12:33:13 UTC (rev 2622)
</span><span class="lines">@@ -2173,6 +2173,10 @@
</span><span class="cx">         if ( !$member->save() )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><ins>+        /* Modify group meta */
+        groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );
+        groups_update_groupmeta( $group_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+
</ins><span class="cx">         do_action( 'groups_accept_invite', $user_id, $group_id );
</span><span class="cx">         return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivitypostformphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/post-form.php (2621 => 2622)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/post-form.php        2010-02-08 12:12:04 UTC (rev 2621)
+++ trunk/bp-themes/bp-default/activity/post-form.php        2010-02-08 12:33:13 UTC (rev 2622)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">                                         <select id="whats-new-post-in" name="whats-new-post-in">
</span><span class="cx">                                                 <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ) ?></option>
</span><span class="cx">
</span><del>-                                                <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : while ( bp_groups() ) : bp_the_group(); ?>
</del><ins>+                                                <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) : while ( bp_groups() ) : bp_the_group(); ?>
</ins><span class="cx">                                                         <option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option>
</span><span class="cx">                                                 <?php endwhile; endif; ?>
</span><span class="cx">                                         </select>
</span></span></pre>
</div>
</div>
</body>
</html>