<!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] [1982] trunk: Fixes #1096 props messenlehner</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>1982</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-09-28 22:49:53 +0000 (Mon, 28 Sep 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixes #1096 props messenlehner</pre>
<h3>Modified Paths</h3>
<ul>
<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="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpsnparent_incajaxphp">trunk/bp-themes/bp-sn-parent/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpsnparentprofileprofilemenuphp">trunk/bp-themes/bp-sn-parent/profile/profile-menu.php</a></li>
<li><a href="#trunkbpthemesbpsnparentuserbarphp">trunk/bp-themes/bp-sn-parent/userbar.php</a></li>
<li><a href="#trunkbpthemesdeprecatedbpmemberactivityjustmephp">trunk/bp-themes/deprecated/bpmember/activity/just-me.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcoredeprecatedbpcoredeprecatedphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/deprecated/bp-core-deprecated.php (1981 => 1982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/deprecated/bp-core-deprecated.php        2009-09-28 22:15:24 UTC (rev 1981)
+++ trunk/bp-core/deprecated/bp-core-deprecated.php        2009-09-28 22:49:53 UTC (rev 1982)
</span><span class="lines">@@ -939,7 +939,7 @@
</span><span class="cx">         <?php endif;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/* DEPRECATED - use the param 'default_subnav_slug' in bp_core_new_nav_item() */
</del><ins>+/* DEPRECATED - use the param 'default_subnav_slug' in bp_core_new_nav_item() OR bp_core_new_nav_default() */
</ins><span class="cx"> function bp_core_add_nav_default( $parent_id, $function, $slug = false, $user_has_access = true, $admin_only = false ) {
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (1981 => 1982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2009-09-28 22:15:24 UTC (rev 1981)
+++ trunk/bp-core.php        2009-09-28 22:49:53 UTC (rev 1982)
</span><span class="lines">@@ -571,7 +571,7 @@
</span><span class="cx"> * @return The user id for the user that is currently being displayed, return zero if this is not a user home and just a normal blog.
</span><span class="cx"> */
</span><span class="cx"> function bp_core_get_displayed_userid( $user_login ) {
</span><del>-        return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid_from_user_login( $user_login ) );
</del><ins>+        return apply_filters( 'bp_core_get_displayed_userid', bp_core_get_userid( $user_login ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -583,10 +583,8 @@
</span><span class="cx"> * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
</span><span class="cx"> */
</span><span class="cx"> function bp_core_new_nav_item( $args = '' ) {
</span><del>-        global $bp, $temp_nav;
</del><ins>+        global $bp;
</ins><span class="cx">
</span><del>-        $temp_nav[] = $args;
-        
</del><span class="cx">         $defaults = array(
</span><span class="cx">                 'name' => false, // Display name for the nav item
</span><span class="cx">                 'slug' => false, // URL slug for the nav item
</span><span class="lines">@@ -638,7 +636,37 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * bp_core_new_nav_default()
+ *
+ * Modify the default subnav item to load when a top level nav item is clicked.
+ *
+ * @package BuddyPress Core
+ * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
+ */
+function bp_core_new_nav_default( $args = '' ) {
+        global $bp;
+        
+        $defaults = array(
+                'parent_slug' => false, // Slug of the parent
+                'screen_function' => false, // The name of the function to run when clicked
+                'subnav_slug' => false // The slug of the subnav item to select when clicked
+        );
</ins><span class="cx">
</span><ins>+        $r = wp_parse_args( $args, $defaults );
+        extract( $r, EXTR_SKIP );
+
+        if ( $bp->current_component == $parent_slug && !$bp->current_action ) {
+                if ( !is_object( $screen_function[0] ) )
+                        add_action( 'wp', $screen_function, 3 );
+                else
+                        add_action( 'wp', array( &$screen_function[0], $screen_function[1] ), 3 );
+
+                if ( $subnav_slug )
+                        $bp->current_action = $subnav_slug;
+        }
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * bp_core_sort_nav_items()
</span><span class="cx"> *
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (1981 => 1982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-09-28 22:15:24 UTC (rev 1981)
+++ trunk/bp-groups.php        2009-09-28 22:49:53 UTC (rev 1982)
</span><span class="lines">@@ -260,7 +260,7 @@
</span><span class="cx">                         bp_core_reset_subnav_items($bp->groups->slug);
</span><span class="cx">                         
</span><span class="cx">                         /* Add a new default subnav item for when the groups nav is selected. */
</span><del>-                        bp_core_add_nav_default( $bp->groups->slug, 'groups_screen_group_home', 'home' );
</del><ins>+                        bp_core_new_nav_default( array( 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_home', 'subnav_slug' => 'home' ) );
</ins><span class="cx">                         
</span><span class="cx">                         /* Add the "Home" subnav item, as this will always be present */
</span><span class="cx">                         bp_core_new_subnav_item( array( 'name' => __( 'Home', 'buddypress' ), 'slug' => 'home', 'parent_url' => $group_link, 'parent_slug' => $bp->groups->slug, 'screen_function' => 'groups_screen_group_home', 'position' => 10, 'item_css_id' => 'group-home' ) );
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx"> function groups_directory_groups_setup() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( $bp->current_component == $bp->groups->slug && empty( $bp->current_action ) ) {
</del><ins>+        if ( $bp->current_component == $bp->groups->slug && empty( $bp->current_action ) && empty( $bp->current_item ) ) {
</ins><span class="cx">                 $bp->is_directory = true;
</span><span class="cx">
</span><span class="cx">                 do_action( 'groups_directory_groups_setup' );
</span></span></pre></div>
<a id="trunkbpthemesbpsnparent_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/_inc/ajax.php (1981 => 1982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/_inc/ajax.php        2009-09-28 22:15:24 UTC (rev 1981)
+++ trunk/bp-themes/bp-sn-parent/_inc/ajax.php        2009-09-28 22:49:53 UTC (rev 1982)
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx">                 foreach ( $friends['friends'] as $user_id ) {
</span><span class="cx">                         $ud = get_userdata($user_id);
</span><span class="cx">                         $username = $ud->user_login;
</span><del>-                        echo bp_core_get_avatar( $user_id, 1, 15, 15 ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
</del><ins>+                        echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
</ins><span class="cx">                         ';
</span><span class="cx">                 }                
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentprofileprofilemenuphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/profile/profile-menu.php (1981 => 1982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/profile/profile-menu.php        2009-09-28 22:15:24 UTC (rev 1981)
+++ trunk/bp-themes/bp-sn-parent/profile/profile-menu.php        2009-09-28 22:49:53 UTC (rev 1982)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> <?php do_action( 'bp_before_profile_menu' ) ?>
</span><span class="cx">
</span><del>-<?php bp_the_avatar() ?>
</del><ins>+<?php bp_displayed_user_avatar( 'type=full' ) ?>
</ins><span class="cx">
</span><span class="cx"> <div class="button-block">
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentuserbarphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/userbar.php (1981 => 1982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/userbar.php        2009-09-28 22:15:24 UTC (rev 1981)
+++ trunk/bp-themes/bp-sn-parent/userbar.php        2009-09-28 22:49:53 UTC (rev 1982)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">         <?php if ( is_user_logged_in() ) : ?>
</span><span class="cx">                 
</span><span class="cx">                 <p class="avatar">
</span><del>-                        <?php bp_loggedinuser_avatar_thumbnail() ?>
</del><ins>+                        <?php bp_loggedin_user_avatar( 'type=thumb' ) ?>
</ins><span class="cx">                 </p>
</span><span class="cx">                 
</span><span class="cx">                 <ul id="bp-nav">
</span></span></pre></div>
<a id="trunkbpthemesdeprecatedbpmemberactivityjustmephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/deprecated/bpmember/activity/just-me.php (1981 => 1982)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/deprecated/bpmember/activity/just-me.php        2009-09-28 22:15:24 UTC (rev 1981)
+++ trunk/bp-themes/deprecated/bpmember/activity/just-me.php        2009-09-28 22:49:53 UTC (rev 1982)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx">         <?php do_action( 'template_notices' ) // (error/success feedback) ?>
</span><span class="cx">         
</span><span class="cx">         <div class="left-menu">
</span><del>-                <?php bp_the_avatar() ?>
</del><ins>+                <?php bp_displayed_user_avatar() ?>
</ins><span class="cx">                 
</span><span class="cx">                 <div class="button-block">
</span><span class="cx">                         <?php if ( function_exists('bp_add_friend_button') ) : ?>
</span></span></pre>
</div>
</div>
</body>
</html>