<!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] [1715] trunk: Fixes #755 props chrisscott</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>1715</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-08-27 19:48:54 +0000 (Thu, 27 Aug 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixes #755 props chrisscott</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpblogsbpblogstemplatetagsphp">trunk/bp-blogs/bp-blogs-templatetags.php</a></li>
<li><a href="#trunkbpcorebpcorecatchuriphp">trunk/bp-core/bp-core-catchuri.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
<li><a href="#trunkbpfriendsbpfriendsnotificationsphp">trunk/bp-friends/bp-friends-notifications.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsnotificationsphp">trunk/bp-groups/bp-groups-notifications.php</a></li>
<li><a href="#trunkbpmessagesbpmessagesnotificationsphp">trunk/bp-messages/bp-messages-notifications.php</a></li>
<li><a href="#trunkbpxprofilebpxprofilenotificationsphp">trunk/bp-xprofile/bp-xprofile-notifications.php</a></li>
<li><a href="#trunkbpxprofilephp">trunk/bp-xprofile.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpblogsbpblogstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs/bp-blogs-templatetags.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs/bp-blogs-templatetags.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-blogs/bp-blogs-templatetags.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -790,7 +790,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         foreach ( $terms as $term ) {
</span><del>-                $link = get_blog_option( 1, 'siteurl') . '/tag/' . $term-&gt;slug;
</del><ins>+                $link = get_blog_option( BP_ROOT_BLOG, 'siteurl') . '/tag/' . $term-&gt;slug;
</ins><span class="cx">                 $link = apply_filters('term_link', $link);
</span><span class="cx">                 
</span><span class="cx">                 $term_links[] = '&lt;a href=&quot;' . $link . '&quot; rel=&quot;tag&quot;&gt;' . $term-&gt;name . '&lt;/a&gt;';
</span></span></pre></div>
<a id="trunkbpcorebpcorecatchuriphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-catchuri.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-catchuri.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-core/bp-core-catchuri.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">                 if ( BP_ROOT_BLOG != (int) $current_blog-&gt;blog_id )
</span><span class="cx">                         return false;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
</span><span class="cx">                 $path = bp_core_referrer();
</span><span class="cx">         else
</span><span class="lines">@@ -49,25 +49,21 @@
</span><span class="cx">         // they are still registered in the global $_GET variable */
</span><span class="cx">         $noget = substr( $path, 0, strpos( $path, '?' ) );
</span><span class="cx">         if ( $noget != '' ) $path = $noget;
</span><del>-        
</del><ins>+
</ins><span class="cx">         /* Fetch the current URI and explode each part seperated by '/' into an array */
</span><span class="cx">         $bp_uri = explode( &quot;/&quot;, $path );
</span><del>-        
-        if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
</del><ins>+
+        /* Loop and remove empties */
+        for ( $i = 0; $i &lt;= count( $bp_uri ); $i++ )
+                if ( empty( $bp_uri[$i] ) ) unset( $bp_uri[$i] );
+
+        if ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG ) {
</ins><span class="cx">                 /* If we are running BuddyPress on any blog, not just a root blog, we need to first
</span><span class="cx">                    shift off the blog name if we are running a subdirectory install of WPMU. */
</span><span class="cx">                 if ( $current_blog-&gt;path != '/' )
</span><span class="cx">                         array_shift( $bp_uri );
</span><span class="cx">         }
</span><del>-        
-        /* Take empties off the end of complete URI */
-        if ( empty( $bp_uri[count($bp_uri) - 1] ) )
-                array_pop( $bp_uri );
</del><span class="cx"> 
</span><del>-        /* Take empties off the start of complete URI */
-        if ( empty( $bp_uri[0] ) )
-                array_shift( $bp_uri );
-                
</del><span class="cx">         /* Get total URI segment count */
</span><span class="cx">         $bp_uri_count = count( $bp_uri ) - 1;
</span><span class="cx">         $is_member_page = false;
</span><span class="lines">@@ -151,7 +147,7 @@
</span><span class="cx">         /* Reset the keys by merging with an empty array */
</span><span class="cx">         $action_variables = array_merge( array(), $action_variables );
</span><span class="cx"> 
</span><del>-        //var_dump($current_component, $current_action, $action_variables);
</del><ins>+        //var_dump($current_component, $current_action, $action_variables); die;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', 'bp_core_set_uri_globals', 3 );
</span><span class="cx"> 
</span><span class="lines">@@ -174,7 +170,7 @@
</span><span class="cx">         $bp_skip_blog_check = $skip_blog_check;
</span><span class="cx"> 
</span><span class="cx">         $bp_path = $pages;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( !bp_is_blog_page() ) {
</span><span class="cx">                 remove_action( 'template_redirect', 'redirect_canonical' );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-core.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> 
</span><span class="cx"> /* Define on which blog ID BuddyPress should run */
</span><span class="cx"> if ( !defined( 'BP_ROOT_BLOG' ) )
</span><del>-        define( 'BP_ROOT_BLOG', 1 );
</del><ins>+        define( 'BP_ROOT_BLOG', 2 );
</ins><span class="cx"> 
</span><span class="cx"> /* Define the user and usermeta table names, useful if you are using custom or shared tables */
</span><span class="cx"> if ( !defined( 'CUSTOM_USER_TABLE' ) )
</span><span class="lines">@@ -386,7 +386,14 @@
</span><span class="cx">  * @return $domain The domain URL for the blog.
</span><span class="cx">  */
</span><span class="cx"> function bp_core_get_root_domain() {
</span><del>-        return apply_filters( 'bp_core_get_root_domain', get_blog_option( BP_ROOT_BLOG, 'siteurl' ) );
</del><ins>+        global $current_blog;
+        
+        if ( defined( 'BP_ENABLE_MULTIBLOG' ) )
+                $domain = get_blog_option( $current_blog-&gt;blog_id, 'siteurl' );
+        else
+                $domain = get_blog_option( BP_ROOT_BLOG, 'siteurl' );
+
+        return apply_filters( 'bp_core_get_root_domain', $domain );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1296,7 +1303,7 @@
</span><span class="cx">  * @return The blog name for the root blog
</span><span class="cx">  */
</span><span class="cx"> function bp_core_email_from_name_filter() {
</span><del>-        return get_blog_option( 1, 'blogname' );
</del><ins>+        return get_blog_option( BP_ROOT_BLOG, 'blogname' );
</ins><span class="cx"> }
</span><span class="cx"> add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpfriendsbpfriendsnotificationsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends/bp-friends-notifications.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends/bp-friends-notifications.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-friends/bp-friends-notifications.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Set up and send the message
</span><span class="cx">         $to = $ud-&gt;user_email;
</span><del>-        $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
</del><ins>+        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
</ins><span class="cx"> 
</span><span class="cx">         $message = sprintf( __( 
</span><span class="cx"> &quot;%s wants to add you as a friend.
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">                 
</span><span class="cx">         // Set up and send the message
</span><span class="cx">         $to = $ud-&gt;user_email;
</span><del>-        $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
</del><ins>+        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
</ins><span class="cx"> 
</span><span class="cx">         $message = sprintf( __( 
</span><span class="cx"> '%s accepted your friend request.
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsnotificationsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-notifications.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-notifications.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-groups/bp-groups-notifications.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx">         $poster_ud = get_userdata( $wire_post-&gt;user_id );
</span><span class="cx">         $poster_profile_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $poster_ud-&gt;user_login;
</span><span class="cx"> 
</span><del>-        $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group-&gt;name) );
</del><ins>+        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group-&gt;name) );
</ins><span class="cx"> 
</span><span class="cx">         foreach ( $group-&gt;user_dataset as $user ) {
</span><span class="cx">                 if ( 'no' == get_usermeta( $user-&gt;user_id, 'notification_groups_wire_post' ) ) continue;
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx">         
</span><span class="cx">         $group = new BP_Groups_Group( $group_id, false, true );
</span><del>-        $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
</del><ins>+        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
</ins><span class="cx"> 
</span><span class="cx">         foreach ( $group-&gt;user_dataset as $user ) {
</span><span class="cx">                 if ( 'no' == get_usermeta( $user-&gt;user_id, 'notification_groups_group_updated' ) ) continue;
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Set up and send the message
</span><span class="cx">         $to = $ud-&gt;user_email;
</span><del>-        $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group-&gt;name) );
</del><ins>+        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group-&gt;name) );
</ins><span class="cx"> 
</span><span class="cx"> $message = sprintf( __( 
</span><span class="cx"> '%s wants to join the group &quot;%s&quot;.
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">         $to = $ud-&gt;user_email;
</span><span class="cx">         
</span><span class="cx">         if ( $accepted ) {
</span><del>-                $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group &quot;%s&quot; accepted', 'buddypress' ), stripslashes($group-&gt;name) );
</del><ins>+                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group &quot;%s&quot; accepted', 'buddypress' ), stripslashes($group-&gt;name) );
</ins><span class="cx">                 $message = sprintf( __( 
</span><span class="cx"> 'Your membership request for the group &quot;%s&quot; has been accepted.
</span><span class="cx"> 
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx"> ', 'buddypress' ), stripslashes($group-&gt;name), $group_link );
</span><span class="cx">                 
</span><span class="cx">         } else {
</span><del>-                $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group &quot;%s&quot; rejected', 'buddypress' ), stripslashes($group-&gt;name) );
</del><ins>+                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group &quot;%s&quot; rejected', 'buddypress' ), stripslashes($group-&gt;name) );
</ins><span class="cx">                 $message = sprintf( __( 
</span><span class="cx"> 'Your membership request for the group &quot;%s&quot; has been rejected.
</span><span class="cx"> 
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">         // Set up and send the message
</span><span class="cx">         $to = $ud-&gt;user_email;
</span><span class="cx"> 
</span><del>-        $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: &quot;%s&quot;', 'buddypress' ), stripslashes($group-&gt;name) );
</del><ins>+        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: &quot;%s&quot;', 'buddypress' ), stripslashes($group-&gt;name) );
</ins><span class="cx"> 
</span><span class="cx">         $message = sprintf( __( 
</span><span class="cx"> 'You have been promoted to %s for the group: &quot;%s&quot;.
</span><span class="lines">@@ -243,7 +243,7 @@
</span><span class="cx">                 // Set up and send the message
</span><span class="cx">                 $to = $invited_ud-&gt;user_email;
</span><span class="cx"> 
</span><del>-                $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: &quot;%s&quot;', 'buddypress' ), stripslashes($group-&gt;name) );
</del><ins>+                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: &quot;%s&quot;', 'buddypress' ), stripslashes($group-&gt;name) );
</ins><span class="cx"> 
</span><span class="cx">                 $message = sprintf( __( 
</span><span class="cx"> 'One of your friends %s has invited you to the group: &quot;%s&quot;.
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagesnotificationsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-notifications.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-notifications.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-messages/bp-messages-notifications.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">                 
</span><span class="cx">                 // Set up and send the message
</span><span class="cx">                 $to = $ud-&gt;user_email;
</span><del>-                $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes($sender_name) );
</del><ins>+                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes($sender_name) );
</ins><span class="cx"> 
</span><span class="cx">                 $content = sprintf( __( 
</span><span class="cx"> '%s sent you a new message:
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> // To view the notice: %s
</span><span class="cx"> // 
</span><span class="cx"> // ---------------------
</span><del>-// ', 'buddypress' ), get_blog_option( 1, 'blogname' ), stripslashes( strip_tags( $message_subject ) ), stripslashes( strip_tags( $message ) ), $message_link );
</del><ins>+// ', 'buddypress' ), get_blog_option( BP_ROOT_BLOG, 'blogname' ), stripslashes( strip_tags( $message_subject ) ), stripslashes( strip_tags( $message ) ), $message_link );
</ins><span class="cx"> // 
</span><span class="cx"> //                 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
</span><span class="cx"> // 
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofilenotificationsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-notifications.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-notifications.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-xprofile/bp-xprofile-notifications.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">                         
</span><span class="cx">                         // Set up and send the message
</span><span class="cx">                         $to = $ud-&gt;user_email;
</span><del>-                        $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) );
</del><ins>+                        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) );
</ins><span class="cx"> 
</span><span class="cx"> $message = sprintf( __( 
</span><span class="cx"> '%s posted on your wire:
</span></span></pre></div>
<a id="trunkbpxprofilephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile.php (1714 => 1715)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile.php        2009-08-27 17:43:08 UTC (rev 1714)
+++ trunk/bp-xprofile.php        2009-08-27 19:48:54 UTC (rev 1715)
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx">  */
</span><span class="cx"> function xprofile_screen_display_profile() {
</span><span class="cx">         global $bp, $is_new_friend;
</span><del>-        
</del><ins>+
</ins><span class="cx">         // If this is a first visit to a new friends profile, delete the friend accepted notifications for the
</span><span class="cx">         // logged in user. $is_new_friend is set in bp-core/bp-core-catchuri.php in bp_core_set_uri_globals()
</span><span class="cx">         if ( $is_new_friend )
</span></span></pre>
</div>
</div>

</body>
</html>