<!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] [2537] trunk: Tweaking single group pages and group class.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2537</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-02-02 16:53:40 +0000 (Tue, 02 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Tweaking single group pages and group class.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsnotificationsphp">trunk/bp-groups/bp-groups-notifications.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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (2536 => 2537)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2010-02-02 15:31:49 UTC (rev 2536)
+++ trunk/bp-groups/bp-groups-classes.php        2010-02-02 16:53:40 UTC (rev 2537)
</span><span class="lines">@@ -10,30 +10,20 @@
</span><span class="cx">         var $enable_forum;
</span><span class="cx">         var $date_created;
</span><span class="cx"> 
</span><del>-        var $user_dataset;
-
</del><span class="cx">         var $admins;
</span><span class="cx">         var $total_member_count;
</span><del>-        var $random_members;
</del><span class="cx"> 
</span><del>-        function bp_groups_group( $id = null, $single = false, $get_user_dataset = true ) {
</del><ins>+        function bp_groups_group( $id = null ) {
</ins><span class="cx">                 if ( $id ) {
</span><span class="cx">                         $this-&gt;id = $id;
</span><del>-                        $this-&gt;populate( $get_user_dataset );
</del><ins>+                        $this-&gt;populate();
</ins><span class="cx">                 }
</span><del>-
-                if ( $single ) {
-                        $this-&gt;populate_meta();
-                }
</del><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function populate( $get_user_dataset ) {
</del><ins>+        function populate() {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span><del>-                $sql = $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;groups-&gt;table_name} WHERE id = %d&quot;, $this-&gt;id );
-                $group = $wpdb-&gt;get_row($sql);
-
-                if ( $group ) {
</del><ins>+                if ( $group = $wpdb-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT g.*, gm.meta_value as last_activity, gm2.meta_value as total_member_count FROM {$bp-&gt;groups-&gt;table_name} g, {$bp-&gt;groups-&gt;table_name_groupmeta} gm, {$bp-&gt;groups-&gt;table_name_groupmeta} gm2 WHERE g.id = gm.group_id AND g.id = gm2.group_id AND gm.meta_key = 'last_activity' AND gm2.meta_key = 'total_member_count' AND g.id = %d&quot;, $this-&gt;id ) ) ) {
</ins><span class="cx">                         $this-&gt;id = $group-&gt;id;
</span><span class="cx">                         $this-&gt;creator_id = $group-&gt;creator_id;
</span><span class="cx">                         $this-&gt;name = stripslashes($group-&gt;name);
</span><span class="lines">@@ -42,27 +32,21 @@
</span><span class="cx">                         $this-&gt;status = $group-&gt;status;
</span><span class="cx">                         $this-&gt;enable_forum = $group-&gt;enable_forum;
</span><span class="cx">                         $this-&gt;date_created = $group-&gt;date_created;
</span><del>-                        $this-&gt;total_member_count = groups_get_groupmeta( $this-&gt;id, 'total_member_count' );
</del><ins>+                        $this-&gt;last_activity = $group-&gt;last_activity;
+                        $this-&gt;total_member_count = $group-&gt;total_member_count;
+                        $this-&gt;is_member = BP_Groups_Member::check_is_member( $bp-&gt;loggedin_user-&gt;id, $this-&gt;id );
</ins><span class="cx"> 
</span><del>-                        if ( $get_user_dataset ) {
-                                $this-&gt;user_dataset = $this-&gt;get_user_dataset();
-
-                                $this-&gt;total_member_count = count( $this-&gt;user_dataset );
-                                groups_update_groupmeta( $this-&gt;id, 'total_member_count', $this-&gt;total_member_count );
</del><ins>+                        /* Get group admins and mods */
+                        $admin_mods = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb-&gt;users} u, {$bp-&gt;groups-&gt;table_name_members} m WHERE u.ID = m.user_id AND m.group_id = %d AND ( m.is_admin = 1 OR m.is_mod = 1 )&quot;, $this-&gt;id ) );
+                        foreach( (array)$admin_mods as $user ) {
+                                if ( (int)$user-&gt;is_admin )
+                                        $this-&gt;admins[] = $user;
+                                else
+                                        $this-&gt;mods[] = $user;
</ins><span class="cx">                         }
</span><del>-
-                        /* Get group extras */
-                        $this-&gt;is_member = BP_Groups_Member::check_is_member( $bp-&gt;loggedin_user-&gt;id, $this-&gt;id );
</del><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function populate_meta() {
-                if ( $this-&gt;id ) {
-                        $this-&gt;admins = $this-&gt;get_administrators();
-                        $this-&gt;random_members = $this-&gt;get_random_members();
-                }
-        }
-
</del><span class="cx">         function save() {
</span><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -133,43 +117,6 @@
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function get_user_dataset() {
-                global $wpdb, $bp;
-
-                return $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT user_id, is_admin, inviter_id, user_title, is_mod FROM {$bp-&gt;groups-&gt;table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand()&quot;, $this-&gt;id ) );
-        }
-
-        function get_administrators() {
-                for ( $i = 0; $i &lt; count($this-&gt;user_dataset); $i++ ) {
-                        if ( $this-&gt;user_dataset[$i]-&gt;is_admin )
-                                $admins[] = new BP_Groups_Member( $this-&gt;user_dataset[$i]-&gt;user_id, $this-&gt;id );
-                }
-
-                return $admins;
-        }
-
-        function get_random_members() {
-                $total_randoms = ( $this-&gt;total_member_count &gt; 5 ) ? 5 : $this-&gt;total_member_count;
-
-                for ( $i = 0; $i &lt; $total_randoms; $i++ ) {
-                        if ( !(int)$this-&gt;user_dataset[$i]-&gt;is_banned )
-                                $users[] = new BP_Groups_Member( $this-&gt;user_dataset[$i]-&gt;user_id, $this-&gt;id );
-                }
-                return $users;
-        }
-
-        function is_member() {
-                global $bp;
-
-                for ( $i = 0; $i &lt; count($this-&gt;user_dataset); $i++ ) {
-                        if ( $this-&gt;user_dataset[$i]-&gt;user_id == $bp-&gt;loggedin_user-&gt;id ) {
-                                return true;
-                        }
-                }
-
-                return false;
-        }
-
</del><span class="cx">         function delete() {
</span><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsnotificationsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-notifications.php (2536 => 2537)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-notifications.php        2010-02-02 15:31:49 UTC (rev 2536)
+++ trunk/bp-groups/bp-groups-notifications.php        2010-02-02 16:53:40 UTC (rev 2537)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> function groups_notification_group_updated( $group_id ) {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        $group = new BP_Groups_Group( $group_id, false, true );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">         $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
</span><span class="cx"> 
</span><span class="cx">         foreach ( $group-&gt;user_dataset as $user ) {
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">         $ud = bp_core_get_core_userdata($admin_id);
</span><span class="cx">         $requesting_ud = bp_core_get_core_userdata($requesting_user_id);
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">         if ( 'no' == get_usermeta( $requesting_user_id, 'notification_membership_request_completed' ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">         $ud = bp_core_get_core_userdata($requesting_user_id);
</span><span class="cx"> 
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">         if ( 'no' == get_usermeta( $user_id, 'notification_groups_admin_promotion' ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">         $ud = bp_core_get_core_userdata($user_id);
</span><span class="cx"> 
</span><span class="cx">         $group_link = bp_get_group_permalink( $group );
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">         if ( !$usernames = array_unique( $usernames[1] ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">         foreach( (array)$usernames as $username ) {
</span><span class="cx">                 if ( !$receiver_user_id = bp_core_get_userid($username) )
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (2536 => 2537)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2010-02-02 15:31:49 UTC (rev 2536)
+++ trunk/bp-groups/bp-groups-templatetags.php        2010-02-02 16:53:40 UTC (rev 2537)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx">                 $this-&gt;group = $this-&gt;next_group();
</span><span class="cx"> 
</span><span class="cx">                 if ( $this-&gt;single_group )
</span><del>-                        $this-&gt;group = new BP_Groups_Group( $this-&gt;group-&gt;group_id, true, true );
</del><ins>+                        $this-&gt;group = new BP_Groups_Group( $this-&gt;group-&gt;group_id, true );
</ins><span class="cx">                 else {
</span><span class="cx">                         if ( $this-&gt;group )
</span><span class="cx">                                 wp_cache_set( 'groups_group_nouserdata_' . $group-&gt;group_id, $this-&gt;group, 'bp' );
</span><span class="lines">@@ -531,68 +531,43 @@
</span><span class="cx">         return $bp-&gt;is_item_mod;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function bp_group_list_admins( $full_list = true, $group = false ) {
</del><ins>+function bp_group_list_admins( $deprecated = true, $group = false ) {
</ins><span class="cx">         global $groups_template;
</span><span class="cx"> 
</span><span class="cx">         if ( !$group )
</span><span class="cx">                 $group =&amp; $groups_template-&gt;group;
</span><span class="cx"> 
</span><del>-        if ( !$admins = &amp;$group-&gt;admins )
-                $admins = $group-&gt;get_administrators();
-
-        if ( $admins ) {
-                if ( $full_list ) { ?&gt;
-                        &lt;ul id=&quot;group-admins&quot;&gt;
-                        &lt;?php for ( $i = 0; $i &lt; count($admins); $i++ ) { ?&gt;
</del><ins>+        if ( $group-&gt;admins ) { ?&gt;
+                &lt;ul id=&quot;group-admins&quot;&gt;
+                        &lt;?php foreach( (array)$group-&gt;admins as $admin ) { ?&gt;
</ins><span class="cx">                                 &lt;li&gt;
</span><del>-                                        &lt;a href=&quot;&lt;?php echo $admins[$i]-&gt;user-&gt;user_url ?&gt;&quot; title=&quot;&lt;?php echo $admins[$i]-&gt;user-&gt;fullname ?&gt;&quot;&gt;&lt;?php echo $admins[$i]-&gt;user-&gt;avatar_mini ?&gt;&lt;/a&gt;
-                                        &lt;h5&gt;&lt;?php echo $admins[$i]-&gt;user-&gt;user_link ?&gt;&lt;/h5&gt;
-                                        &lt;span class=&quot;activity&quot;&gt;&lt;?php echo $admins[$i]-&gt;user_title ?&gt;&lt;/span&gt;
-                                        &lt;hr /&gt;
</del><ins>+                                        &lt;a href=&quot;&lt;?php echo bp_core_get_user_domain( $admin-&gt;user_id, $admin-&gt;user_nicename, $admin-&gt;user_login ) ?&gt;&quot;&gt;&lt;?php echo bp_core_fetch_avatar( array( 'item_id' =&gt; $admin-&gt;user_id, 'email' =&gt; $admin-&gt;user_email ) ) ?&gt;&lt;/a&gt;
</ins><span class="cx">                                 &lt;/li&gt;
</span><span class="cx">                         &lt;?php } ?&gt;
</span><del>-                        &lt;/ul&gt;
-                &lt;?php } else { ?&gt;
-                        &lt;?php for ( $i = 0; $i &lt; count($admins); $i++ ) { ?&gt;
-                                &lt;?php echo $admins[$i]-&gt;user-&gt;user_link ?&gt;
-                        &lt;?php } ?&gt;
-                &lt;?php } ?&gt;
</del><ins>+                &lt;/ul&gt;
</ins><span class="cx">         &lt;?php } else { ?&gt;
</span><span class="cx">                 &lt;span class=&quot;activity&quot;&gt;&lt;?php _e( 'No Admins', 'buddypress' ) ?&gt;&lt;/span&gt;
</span><span class="cx">         &lt;?php } ?&gt;
</span><del>-
</del><span class="cx"> &lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function bp_group_list_mods( $full_list = true, $group = false ) {
</del><ins>+function bp_group_list_mods( $deprecated = true, $group = false ) {
</ins><span class="cx">         global $groups_template;
</span><span class="cx"> 
</span><span class="cx">         if ( !$group )
</span><span class="cx">                 $group =&amp; $groups_template-&gt;group;
</span><span class="cx"> 
</span><del>-        $group_mods = groups_get_group_mods( $group-&gt;id );
-
-        if ( $group_mods ) {
-                if ( $full_list ) { ?&gt;
-                        &lt;ul id=&quot;group-mods&quot; class=&quot;mods-list&quot;&gt;
-                        &lt;?php for ( $i = 0; $i &lt; count($group_mods); $i++ ) { ?&gt;
</del><ins>+        if ( $group-&gt;mods ) { ?&gt;
+                &lt;ul id=&quot;group-mods&quot;&gt;
+                        &lt;?php foreach( (array)$group-&gt;mods as $mod ) { ?&gt;
</ins><span class="cx">                                 &lt;li&gt;
</span><del>-                                        &lt;a href=&quot;&lt;?php echo bp_core_get_userlink( $group_mods[$i]-&gt;user_id, false, true ) ?&gt;&quot; title=&quot;&lt;?php echo bp_core_get_user_displayname( $group_mods[$i]-&gt;user-&gt;user_id ) ?&gt;&quot;&gt;&lt;?php echo bp_core_fetch_avatar( array( 'item_id' =&gt; $group_mods[$i]-&gt;user_id, 'type' =&gt; 'thumb', 'width' =&gt; 30, 'height' =&gt; 30 ) ) ?&gt;&lt;/a&gt;
-                                        &lt;h5&gt;&lt;?php echo bp_core_get_userlink( $group_mods[$i]-&gt;user_id ) ?&gt;&lt;/h5&gt;
-                                        &lt;span class=&quot;activity&quot;&gt;&lt;?php _e( 'Group Mod', 'buddypress' ) ?&gt;&lt;/span&gt;
-                                        &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</del><ins>+                                        &lt;a href=&quot;&lt;?php echo bp_core_get_user_domain( $mod-&gt;user_id, $mod-&gt;user_nicename, $mod-&gt;user_login ) ?&gt;&quot;&gt;&lt;?php echo bp_core_fetch_avatar( array( 'item_id' =&gt; $mod-&gt;user_id, 'email' =&gt; $mod-&gt;user_email ) ) ?&gt;&lt;/a&gt;
</ins><span class="cx">                                 &lt;/li&gt;
</span><span class="cx">                         &lt;?php } ?&gt;
</span><del>-                        &lt;/ul&gt;
-                &lt;?php } else { ?&gt;
-                        &lt;?php for ( $i = 0; $i &lt; count($group_mods); $i++ ) { ?&gt;
-                                &lt;?php echo bp_core_get_userlink( $group_mods[$i]-&gt;user_id ) . ' ' ?&gt;
-                        &lt;?php } ?&gt;
-                &lt;?php } ?&gt;
</del><ins>+                &lt;/ul&gt;
</ins><span class="cx">         &lt;?php } else { ?&gt;
</span><span class="cx">                 &lt;span class=&quot;activity&quot;&gt;&lt;?php _e( 'No Mods', 'buddypress' ) ?&gt;&lt;/span&gt;
</span><span class="cx">         &lt;?php } ?&gt;
</span><del>-
</del><span class="cx"> &lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2536 => 2537)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-02-02 15:31:49 UTC (rev 2536)
+++ trunk/bp-groups.php        2010-02-02 16:53:40 UTC (rev 2537)
</span><span class="lines">@@ -297,7 +297,7 @@
</span><span class="cx">                         bp_core_add_message( __('Group invite accepted', 'buddypress') );
</span><span class="cx"> 
</span><span class="cx">                         /* Record this in activity streams */
</span><del>-                        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">                         groups_record_activity( array(
</span><span class="cx">                                 'action' =&gt; apply_filters( 'groups_activity_accepted_invite_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $bp-&gt;loggedin_user-&gt;id ), '&lt;a href=&quot;' . bp_get_group_permalink( $group ) . '&quot;&gt;' . attribute_escape( $group-&gt;name ) . '&lt;/a&gt;' ), $bp-&gt;loggedin_user-&gt;id, &amp;$group ),
</span><span class="lines">@@ -1079,7 +1079,7 @@
</span><span class="cx">         /* Set the ID of the new group, if it has already been created in a previous step */
</span><span class="cx">         if ( isset( $_COOKIE['bp_new_group_id'] ) ) {
</span><span class="cx">                 $bp-&gt;groups-&gt;new_group_id = $_COOKIE['bp_new_group_id'];
</span><del>-                $bp-&gt;groups-&gt;current_group = new BP_Groups_Group( $bp-&gt;groups-&gt;new_group_id, false, false );
</del><ins>+                $bp-&gt;groups-&gt;current_group = new BP_Groups_Group( $bp-&gt;groups-&gt;new_group_id );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /* If the save, upload or skip button is hit, lets calculate what we need to save */
</span><span class="lines">@@ -1357,7 +1357,7 @@
</span><span class="cx">                         $group_id = $secondary_item_id;
</span><span class="cx">                         $requesting_user_id = $item_id;
</span><span class="cx"> 
</span><del>-                        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx"> 
</span><span class="lines">@@ -1372,7 +1372,7 @@
</span><span class="cx">                 case 'membership_request_accepted':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx"> 
</span><del>-                        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx"> 
</span><span class="cx">                         if ( (int)$total_items &gt; 1 ) {
</span><span class="lines">@@ -1385,7 +1385,7 @@
</span><span class="cx">                 case 'membership_request_rejected':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx"> 
</span><del>-                        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx"> 
</span><span class="cx">                         if ( (int)$total_items &gt; 1 ) {
</span><span class="lines">@@ -1399,7 +1399,7 @@
</span><span class="cx">                 case 'member_promoted_to_admin':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx"> 
</span><del>-                        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx"> 
</span><span class="cx">                         if ( (int)$total_items &gt; 1 ) {
</span><span class="lines">@@ -1412,7 +1412,7 @@
</span><span class="cx">                 case 'member_promoted_to_mod':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx"> 
</span><del>-                        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx"> 
</span><span class="cx">                         if ( (int)$total_items &gt; 1 ) {
</span><span class="lines">@@ -1425,7 +1425,7 @@
</span><span class="cx">                 case 'group_invite':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx"> 
</span><del>-                        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">                         $user_url = bp_core_get_user_domain( $user_id );
</span><span class="cx"> 
</span><span class="cx">                         if ( (int)$total_items &gt; 1 ) {
</span><span class="lines">@@ -1541,7 +1541,7 @@
</span><span class="cx">         if ( empty( $group_name ) || empty( $group_desc ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">         $group-&gt;name = $group_name;
</span><span class="cx">         $group-&gt;description = $group_desc;
</span><span class="cx"> 
</span><span class="lines">@@ -1561,7 +1561,7 @@
</span><span class="cx"> function groups_edit_group_settings( $group_id, $enable_forum, $enable_photos, $photos_admin_only, $status ) {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">         $group-&gt;enable_forum = $enable_forum;
</span><span class="cx">         $group-&gt;enable_photos = $enable_photos;
</span><span class="cx">         $group-&gt;photos_admin_only = $photos_admin_only;
</span><span class="lines">@@ -1647,7 +1647,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function groups_get_slug( $group_id ) {
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx">         return $group-&gt;slug;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1690,7 +1690,7 @@
</span><span class="cx">                 return true;
</span><span class="cx"> 
</span><span class="cx">         if ( !$bp-&gt;groups-&gt;current_group )
</span><del>-                $bp-&gt;groups-&gt;current_group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                $bp-&gt;groups-&gt;current_group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">         $new_member = new BP_Groups_Member;
</span><span class="cx">         $new_member-&gt;group_id = $group_id;
</span><span class="lines">@@ -2226,7 +2226,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Send friend invites.
</span><span class="cx">         $invited_users = groups_get_invites_for_group( $user_id, $group_id );
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">         for ( $i = 0; $i &lt; count( $invited_users ); $i++ ) {
</span><span class="cx">                 $member = new BP_Groups_Member( $invited_users[$i], $group_id );
</span><span class="lines">@@ -2362,7 +2362,7 @@
</span><span class="cx">         groups_update_groupmeta( $membership-&gt;group_id, 'total_member_count', (int) groups_get_groupmeta( $membership-&gt;group_id, 'total_member_count') + 1 );
</span><span class="cx"> 
</span><span class="cx">         /* Record this in activity streams */
</span><del>-        $group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">         groups_record_activity( array(
</span><span class="cx">                 'action' =&gt; apply_filters( 'groups_activity_membership_accepted_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '&lt;a href=&quot;' . bp_get_group_permalink( $group ) . '&quot;&gt;' . attribute_escape( $group-&gt;name ) . '&lt;/a&gt;' ), $user_id, &amp;$group ),
</span></span></pre>
</div>
</div>

</body>
</html>