<!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] [3117] branches/1.2: Fixes #2489 props wpmuguru</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>3117</dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2010-07-04 06:07:51 +0000 (Sun, 04 Jul 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fixes #2489 props wpmuguru</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branches12bpblogsbpblogstemplatetagsphp">branches/1.2/bp-blogs/bp-blogs-templatetags.php</a></li>
<li><a href="#branches12bpcorebpcorecatchuriphp">branches/1.2/bp-core/bp-core-catchuri.php</a></li>
<li><a href="#branches12bpcorebpcorewpabstractionphp">branches/1.2/bp-core/bp-core-wpabstraction.php</a></li>
<li><a href="#branches12bpthemesbpdefaultregistrationregisterphp">branches/1.2/bp-themes/bp-default/registration/register.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branches12bpblogsbpblogstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: branches/1.2/bp-blogs/bp-blogs-templatetags.php (3116 => 3117)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.2/bp-blogs/bp-blogs-templatetags.php        2010-07-04 04:50:13 UTC (rev 3116)
+++ branches/1.2/bp-blogs/bp-blogs-templatetags.php        2010-07-04 06:07:51 UTC (rev 3117)
</span><span class="lines">@@ -361,7 +361,7 @@
</span><span class="cx">         global $current_site;
</span><span class="cx">
</span><span class="cx">         // Blog name
</span><del>-        if( 'no' == constant( "VHOST" ) )
</del><ins>+        if( !is_subdomain_install() )
</ins><span class="cx">                 echo '<label for="blogname">' . __('Blog Name:', 'buddypress') . '</label>';
</span><span class="cx">         else
</span><span class="cx">                 echo '<label for="blogname">' . __('Blog Domain:', 'buddypress') . '</label>';
</span><span class="lines">@@ -370,18 +370,20 @@
</span><span class="cx">                 <p class="error"><?php echo $errmsg ?></p>
</span><span class="cx">         <?php }
</span><span class="cx">
</span><del>-        if( 'no' == constant( "VHOST" ) ) {
</del><ins>+        if ( !is_subdomain_install() )
</ins><span class="cx">                 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />';
</span><del>-        } else {
</del><ins>+        else
</ins><span class="cx">                 echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /> <span class="suffix_address">.' . $current_site->domain . $current_site->path . '</span><br />';
</span><del>-        }
</del><ins>+
</ins><span class="cx">         if ( !is_user_logged_in() ) {
</span><span class="cx">                 print '(<strong>' . __( 'Your address will be ' , 'buddypress');
</span><del>-                if( 'no' == constant( "VHOST" ) ) {
</del><ins>+
+                if ( !is_subdomain_install() ) {
</ins><span class="cx">                         print $current_site->domain . $current_site->path . __( 'blogname' , 'buddypress');
</span><span class="cx">                 } else {
</span><span class="cx">                         print __( 'domain.' , 'buddypress') . $current_site->domain . $current_site->path;
</span><span class="cx">                 }
</span><ins>+
</ins><span class="cx">                 echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , 'buddypress') . '</p>';
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="branches12bpcorebpcorecatchuriphp"></a>
<div class="modfile"><h4>Modified: branches/1.2/bp-core/bp-core-catchuri.php (3116 => 3117)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.2/bp-core/bp-core-catchuri.php        2010-07-04 04:50:13 UTC (rev 3116)
+++ branches/1.2/bp-core/bp-core-catchuri.php        2010-07-04 06:07:51 UTC (rev 3117)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">         if ( !isset($is_root_component) )
</span><span class="cx">                 $is_root_component = in_array( $bp_uri[0], $bp->root_components );
</span><span class="cx">
</span><del>-        if ( 'no' == VHOST && !$is_root_component ) {
</del><ins>+        if ( !is_subdomain_install() && !$is_root_component ) {
</ins><span class="cx">                 $component_index++;
</span><span class="cx">                 $action_index++;
</span><span class="cx">         }
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">         unset($action_variables[$action_index]);
</span><span class="cx">
</span><span class="cx">         /* Remove the username from action variables if this is not a VHOST install */
</span><del>-        if ( 'no' == VHOST && !$is_root_component )
</del><ins>+        if ( !is_subdomain_install() && !$is_root_component )
</ins><span class="cx">                 array_shift($action_variables);
</span><span class="cx">
</span><span class="cx">         /* Reset the keys by merging with an empty array */
</span></span></pre></div>
<a id="branches12bpcorebpcorewpabstractionphp"></a>
<div class="modfile"><h4>Modified: branches/1.2/bp-core/bp-core-wpabstraction.php (3116 => 3117)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.2/bp-core/bp-core-wpabstraction.php        2010-07-04 04:50:13 UTC (rev 3116)
+++ branches/1.2/bp-core/bp-core-wpabstraction.php        2010-07-04 06:07:51 UTC (rev 3117)
</span><span class="lines">@@ -89,3 +89,12 @@
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx"> }
</span><ins>+
+if ( !function_exists( 'is_subdomain_install' ) ) {
+        function is_subdomain_install() {
+                if ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) )
+                        return true;
+
+                return false;
+        }
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="branches12bpthemesbpdefaultregistrationregisterphp"></a>
<div class="modfile"><h4>Modified: branches/1.2/bp-themes/bp-default/registration/register.php (3116 => 3117)</h4>
<pre class="diff"><span>
<span class="info">--- branches/1.2/bp-themes/bp-default/registration/register.php        2010-07-04 04:50:13 UTC (rev 3116)
+++ branches/1.2/bp-themes/bp-default/registration/register.php        2010-07-04 06:07:51 UTC (rev 3117)
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx">                                                         <label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
</span><span class="cx">                                                         <?php do_action( 'bp_signup_blog_url_errors' ) ?>
</span><span class="cx">
</span><del>-                                                        <?php if ( 'yes' == VHOST ) : ?>
</del><ins>+                                                        <?php if ( is_subdomain_install() ) : ?>
</ins><span class="cx">                                                                 http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" /> .<?php echo str_replace( 'http://', '', site_url() ) ?>
</span><span class="cx">                                                         <?php else : ?>
</span><span class="cx">                                                                 <?php echo site_url() ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" />
</span></span></pre>
</div>
</div>
</body>
</html>