<!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] [1718] trunk: Fixes #723</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>1718</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-08-27 21:18:10 +0000 (Thu, 27 Aug 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixes #723</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpblogsphp">trunk/bp-blogs.php</a></li>
<li><a href="#trunkbpcorebpcorecatchuriphp">trunk/bp-core/bp-core-catchuri.php</a></li>
<li><a href="#trunkbpcorebpcoresettingsphp">trunk/bp-core/bp-core-settings.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpcoredeprecatedbpcoredeprecatedphp">trunk/bp-core/deprecated/bp-core-deprecated.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
<li><a href="#trunkbpforumsphp">trunk/bp-forums.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpmessagesphp">trunk/bp-messages.php</a></li>
<li><a href="#trunkbpstatusphp">trunk/bp-status.php</a></li>
<li><a href="#trunkbpwirebpwiretemplatetagsphp">trunk/bp-wire/bp-wire-templatetags.php</a></li>
<li><a href="#trunkbpwirephp">trunk/bp-wire.php</a></li>
<li><a href="#trunkbpxprofilephp">trunk/bp-xprofile.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-activity.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -59,6 +59,9 @@
</span><span class="cx">         
</span><span class="cx">         $bp->activity->table_name = $wpdb->base_prefix . 'bp_activity_user_activity_cached';
</span><span class="cx">         $bp->activity->slug = BP_ACTIVITY_SLUG;
</span><ins>+        
+        /* Register this in the active components array */
+        $bp->active_components[$bp->activity->slug] = $bp->activity->id;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', 'bp_activity_setup_globals', 5 );
</span><span class="cx"> add_action( 'admin_menu', 'bp_activity_setup_globals', 2 );
</span><span class="lines">@@ -81,7 +84,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><span class="cx">         /* Add 'Activity' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => __( 'Activity', 'buddypress' ), 'slug' => $bp->activity->slug, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __( 'Activity', 'buddypress' ), 'slug' => $bp->activity->slug, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me', 'item_css_id' => $bp->activity->id ) );
</ins><span class="cx">
</span><span class="cx">         $activity_link = $bp->loggedin_user->domain . $bp->activity->slug . '/';
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-blogs.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -116,6 +116,9 @@
</span><span class="cx">         $bp->blogs->table_name_blogmeta = $wpdb->base_prefix . 'bp_user_blogs_blogmeta';
</span><span class="cx">         $bp->blogs->format_notification_function = 'bp_blogs_format_notifications';
</span><span class="cx">         $bp->blogs->slug = BP_BLOGS_SLUG;
</span><ins>+
+        /* Register this in the active components array */
+        $bp->active_components[$bp->blogs->slug] = $bp->blogs->id;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', 'bp_blogs_setup_globals', 5 );        
</span><span class="cx"> add_action( 'admin_menu', 'bp_blogs_setup_globals', 1 );
</span><span class="lines">@@ -139,7 +142,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><span class="cx">         /* Add 'Blogs' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => __( 'Blogs', 'buddypress' ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __( 'Blogs', 'buddypress' ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs', 'item_css_id' => $bp->blogs->id ) );
</ins><span class="cx">         
</span><span class="cx">         $blogs_link = $bp->loggedin_user->domain . $bp->blogs->slug . '/';
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkbpcorebpcorecatchuriphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-catchuri.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-catchuri.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-core/bp-core-catchuri.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -114,9 +114,10 @@
</span><span class="cx">                         $is_new_friend = 1;
</span><span class="cx">                         unset($bp_uri[2]);
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 /* Reset the keys by merging with an empty array */
</span><span class="cx">                 $bp_uri = array_merge( array(), $bp_uri );
</span><ins>+
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if ( !isset($is_root_component) )
</span></span></pre></div>
<a id="trunkbpcorebpcoresettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-settings.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-settings.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-core/bp-core-settings.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -1,17 +1,28 @@
</span><span class="cx"> <?php
</span><ins>+
+if ( !defined( 'BP_SETTINGS_SLUG' ) )
+        define( 'BP_SETTINGS_SLUG', 'settings' );
+        
</ins><span class="cx"> function bp_core_add_settings_nav() {
</span><span class="cx">         global $bp;
</span><ins>+        
+        /* Set up settings as a sudo-component for identification and nav selection */
+        $bp->settings->id = 'settings';
+        $bp->settings->slug = BP_SETTINGS_SLUG;
+        
+        /* Register this in the active components array */
+        $bp->active_components[$bp->settings->slug] = $bp->settings->id;
</ins><span class="cx">
</span><span class="cx">         /* Add the settings navigation item */
</span><del>-        bp_core_new_nav_item( array( 'name' => __('Settings', 'buddypress'), 'slug' => 'settings', 'position' => 100, 'show_for_displayed_user' => false, 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __('Settings', 'buddypress'), 'slug' => $bp->settings->slug, 'position' => 100, 'show_for_displayed_user' => false, 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) );
</ins><span class="cx">
</span><span class="cx">         $settings_link = $bp->loggedin_user->domain . 'settings/';
</span><span class="cx">         
</span><del>-        bp_core_new_subnav_item( array( 'name' => __( 'General', 'buddypress' ), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => 'settings', 'screen_function' => 'bp_core_screen_general_settings', 'position' => 10, 'user_has_access' => bp_is_home() ) );
-        bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => 'settings', 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_is_home() ) );
</del><ins>+        bp_core_new_subnav_item( array( 'name' => __( 'General', 'buddypress' ), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_general_settings', 'position' => 10, 'user_has_access' => bp_is_home() ) );
+        bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_is_home() ) );
</ins><span class="cx">         
</span><span class="cx">         if ( !is_site_admin() )
</span><del>-                bp_core_new_subnav_item( array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => 'settings', 'screen_function' => 'bp_core_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_home() ) );
</del><ins>+                bp_core_new_subnav_item( array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_delete_account', 'position' => 90, 'user_has_access' => bp_is_home() ) );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wp', 'bp_core_add_settings_nav', 2 );
</span><span class="cx"> add_action( 'admin_menu', 'bp_core_add_settings_nav', 2 );
</span><span class="lines">@@ -29,16 +40,14 @@
</span><span class="cx">                 
</span><span class="cx">                 // Form has been submitted and nonce checks out, lets do it.
</span><span class="cx">                 
</span><del>-                if ( $_POST['email'] != '' ) {
-                        $current_user->user_email = wp_specialchars( trim( $_POST['email'] ));
-                }
</del><ins>+                if ( $_POST['email'] != '' )
+                        $current_user->user_email = wp_specialchars( trim( $_POST['email'] ) );
</ins><span class="cx">
</span><span class="cx">                 if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) {
</span><del>-                        if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) {
</del><ins>+                        if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) )
</ins><span class="cx">                                 $current_user->user_pass = $_POST['pass1'];
</span><del>-                        } else {
</del><ins>+                        else
</ins><span class="cx">                                 $pass_error = true;
</span><del>-                        }
</del><span class="cx">                 } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {
</span><span class="cx">                         $pass_error = true;
</span><span class="cx">                 } else {
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-core/bp-core-templatetags.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx">         /* Loop through each navigation item */
</span><span class="cx">         foreach( (array) $bp->bp_nav as $nav_item ) {
</span><span class="cx">                 /* If the current component matches the nav item id, then add a highlight CSS class. */
</span><del>-                if ( $bp->current_component == $nav_item['css_id'] ) {
</del><ins>+                if ( $bp->active_components[$bp->current_component] == $nav_item['css_id'] ) {
</ins><span class="cx">                         $selected = ' class="current"';
</span><span class="cx">                 } else {
</span><span class="cx">                         $selected = '';
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">                         $selected = '';
</span><span class="cx">                         
</span><span class="cx">                         if ( function_exists('friends_install') ) {
</span><del>-                                if ( $nav_item['css_id'] == $bp->friends->slug ) {
</del><ins>+                                if ( $nav_item['css_id'] == $bp->friends->id ) {
</ins><span class="cx">                                         if ( friends_check_friendship( $bp->loggedin_user->id, $bp->displayed_user->id ) )
</span><span class="cx">                                                 $selected = ' class="current"';
</span><span class="cx">                                 }
</span></span></pre></div>
<a id="trunkbpcoredeprecatedbpcoredeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/deprecated/bp-core-deprecated.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/deprecated/bp-core-deprecated.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-core/deprecated/bp-core-deprecated.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -939,3 +939,23 @@
</span><span class="cx">         <?php endif;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/* DEPRECATED - use the param 'default_subnav_slug' in bp_core_new_nav_item() */
+function bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false ) {
+        global $bp;
+        
+        if ( !$user_has_access && !bp_is_home() )
+                return false;
+                
+        if ( $admin_only && !is_site_admin() )
+                return false;
+
+        if ( $bp->current_component == $parent_id && !$bp->current_action ) {
+                if ( function_exists($function) ) {
+                        add_action( 'wp', $function, 3 );
+                }
+                
+                if ( $slug )
+                        $bp->current_action = $slug;
+        }
+}
+
</ins></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-core.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -136,6 +136,9 @@
</span><span class="cx">         /* Sets up container used for the avatar of the current component being viewed. Rendered by bp_get_options_avatar() */
</span><span class="cx">         $bp->bp_options_avatar = '';
</span><span class="cx">         
</span><ins>+        /* Contains an array of all the active components. The key is the slug, value the internal ID of the component */
+        $bp->active_components = array();
+        
</ins><span class="cx">         /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
</span><span class="cx">         $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', get_site_option( 'user-avatar-default' ) );
</span><span class="cx">         $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
</span><span class="lines">@@ -552,9 +555,9 @@
</span><span class="cx">                 'parent_slug' => false, // URL slug of the parent nav item
</span><span class="cx">                 'parent_url' => false, // URL of the parent item
</span><span class="cx">                 'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item
</span><del>-                'user_has_access' => true, // Can the user see this nav item?
</del><ins>+                'user_has_access' => true, // Can the logged in user see this nav item?
</ins><span class="cx">                 'site_admin_only' => false, // Can only site admins see this nav item?
</span><del>-                'position' => 90, // Index of where should this nav item be positioned
</del><ins>+                'position' => 90, // Index of where this nav item should be positioned
</ins><span class="cx">                 'screen_function' => false // The name of the function to run when clicked
</span><span class="cx">         );
</span><span class="cx">         
</span><span class="lines">@@ -578,7 +581,7 @@
</span><span class="cx">                 'slug' => $slug,
</span><span class="cx">                 'css_id' => $item_css_id,
</span><span class="cx">                 'position' => $position
</span><del>-        );        
</del><ins>+        );
</ins><span class="cx">                 
</span><span class="cx">         if ( $bp->current_action == $slug && $bp->current_component == $parent_slug && $user_has_access ) {
</span><span class="cx">                 if ( !is_object($screen_function[0]) )
</span><span class="lines">@@ -648,38 +651,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * bp_core_add_nav_default()
- *
- * Set a default action for a nav item, when a sub nav item has not yet been selected.
- *
- * @package BuddyPress Core
- * @param $parent_id The id of the parent navigation item.
- * @param $function The function to run when this sub nav item is selected.
- * @param $slug The slug of the sub nav item to highlight.
- * @uses is_site_admin() returns true if the current user is a site admin, false if not
- * @uses bp_is_home() Returns true if the current user being viewed is equal the logged in user
- * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
- */
-function bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false ) {
-        global $bp;
-        
-        if ( !$user_has_access && !bp_is_home() )
-                return false;
-                
-        if ( $admin_only && !is_site_admin() )
-                return false;
-
-        if ( $bp->current_component == $parent_id && !$bp->current_action ) {
-                if ( function_exists($function) ) {
-                        add_action( 'wp', $function, 3 );
-                }
-                
-                if ( $slug )
-                        $bp->current_action = $slug;
-        }
-}
-
-/**
</del><span class="cx"> * bp_core_load_template()
</span><span class="cx"> *
</span><span class="cx"> * Uses the bp_catch_uri function to load a specific template file with fallback support.
</span></span></pre></div>
<a id="trunkbpforumsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-forums.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -2,7 +2,10 @@
</span><span class="cx">
</span><span class="cx"> /* Define the parent forum ID */
</span><span class="cx"> if ( !defined( 'BP_FORUMS_PARENT_FORUM_ID' ) )
</span><del>-        define ( 'BP_FORUMS_PARENT_FORUM_ID', 1 );
</del><ins>+        define( 'BP_FORUMS_PARENT_FORUM_ID', 1 );
+        
+if ( !defined( 'BP_FORUMS_SLUG' ) )
+        define( 'BP_FORUMS_SLUG', 'forums' );
</ins><span class="cx">
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-bbpress.php' );
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-classes.php' );
</span><span class="lines">@@ -17,6 +20,10 @@
</span><span class="cx">                 
</span><span class="cx">         $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
</span><span class="cx">         $bp->forums->bbconfig = get_site_option( 'bb-config-location' );
</span><ins>+        $bp->forums->slug = BP_FORUMS_SLUG;
+
+        /* Register this in the active components array */
+        $bp->active_components[$bp->forums->slug] = $bp->forums->id;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', 'bp_forums_setup', 5 );
</span><span class="cx"> add_action( 'admin_head', 'bp_forums_setup', 3 );
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-friends.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -47,6 +47,8 @@
</span><span class="cx">         $bp->friends->format_notification_function = 'friends_format_notifications';
</span><span class="cx">         $bp->friends->slug = BP_FRIENDS_SLUG;
</span><span class="cx">
</span><ins>+        /* Register this in the active components array */
+        $bp->active_components[$bp->friends->slug] = $bp->friends->id;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', 'friends_setup_globals', 5 );        
</span><span class="cx"> add_action( 'admin_menu', 'friends_setup_globals', 1 );
</span><span class="lines">@@ -67,7 +69,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><span class="cx">         /* Add 'Friends' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => __('Friends', 'buddypress'), 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __('Friends', 'buddypress'), 'slug' => $bp->friends->slug, 'position' => 60, 'screen_function' => 'friends_screen_my_friends', 'default_subnav_slug' => 'my-friends', 'item_css_id' => $bp->friends->id ) );
</ins><span class="cx">         
</span><span class="cx">         $friends_link = $bp->loggedin_user->domain . $bp->friends->slug . '/';
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-groups/bp-groups-classes.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -11,10 +11,7 @@
</span><span class="cx">         var $enable_wire;
</span><span class="cx">         var $enable_forum;
</span><span class="cx">         var $date_created;
</span><del>-        
-        var $avatar_thumb;
-        var $avatar_full;
-        
</del><ins>+
</ins><span class="cx">         var $user_dataset;
</span><span class="cx">         
</span><span class="cx">         var $admins;
</span><span class="lines">@@ -51,19 +48,7 @@
</span><span class="cx">                         $this->enable_forum = $group->enable_forum;
</span><span class="cx">                         $this->date_created = strtotime($group->date_created);
</span><span class="cx">                         $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' );
</span><del>-
-                        $gravatar_url = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' );
</del><span class="cx">                         
</span><del>-                        if ( !$group->avatar_thumb || strpos( $group->avatar_thumb, 'none-thumbnail' ) )
-                                $this->avatar_thumb = $gravatar_url . md5( $this->id . '@' . $bp->root_domain ) . '?d=identicon&amp;s=50';
-                        else
-                                $this->avatar_thumb = $group->avatar_thumb;
-                        
-                        if ( !$group->avatar_full || strpos( $group->avatar_thumb, 'none-' ) )
-                                $this->avatar_full = $gravatar_url . md5( $this->id . '@' . $bp->root_domain ) . '?d=identicon&amp;s=150';
-                        else
-                                $this->avatar_full = $group->avatar_full;
-                        
</del><span class="cx">                         if ( $get_user_dataset ) {
</span><span class="cx">                                 $this->user_dataset = $this->get_user_dataset();
</span><span class="cx">                                 
</span><span class="lines">@@ -94,8 +79,6 @@
</span><span class="cx">                 $this->enable_wire = apply_filters( 'groups_group_enable_wire_before_save', $this->enable_wire, $this->id );
</span><span class="cx">                 $this->enable_forum = apply_filters( 'groups_group_enable_forum_before_save', $this->enable_forum, $this->id );
</span><span class="cx">                 $this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id );
</span><del>-                $this->avatar_thumb = apply_filters( 'groups_group_avatar_thumb_before_save', $this->avatar_thumb, $this->id );
-                $this->avatar_full = apply_filters( 'groups_group_avatar_full_before_save', $this->avatar_full, $this->id );
</del><span class="cx">
</span><span class="cx">                 do_action( 'groups_group_before_save', $this );
</span><span class="cx">                 
</span><span class="lines">@@ -110,9 +93,7 @@
</span><span class="cx">                                         status = %s,
</span><span class="cx">                                         enable_wire = %d,
</span><span class="cx">                                         enable_forum = %d,
</span><del>-                                        date_created = FROM_UNIXTIME(%d),
-                                        avatar_thumb = %s,
-                                        avatar_full = %s
</del><ins>+                                        date_created = FROM_UNIXTIME(%d)
</ins><span class="cx">                                 WHERE
</span><span class="cx">                                         id = %d
</span><span class="cx">                                 ",
</span><span class="lines">@@ -124,9 +105,7 @@
</span><span class="cx">                                         $this->status,
</span><span class="cx">                                         $this->enable_wire,
</span><span class="cx">                                         $this->enable_forum,
</span><del>-                                        $this->date_created,
-                                        $this->avatar_thumb,
-                                        $this->avatar_full,
</del><ins>+                                        $this->date_created,
</ins><span class="cx">                                         $this->id
</span><span class="cx">                         );
</span><span class="cx">                 } else {
</span><span class="lines">@@ -140,11 +119,9 @@
</span><span class="cx">                                         status,
</span><span class="cx">                                         enable_wire,
</span><span class="cx">                                         enable_forum,
</span><del>-                                        date_created,
-                                        avatar_thumb,
-                                        avatar_full
</del><ins>+                                        date_created
</ins><span class="cx">                                 ) VALUES (
</span><del>-                                        %d, %s, %s, %s, %s, %s, %d, %d, FROM_UNIXTIME(%d), %s, %s
</del><ins>+                                        %d, %s, %s, %s, %s, %s, %d, %d, FROM_UNIXTIME(%d)
</ins><span class="cx">                                 )",
</span><span class="cx">                                         $this->creator_id,
</span><span class="cx">                                         $this->name,
</span><span class="lines">@@ -154,9 +131,7 @@
</span><span class="cx">                                         $this->status,
</span><span class="cx">                                         $this->enable_wire,
</span><span class="cx">                                         $this->enable_forum,
</span><del>-                                        $this->date_created,
-                                        $this->avatar_thumb,
-                                        $this->avatar_full
</del><ins>+                                        $this->date_created
</ins><span class="cx">                         );
</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 (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-groups.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -130,7 +130,10 @@
</span><span class="cx">         $bp->groups->table_name_groupmeta = $wpdb->base_prefix . 'bp_groups_groupmeta';
</span><span class="cx">         $bp->groups->format_notification_function = 'groups_format_notifications';
</span><span class="cx">         $bp->groups->slug = BP_GROUPS_SLUG;
</span><del>-        
</del><ins>+
+        /* Register this in the active components array */
+        $bp->active_components[$bp->groups->slug] = $bp->groups->id;
+                
</ins><span class="cx">         if ( function_exists('bp_wire_install') )
</span><span class="cx">                 $bp->groups->table_name_wire = $wpdb->base_prefix . 'bp_groups_wire';
</span><span class="cx">         
</span><span class="lines">@@ -208,7 +211,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Add 'Groups' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => __('Groups', 'buddypress'), 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __('Groups', 'buddypress'), 'slug' => $bp->groups->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', 'default_subnav_slug' => 'my-groups', 'item_css_id' => $bp->groups->id ) );
</ins><span class="cx">         
</span><span class="cx">         $groups_link = $bp->loggedin_user->domain . $bp->groups->slug . '/';
</span><span class="cx">         
</span><span class="lines">@@ -276,7 +279,7 @@
</span><span class="cx">                                 bp_core_new_subnav_item( array( 'name' => __( 'Forum', 'buddypress' ), 'slug' => 'forum', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_forum', 'position' => 40, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-forum' ) );
</span><span class="cx">
</span><span class="cx">                         if ( $bp->groups->current_group->enable_wire && function_exists('bp_wire_install') )
</span><del>-                                bp_core_new_subnav_item( array( 'name' => __( 'Wire', 'buddypress' ), 'slug' => 'wire', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_wire', 'position' => 50, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-wire' ) );
</del><ins>+                                bp_core_new_subnav_item( array( 'name' => __( 'Wire', 'buddypress' ), 'slug' => BP_WIRE_SLUG, 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_wire', 'position' => 50, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-wire' ) );
</ins><span class="cx">
</span><span class="cx">                         bp_core_new_subnav_item( array( 'name' => __( 'Members', 'buddypress' ), 'slug' => 'members', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_members', 'position' => 60, 'user_has_access' => $bp->groups->current_group->user_has_access, 'item_css_id' => 'group-members' ) );
</span><span class="cx">                         
</span></span></pre></div>
<a id="trunkbpmessagesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-messages.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -84,6 +84,9 @@
</span><span class="cx">         $bp->messages->format_activity_function = 'messages_format_activity';
</span><span class="cx">         $bp->messages->format_notification_function = 'messages_format_notifications';
</span><span class="cx">         $bp->messages->slug = BP_MESSAGES_SLUG;
</span><ins>+
+        /* Register this in the active components array */
+        $bp->active_components[$bp->messages->slug] = $bp->messages->id;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', 'messages_setup_globals', 5 );        
</span><span class="cx"> add_action( 'admin_menu', 'messages_setup_globals', 1 );
</span><span class="lines">@@ -110,7 +113,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Add 'Messages' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => __('Messages', 'buddypress'), 'slug' => $bp->messages->slug, 'position' => 50, 'show_for_displayed_user' => false, 'screen_function' => 'messages_screen_inbox', 'default_subnav_slug' => 'inbox' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __('Messages', 'buddypress'), 'slug' => $bp->messages->slug, 'position' => 50, 'show_for_displayed_user' => false, 'screen_function' => 'messages_screen_inbox', 'default_subnav_slug' => 'inbox', 'item_css_id' => $bp->messages->id ) );
</ins><span class="cx">         
</span><span class="cx">         $messages_link = $bp->loggedin_user->domain . $bp->messages->slug . '/';
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkbpstatusphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-status.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-status.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-status.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -5,6 +5,19 @@
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-status/bp-status-templatetags.php' );
</span><span class="cx"> require ( BP_PLUGIN_DIR . '/bp-status/bp-status-filters.php' );
</span><span class="cx">
</span><ins>+function bp_status_setup_globals() {
+        global $bp, $wpdb;
+
+        /* For internal identification */
+        $bp->status->id = 'status';
+        $bp->status->slug = BP_STATUS_SLUG;
+
+        /* Register this in the active components array */
+        $bp->active_components[$bp->status->slug] = $bp->status->id;
+}
+add_action( 'plugins_loaded', 'bp_status_setup_globals', 5 );        
+add_action( 'admin_menu', 'bp_status_setup_globals', 1 );
+
</ins><span class="cx"> function bp_status_record_activity( $user_id, $content, $primary_link ) {
</span><span class="cx">         if ( !function_exists( 'bp_activity_add' ) )
</span><span class="cx">                 return false;
</span></span></pre></div>
<a id="trunkbpwirebpwiretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-wire/bp-wire-templatetags.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-wire/bp-wire-templatetags.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-wire/bp-wire-templatetags.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">                                 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, 'xprofile', 'new_wire_post' );
</span><span class="cx">                         
</span><span class="cx">                 } else {
</span><del>-                        $this->table_name = $bp->{$component_slug}->table_name_wire;
</del><ins>+                        $this->table_name = $bp->{$bp->active_components[$component_slug]}->table_name_wire;
</ins><span class="cx">                 }
</span><span class="cx">                 
</span><span class="cx">                 $this->pag_page = isset( $_REQUEST['wpage'] ) ? intval( $_REQUEST['wpage'] ) : 1;
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">                 if ( $this->current_wire_post + 1 < $this->wire_post_count ) {
</span><span class="cx">                         return true;
</span><span class="cx">                 } elseif ( $this->current_wire_post + 1 == $this->wire_post_count ) {
</span><del>-                        do_action('loop_end');
</del><ins>+                        do_action('bp_wire_loop_end');
</ins><span class="cx">                         // Do some cleaning up after the loop
</span><span class="cx">                         $this->rewind_wire_posts();
</span><span class="cx">                 }
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">                 $this->wire_post = $this->next_wire_post();
</span><span class="cx">
</span><span class="cx">                 if ( 0 == $this->current_wire_post ) // loop has just started
</span><del>-                        do_action('loop_start');
</del><ins>+                        do_action('bp_wire_loop_start');
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx">                 if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) {
</span><span class="cx">                         return apply_filters( 'bp_get_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' );
</span><span class="cx">                 } else {
</span><del>-                        return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->{$bp->current_component}->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' );
</del><ins>+                        return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->{$bp->active_components[$bp->current_component]}->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpwirephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-wire.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-wire.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-wire.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -23,6 +23,9 @@
</span><span class="cx">         $bp->wire->id = 'wire';
</span><span class="cx">         
</span><span class="cx">         $bp->wire->slug = BP_WIRE_SLUG;
</span><ins>+        
+        /* Register this in the active components array */
+        $bp->active_components[$bp->wire->slug] = $bp->wire->id;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', 'bp_wire_setup_globals', 5 );        
</span><span class="cx"> add_action( 'admin_menu', 'bp_wire_setup_globals', 1 );
</span><span class="lines">@@ -31,7 +34,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><span class="cx">         /* Add 'Wire' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => __('Wire', 'buddypress'), 'slug' => $bp->wire->slug, 'position' => 40, 'screen_function' => 'bp_wire_screen_latest', 'default_subnav_slug' => 'all-posts', '' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __('Wire', 'buddypress'), 'slug' => $bp->wire->slug, 'position' => 40, 'screen_function' => 'bp_wire_screen_latest', 'default_subnav_slug' => 'all-posts', 'item_css_id' => $bp->wire->id ) );
</ins><span class="cx">
</span><span class="cx">         $wire_link = $bp->loggedin_user->domain . $bp->wire->slug . '/';
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkbpxprofilephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile.php (1717 => 1718)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile.php        2009-08-27 20:40:07 UTC (rev 1717)
+++ trunk/bp-xprofile.php        2009-08-27 21:18:10 UTC (rev 1718)
</span><span class="lines">@@ -140,7 +140,10 @@
</span><span class="cx">
</span><span class="cx">         $bp->profile->format_notification_function = 'xprofile_format_notifications';
</span><span class="cx">         $bp->profile->slug = BP_XPROFILE_SLUG;
</span><del>-        
</del><ins>+
+        /* Register this in the active components array */
+        $bp->active_components[$bp->profile->slug] = $bp->profile->id;
+                
</ins><span class="cx">         $bp->profile->field_types = apply_filters( 'xprofile_field_types', array( 'textbox', 'textarea', 'radio', 'checkbox', 'selectbox', 'multiselectbox', 'datebox' ) );
</span><span class="cx">
</span><span class="cx">         if ( function_exists('bp_wire_install') )
</span><span class="lines">@@ -199,7 +202,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><span class="cx">         /* Add 'Profile' to the main navigation */
</span><del>-        bp_core_new_nav_item( array( 'name' => __('Profile', 'buddypress'), 'slug' => $bp->profile->slug, 'position' => 20, 'screen_function' => 'xprofile_screen_display_profile', 'default_subnav_slug' => 'public' ) );
</del><ins>+        bp_core_new_nav_item( array( 'name' => __('Profile', 'buddypress'), 'slug' => $bp->profile->slug, 'position' => 20, 'screen_function' => 'xprofile_screen_display_profile', 'default_subnav_slug' => 'public', 'item_css_id' => $bp->profile->id ) );
</ins><span class="cx">
</span><span class="cx">         $profile_link = $bp->loggedin_user->domain . $bp->profile->slug . '/';
</span><span class="cx">         
</span></span></pre>
</div>
</div>
</body>
</html>