<!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] [2227] trunk: Fixed support for single WP in a subdirectory.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2227</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-12-30 15:18:18 +0000 (Wed, 30 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixed support for single WP in a subdirectory.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcorecssjsphp">trunk/bp-core/bp-core-cssjs.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcorecssjsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-cssjs.php (2226 => 2227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-cssjs.php        2009-12-30 14:11:07 UTC (rev 2226)
+++ trunk/bp-core/bp-core-cssjs.php        2009-12-30 15:18:18 UTC (rev 2227)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="cx">         echo
</span><del>-'&lt;script type=&quot;text/javascript&quot;&gt;var ajaxurl = &quot;' . $bp-&gt;root_domain . str_replace( 'index.php', 'wp-load.php', $_SERVER['SCRIPT_NAME'] ) . '&quot;;&lt;/script&gt;
</del><ins>+'&lt;script type=&quot;text/javascript&quot;&gt;var ajaxurl = &quot;' . site_url( 'wp-load.php' ) . '&quot;;&lt;/script&gt;
</ins><span class="cx"> ';
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_head', 'bp_core_add_ajax_url_js' );
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (2226 => 2227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2009-12-30 14:11:07 UTC (rev 2226)
+++ trunk/bp-core/bp-core-templatetags.php        2009-12-30 15:18:18 UTC (rev 2227)
</span><span class="lines">@@ -851,18 +851,18 @@
</span><span class="cx">                 $title = __( 'Home', 'buddypress' );
</span><span class="cx">         } else if ( bp_is_blog_page() ) {
</span><span class="cx">                 if ( is_single() ) {
</span><del>-                        $title = __( 'Blog &amp;#8212; ' . $post-&gt;post_title, 'buddypress' );
</del><ins>+                        $title = __( 'Blog &amp;#124; ' . $post-&gt;post_title, 'buddypress' );
</ins><span class="cx">                 } else if ( is_category() ) {
</span><del>-                        $title = __( 'Blog &amp;#8212; Categories &amp;#8212; ' . ucwords( $wp_query-&gt;query_vars['category_name'] ), 'buddypress' );
</del><ins>+                        $title = __( 'Blog &amp;#124; Categories &amp;#124; ' . ucwords( $wp_query-&gt;query_vars['category_name'] ), 'buddypress' );
</ins><span class="cx">                 } else if ( is_tag() ) {
</span><del>-                        $title = __( 'Blog &amp;#8212; Tags &amp;#8212; ' . ucwords( $wp_query-&gt;query_vars['tag'] ), 'buddypress' );
</del><ins>+                        $title = __( 'Blog &amp;#124; Tags &amp;#124; ' . ucwords( $wp_query-&gt;query_vars['tag'] ), 'buddypress' );
</ins><span class="cx">                 } else
</span><span class="cx">                         $title = __( 'Blog', 'buddypress' );
</span><span class="cx"> 
</span><span class="cx">         } else if ( !empty( $bp-&gt;displayed_user-&gt;fullname ) ) {
</span><del>-                 $title = strip_tags( $bp-&gt;displayed_user-&gt;fullname . ' &amp;#8212; ' . ucwords( $bp-&gt;current_component ) . ' &amp;#8212; ' . $bp-&gt;bp_options_nav[$bp-&gt;current_component][$bp-&gt;current_action]['name'] );
</del><ins>+                 $title = strip_tags( $bp-&gt;displayed_user-&gt;fullname . ' &amp;#124; ' . ucwords( $bp-&gt;current_component ) . ' &amp;#124; ' . $bp-&gt;bp_options_nav[$bp-&gt;current_component][$bp-&gt;current_action]['name'] );
</ins><span class="cx">         } else if ( $bp-&gt;is_single_item ) {
</span><del>-                $title = ucwords( $bp-&gt;current_component ) . ' &amp;#8212; ' . $bp-&gt;bp_options_title;
</del><ins>+                $title = ucwords( $bp-&gt;current_component ) . ' &amp;#124; ' . $bp-&gt;bp_options_title;
</ins><span class="cx">         } else if ( $bp-&gt;is_directory ) {
</span><span class="cx">                 if ( !$bp-&gt;current_component )
</span><span class="cx">                         $title = sprintf( __( '%s Directory', 'buddypress' ), ucwords( BP_MEMBERS_SLUG ) );
</span><span class="lines">@@ -879,7 +879,7 @@
</span><span class="cx">                 $blog_title = get_blog_option( BP_ROOT_BLOG, 'blogname' );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        return apply_filters( 'bp_page_title', $blog_title . ' &amp;#8212; ' . attribute_escape( $title ), attribute_escape( $title ) );
</del><ins>+        return apply_filters( 'bp_page_title', $blog_title . ' &amp;#124; ' . attribute_escape( $title ), attribute_escape( $title ) );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_styles() {
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (2226 => 2227)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2009-12-30 14:11:07 UTC (rev 2226)
+++ trunk/bp-core.php        2009-12-30 15:18:18 UTC (rev 2227)
</span><span class="lines">@@ -1477,9 +1477,26 @@
</span><span class="cx">  * @uses bp_core_get_userlink_by_email() Fetches a userlink via email address.
</span><span class="cx">  */
</span><span class="cx"> function bp_core_get_site_path() {
</span><del>-        global $current_site;
</del><ins>+        global $bp, $current_site;
</ins><span class="cx"> 
</span><del>-        return $current_site-&gt;path;
</del><ins>+        if ( bp_core_is_multiblog_install() )
+                $path = $current_site-&gt;path;
+        else {
+                $site_path = (array) explode( '/', site_url() );
+
+                if ( count( $site_path ) &lt; 2 )
+                        $site_path = '/';
+                else {
+                        /* Unset the first three segments (http(s):// part) */
+                        unset( $site_path[0] );
+                        unset( $site_path[1] );
+                        unset( $site_path[2] );
+
+                        $site_path = implode( '/', $site_path );
+                }
+        }
+
+        return apply_filters( 'bp_core_get_site_path', $site_path );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>

</body>
</html>