<!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" />
<title>[BuddyPress][4006] trunk: Bring back support for WordPress profiles when XProfile component is not active.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>4006</dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2011-02-02 07:01:14 +0000 (Wed, 02 Feb 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Bring back support for WordPress profiles when XProfile component is not active.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoretemplatephp">trunk/bp-core/bp-core-template.php</a></li>
<li><a href="#trunkbpmembersbpmembersloaderphp">trunk/bp-members/bp-members-loader.php</a></li>
<li><a href="#trunkbpmembersbpmembersscreensphp">trunk/bp-members/bp-members-screens.php</a></li>
<li><a href="#trunkbpthemesbpdefaultmemberssingleprofileprofilewpphp">trunk/bp-themes/bp-default/members/single/profile/profile-wp.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoretemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-template.php (4005 => 4006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-template.php        2011-02-02 06:38:35 UTC (rev 4005)
+++ trunk/bp-core/bp-core-template.php        2011-02-02 07:01:14 UTC (rev 4006)
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx">         // index. Otherwise we need to use the component's root_slug
</span><span class="cx">         $component_index = !empty( $bp-&gt;displayed_user ) ? $bp-&gt;current_component : bp_get_root_slug( $bp-&gt;current_component );
</span><span class="cx"> 
</span><del>-        if ( count( $bp-&gt;bp_options_nav[$component_index] ) &lt; 1 )
</del><ins>+        if ( !isset( $bp-&gt;bp_options_nav[$component_index] ) || count( $bp-&gt;bp_options_nav[$component_index] ) &lt; 1 )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         // Loop through each navigation item
</span><span class="lines">@@ -978,7 +978,7 @@
</span><span class="cx"> function bp_is_user_profile() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        if ( bp_is_current_component( 'xprofile' ) )
</del><ins>+        if ( bp_is_current_component( 'xprofile' ) || bp_is_current_component( 'profile' ) )
</ins><span class="cx">                 return true;
</span><span class="cx"> 
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkbpmembersbpmembersloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-members/bp-members-loader.php (4005 => 4006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-members/bp-members-loader.php        2011-02-02 06:38:35 UTC (rev 4005)
+++ trunk/bp-members/bp-members-loader.php        2011-02-02 07:01:14 UTC (rev 4006)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">                 // Define a slug, if necessary
</span><span class="cx">                 if ( !defined( 'BP_MEMBERS_SLUG' ) )
</span><del>-                        define( 'BP_MEMBERS_SLUG', $this-&gt;id );
</del><ins>+                        define( 'BP_MEMBERS_SLUG', 'members' );
</ins><span class="cx"> 
</span><span class="cx">                 $globals = array(
</span><span class="cx">                         'slug'          =&gt; BP_MEMBERS_SLUG,
</span><span class="lines">@@ -140,100 +140,57 @@
</span><span class="cx">         function _setup_nav() {
</span><span class="cx">                 global $bp;
</span><span class="cx"> 
</span><del>-                return false;
</del><ins>+                // Add 'Profile' to the main navigation
+                if ( !bp_is_active( 'xprofile' ) ) {
+                        $main_nav = array(
+                                'name'                =&gt; __( 'Profile', 'buddypress' ),
+                                'slug'                =&gt; $bp-&gt;profile-&gt;slug,
+                                'position'            =&gt; 20,
+                                'screen_function'     =&gt; 'bp_members_screen_display_profile',
+                                'default_subnav_slug' =&gt; 'public',
+                                'item_css_id'         =&gt; $bp-&gt;profile-&gt;id
+                        );
</ins><span class="cx"> 
</span><del>-                // Add 'User' to the main navigation
-                $main_nav = array(
-                        'name'                =&gt; __( 'User', 'buddypress' ),
-                        'slug'                =&gt; $this-&gt;slug,
-                        'position'            =&gt; 10,
-                        'screen_function'     =&gt; 'bp_members_screen_my_users',
-                        'default_subnav_slug' =&gt; 'just-me',
-                        'item_css_id'         =&gt; $this-&gt;id
-                );
</del><ins>+                        // User links
+                        $user_domain   = ( isset( $bp-&gt;displayed_user-&gt;domain ) )               ? $bp-&gt;displayed_user-&gt;domain               : $bp-&gt;loggedin_user-&gt;domain;
+                        $user_login    = ( isset( $bp-&gt;displayed_user-&gt;userdata-&gt;user_login ) ) ? $bp-&gt;displayed_user-&gt;userdata-&gt;user_login : $bp-&gt;loggedin_user-&gt;userdata-&gt;user_login;
+                        $profile_link  = trailingslashit( $user_domain . $bp-&gt;profile-&gt;slug );
</ins><span class="cx"> 
</span><del>-                // Stop if there is no user displayed or logged in
-                if ( !is_user_logged_in() &amp;&amp; !isset( $bp-&gt;displayed_user-&gt;id ) )
-                        return;
-
-                // User links
-                $user_domain   = ( isset( $bp-&gt;displayed_user-&gt;domain ) )               ? $bp-&gt;displayed_user-&gt;domain               : $bp-&gt;loggedin_user-&gt;domain;
-                $user_login    = ( isset( $bp-&gt;displayed_user-&gt;userdata-&gt;user_login ) ) ? $bp-&gt;displayed_user-&gt;userdata-&gt;user_login : $bp-&gt;loggedin_user-&gt;userdata-&gt;user_login;
-                $users_link    = $user_domain . $this-&gt;slug . '/';
-
-                // Add the subnav items to the users nav item if we are using a theme that supports this
-                $sub_nav[] = array(
-                        'name'            =&gt; __( 'Personal', 'buddypress' ),
-                        'slug'            =&gt; 'just-me',
-                        'parent_url'      =&gt; $users_link,
-                        'parent_slug'     =&gt; $this-&gt;slug,
-                        'screen_function' =&gt; 'bp_members_screen_my_users',
-                        'position'        =&gt; 10
-                );
-
-                // Additional menu if friends is active
-                if ( bp_is_active( 'friends' ) ) {
</del><ins>+                        // Add the subnav items to the profile
</ins><span class="cx">                         $sub_nav[] = array(
</span><del>-                                'name'            =&gt; __( 'Friends', 'buddypress' ),
-                                'slug'            =&gt; BP_FRIENDS_SLUG,
-                                'parent_url'      =&gt; $users_link,
-                                'parent_slug'     =&gt; $this-&gt;slug,
-                                'screen_function' =&gt; 'bp_members_screen_friends',
-                                'position'        =&gt; 20,
-                                'item_css_id'     =&gt; 'users-friends'
</del><ins>+                                'name'            =&gt; __( 'Public', 'buddypress' ),
+                                'slug'            =&gt; 'public',
+                                'parent_url'      =&gt; $profile_link,
+                                'parent_slug'     =&gt; $bp-&gt;profile-&gt;slug,
+                                'screen_function' =&gt; 'bp_members_screen_display_profile',
+                                'position'        =&gt; 10
</ins><span class="cx">                         );
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                // Additional menu if groups is active
-                if ( bp_is_active( 'groups' ) ) {
-                        $sub_nav[] = array(
-                                'name'            =&gt; __( 'Groups', 'buddypress' ),
-                                'slug'            =&gt; BP_GROUPS_SLUG,
-                                'parent_url'      =&gt; $users_link,
-                                'parent_slug'     =&gt; $this-&gt;slug,
-                                'screen_function' =&gt; 'bp_members_screen_groups',
-                                'position'        =&gt; 30,
-                                'item_css_id'     =&gt; 'users-groups'
-                        );
-                }
</del><ins>+                parent::_setup_nav( $main_nav, $sub_nav );
+        }
</ins><span class="cx"> 
</span><del>-                // Favorite users items
-                $sub_nav[] = array(
-                        'name'            =&gt; __( 'Favorites', 'buddypress' ),
-                        'slug'            =&gt; 'favorites',
-                        'parent_url'      =&gt; $users_link,
-                        'parent_slug'     =&gt; $this-&gt;slug,
-                        'screen_function' =&gt; 'bp_members_screen_favorites',
-                        'position'        =&gt; 40,
-                        'item_css_id'     =&gt; 'users-favs'
-                );
</del><ins>+        /**
+         * Sets up the title for pages and &lt;title&gt;
+         *
+         * @global obj $bp
+         */
+        function _setup_title() {
+                global $bp;
</ins><span class="cx"> 
</span><del>-                // @ mentions
-                $sub_nav[] = array(
-                        'name'            =&gt; sprintf( __( '@%s Mentions', 'buddypress' ), $user_login ),
-                        'slug'            =&gt; 'mentions',
-                        'parent_url'      =&gt; $users_link,
-                        'parent_slug'     =&gt; $this-&gt;slug,
-                        'screen_function' =&gt; 'bp_members_screen_mentions',
-                        'position'        =&gt; 50,
-                        'item_css_id'     =&gt; 'users-mentions'
-                );
-
-                // Adjust title based on view
-                if ( bp_is_users_component() ) {
-                        if ( bp_is_my_profile() ) {
-                                $bp-&gt;bp_options_title = __( 'You', 'buddypress' );
-                        } else {
-                                $bp-&gt;bp_options_avatar = bp_core_fetch_avatar( array(
-                                        'item_id' =&gt; $bp-&gt;displayed_user-&gt;id,
-                                        'type'    =&gt; 'thumb'
-                                ) );
-                                $bp-&gt;bp_options_title  = $bp-&gt;displayed_user-&gt;fullname;
-                        }
</del><ins>+                if ( bp_is_my_profile() ) {
+                        $bp-&gt;bp_options_title = __( 'You', 'buddypress' );
+                } elseif( bp_is_user() ) {
+                        $bp-&gt;bp_options_avatar = bp_core_fetch_avatar( array(
+                                'item_id' =&gt; $bp-&gt;displayed_user-&gt;id,
+                                'type'    =&gt; 'thumb'
+                        ) );
+                        $bp-&gt;bp_options_title  = $bp-&gt;displayed_user-&gt;fullname;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                parent::_setup_nav( $main_nav, $sub_nav );
</del><ins>+                parent::_setup_title();
</ins><span class="cx">         }
</span><ins>+
</ins><span class="cx"> }
</span><span class="cx"> // Create the users component
</span><span class="cx"> $bp-&gt;members = new BP_Members_Component();
</span></span></pre></div>
<a id="trunkbpmembersbpmembersscreensphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-members/bp-members-screens.php (4005 => 4006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-members/bp-members-screens.php        2011-02-02 06:38:35 UTC (rev 4005)
+++ trunk/bp-members/bp-members-screens.php        2011-02-02 07:01:14 UTC (rev 4006)
</span><span class="lines">@@ -1,5 +1,16 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><ins>+/**
+ * Handles the display of the profile page by loading the correct template file.
+ *
+ * @package BuddyPress Members
+ * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename)
+ */
+function bp_members_screen_display_profile() {
+        do_action( 'bp_members_screen_display_profile' );
+        bp_core_load_template( apply_filters( 'bp_members_screen_display_profile', 'members/single/home' ) );
+}
+
</ins><span class="cx"> function bp_members_screen_index() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultmemberssingleprofileprofilewpphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/members/single/profile/profile-wp.php (4005 => 4006)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/members/single/profile/profile-wp.php        2011-02-02 06:38:35 UTC (rev 4005)
+++ trunk/bp-themes/bp-default/members/single/profile/profile-wp.php        2011-02-02 07:01:14 UTC (rev 4006)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> &lt;?php do_action( 'bp_before_profile_loop_content' ) ?&gt;
</span><span class="cx"> 
</span><del>-&lt;?php $ud = get_userdata( bp_core_get_displayed_userid() ); ?&gt;
</del><ins>+&lt;?php $ud = get_userdata( bp_displayed_user_id() ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;?php do_action( 'bp_before_profile_field_content' ) ?&gt;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>