<!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->id = $id;
</span><del>-                        $this->populate( $get_user_dataset );
</del><ins>+                        $this->populate();
</ins><span class="cx">                 }
</span><del>-
-                if ( $single ) {
-                        $this->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->prepare( "SELECT * FROM {$bp->groups->table_name} WHERE id = %d", $this->id );
-                $group = $wpdb->get_row($sql);
-
-                if ( $group ) {
</del><ins>+                if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.*, gm.meta_value as last_activity, gm2.meta_value as total_member_count FROM {$bp->groups->table_name} g, {$bp->groups->table_name_groupmeta} gm, {$bp->groups->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", $this->id ) ) ) {
</ins><span class="cx">                         $this->id = $group->id;
</span><span class="cx">                         $this->creator_id = $group->creator_id;
</span><span class="cx">                         $this->name = stripslashes($group->name);
</span><span class="lines">@@ -42,27 +32,21 @@
</span><span class="cx">                         $this->status = $group->status;
</span><span class="cx">                         $this->enable_forum = $group->enable_forum;
</span><span class="cx">                         $this->date_created = $group->date_created;
</span><del>-                        $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
</del><ins>+                        $this->last_activity = $group->last_activity;
+                        $this->total_member_count = $group->total_member_count;
+                        $this->is_member = BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $this->id );
</ins><span class="cx">
</span><del>-                        if ( $get_user_dataset ) {
-                                $this->user_dataset = $this->get_user_dataset();
-
-                                $this->total_member_count = count( $this->user_dataset );
-                                groups_update_groupmeta( $this->id, 'total_member_count', $this->total_member_count );
</del><ins>+                        /* Get group admins and mods */
+                        $admin_mods = $wpdb->get_results( $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb->users} u, {$bp->groups->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 )", $this->id ) );
+                        foreach( (array)$admin_mods as $user ) {
+                                if ( (int)$user->is_admin )
+                                        $this->admins[] = $user;
+                                else
+                                        $this->mods[] = $user;
</ins><span class="cx">                         }
</span><del>-
-                        /* Get group extras */
-                        $this->is_member = BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $this->id );
</del><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        function populate_meta() {
-                if ( $this->id ) {
-                        $this->admins = $this->get_administrators();
-                        $this->random_members = $this->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->get_results( $wpdb->prepare( "SELECT user_id, is_admin, inviter_id, user_title, is_mod FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand()", $this->id ) );
-        }
-
-        function get_administrators() {
-                for ( $i = 0; $i < count($this->user_dataset); $i++ ) {
-                        if ( $this->user_dataset[$i]->is_admin )
-                                $admins[] = new BP_Groups_Member( $this->user_dataset[$i]->user_id, $this->id );
-                }
-
-                return $admins;
-        }
-
-        function get_random_members() {
-                $total_randoms = ( $this->total_member_count > 5 ) ? 5 : $this->total_member_count;
-
-                for ( $i = 0; $i < $total_randoms; $i++ ) {
-                        if ( !(int)$this->user_dataset[$i]->is_banned )
-                                $users[] = new BP_Groups_Member( $this->user_dataset[$i]->user_id, $this->id );
-                }
-                return $users;
-        }
-
-        function is_member() {
-                global $bp;
-
-                for ( $i = 0; $i < count($this->user_dataset); $i++ ) {
-                        if ( $this->user_dataset[$i]->user_id == $bp->loggedin_user->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->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->group = $this->next_group();
</span><span class="cx">
</span><span class="cx">                 if ( $this->single_group )
</span><del>-                        $this->group = new BP_Groups_Group( $this->group->group_id, true, true );
</del><ins>+                        $this->group = new BP_Groups_Group( $this->group->group_id, true );
</ins><span class="cx">                 else {
</span><span class="cx">                         if ( $this->group )
</span><span class="cx">                                 wp_cache_set( 'groups_group_nouserdata_' . $group->group_id, $this->group, 'bp' );
</span><span class="lines">@@ -531,68 +531,43 @@
</span><span class="cx">         return $bp->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 =& $groups_template->group;
</span><span class="cx">
</span><del>-        if ( !$admins = &$group->admins )
-                $admins = $group->get_administrators();
-
-        if ( $admins ) {
-                if ( $full_list ) { ?>
-                        <ul id="group-admins">
-                        <?php for ( $i = 0; $i < count($admins); $i++ ) { ?>
</del><ins>+        if ( $group->admins ) { ?>
+                <ul id="group-admins">
+                        <?php foreach( (array)$group->admins as $admin ) { ?>
</ins><span class="cx">                                 <li>
</span><del>-                                        <a href="<?php echo $admins[$i]->user->user_url ?>" title="<?php echo $admins[$i]->user->fullname ?>"><?php echo $admins[$i]->user->avatar_mini ?></a>
-                                        <h5><?php echo $admins[$i]->user->user_link ?></h5>
-                                        <span class="activity"><?php echo $admins[$i]->user_title ?></span>
-                                        <hr />
</del><ins>+                                        <a href="<?php echo bp_core_get_user_domain( $admin->user_id, $admin->user_nicename, $admin->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'email' => $admin->user_email ) ) ?></a>
</ins><span class="cx">                                 </li>
</span><span class="cx">                         <?php } ?>
</span><del>-                        </ul>
-                <?php } else { ?>
-                        <?php for ( $i = 0; $i < count($admins); $i++ ) { ?>
-                                <?php echo $admins[$i]->user->user_link ?>
-                        <?php } ?>
-                <?php } ?>
</del><ins>+                </ul>
</ins><span class="cx">         <?php } else { ?>
</span><span class="cx">                 <span class="activity"><?php _e( 'No Admins', 'buddypress' ) ?></span>
</span><span class="cx">         <?php } ?>
</span><del>-
</del><span class="cx"> <?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 =& $groups_template->group;
</span><span class="cx">
</span><del>-        $group_mods = groups_get_group_mods( $group->id );
-
-        if ( $group_mods ) {
-                if ( $full_list ) { ?>
-                        <ul id="group-mods" class="mods-list">
-                        <?php for ( $i = 0; $i < count($group_mods); $i++ ) { ?>
</del><ins>+        if ( $group->mods ) { ?>
+                <ul id="group-mods">
+                        <?php foreach( (array)$group->mods as $mod ) { ?>
</ins><span class="cx">                                 <li>
</span><del>-                                        <a href="<?php echo bp_core_get_userlink( $group_mods[$i]->user_id, false, true ) ?>" title="<?php echo bp_core_get_user_displayname( $group_mods[$i]->user->user_id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $group_mods[$i]->user_id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) ) ?></a>
-                                        <h5><?php echo bp_core_get_userlink( $group_mods[$i]->user_id ) ?></h5>
-                                        <span class="activity"><?php _e( 'Group Mod', 'buddypress' ) ?></span>
-                                        <div class="clear"></div>
</del><ins>+                                        <a href="<?php echo bp_core_get_user_domain( $mod->user_id, $mod->user_nicename, $mod->user_login ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'email' => $mod->user_email ) ) ?></a>
</ins><span class="cx">                                 </li>
</span><span class="cx">                         <?php } ?>
</span><del>-                        </ul>
-                <?php } else { ?>
-                        <?php for ( $i = 0; $i < count($group_mods); $i++ ) { ?>
-                                <?php echo bp_core_get_userlink( $group_mods[$i]->user_id ) . ' ' ?>
-                        <?php } ?>
-                <?php } ?>
</del><ins>+                </ul>
</ins><span class="cx">         <?php } else { ?>
</span><span class="cx">                 <span class="activity"><?php _e( 'No Mods', 'buddypress' ) ?></span>
</span><span class="cx">         <?php } ?>
</span><del>-
</del><span class="cx"> <?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' => apply_filters( 'groups_activity_accepted_invite_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $bp->loggedin_user->id, &$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->groups->new_group_id = $_COOKIE['bp_new_group_id'];
</span><del>-                $bp->groups->current_group = new BP_Groups_Group( $bp->groups->new_group_id, false, false );
</del><ins>+                $bp->groups->current_group = new BP_Groups_Group( $bp->groups->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 > 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 > 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 > 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 > 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 > 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->name = $group_name;
</span><span class="cx">         $group->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->enable_forum = $enable_forum;
</span><span class="cx">         $group->enable_photos = $enable_photos;
</span><span class="cx">         $group->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->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->groups->current_group )
</span><del>-                $bp->groups->current_group = new BP_Groups_Group( $group_id, false, false );
</del><ins>+                $bp->groups->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->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 < 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->group_id, 'total_member_count', (int) groups_get_groupmeta( $membership->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' => apply_filters( 'groups_activity_membership_accepted_action', sprintf( __( '%s joined the group %s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . attribute_escape( $group->name ) . '</a>' ), $user_id, &$group ),
</span></span></pre>
</div>
</div>
</body>
</html>