<!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][6310] trunk: Admin Audit:</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><a href="http://buddypress.trac.wordpress.org/changeset/6310">6310</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-09-06 04:24:22 +0000 (Thu, 06 Sep 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Admin Audit:

* Introduce bp_is_network_activated() to tell if BuddyPress is active at a network level.
* Use bp_is_network_activated() in places where multiblog or single-site activation might mistakingly link to the incorrect site/network admin.
* Add phpdoc to bp_is_multiblog_mode() to further explain why it exists, and why you should not use it.
* Audit usage of network_admin_url() and admin_url(), and replace with bp_get_admin_url() where appropriate.
* Escape some admin URL usages; maybe more to do here.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityakismetphp">trunk/bp-activity/bp-activity-akismet.php</a></li>
<li><a href="#trunkbpcoreadminbpcorefunctionsphp">trunk/bp-core/admin/bp-core-functions.php</a></li>
<li><a href="#trunkbpcoreadminbpcoresettingsphp">trunk/bp-core/admin/bp-core-settings.php</a></li>
<li><a href="#trunkbpcoreadminbpcoreslugsphp">trunk/bp-core/admin/bp-core-slugs.php</a></li>
<li><a href="#trunkbpcorebpcoreadminphp">trunk/bp-core/bp-core-admin.php</a></li>
<li><a href="#trunkbpcorebpcoreclassesphp">trunk/bp-core/bp-core-classes.php</a></li>
<li><a href="#trunkbpcorebpcorecssjsphp">trunk/bp-core/bp-core-cssjs.php</a></li>
<li><a href="#trunkbpcorebpcorefunctionsphp">trunk/bp-core/bp-core-functions.php</a></li>
<li><a href="#trunkbpforumsbpforumsadminphp">trunk/bp-forums/bp-forums-admin.php</a></li>
<li><a href="#trunkbpforumsdeprecated16php">trunk/bp-forums/deprecated/1.6.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityakismetphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-akismet.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-akismet.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-activity/bp-activity-akismet.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -97,14 +97,14 @@
</span><span class="cx">                         foreach ( $actions as $k =&gt; $item ) {
</span><span class="cx">                                 $b[ $k ] = $item;
</span><span class="cx">                                 if ( $k == 'edit' )
</span><del>-                                        $b['history'] = '&lt;a href=&quot;' . network_admin_url( 'admin.php?page=bp-activity&amp;amp;action=edit&amp;aid=' . $activity['id'] ) . '#bp_activity_history&quot;&gt; '. __( 'History', 'buddypress' ) . '&lt;/a&gt;';
</del><ins>+                                        $b['history'] = '&lt;a href=&quot;' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&amp;amp;action=edit&amp;aid=' . $activity['id'] ) ) . '#bp_activity_history&quot;&gt; '. __( 'History', 'buddypress' ) . '&lt;/a&gt;';
</ins><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         $actions = $b;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ( $desc )
</span><del>-                        echo '&lt;span class=&quot;akismet-status&quot;&gt;&lt;a href=&quot;' . network_admin_url( 'admin.php?page=bp-activity&amp;amp;action=edit&amp;aid=' . $activity['id'] ) . '#bp_activity_history&quot;&gt;' . htmlspecialchars( $desc ) . '&lt;/a&gt;&lt;/span&gt;';
</del><ins>+                        echo '&lt;span class=&quot;akismet-status&quot;&gt;&lt;a href=&quot;' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&amp;amp;action=edit&amp;aid=' . $activity['id'] ) ) . '#bp_activity_history&quot;&gt;' . htmlspecialchars( $desc ) . '&lt;/a&gt;&lt;/span&gt;';
</ins><span class="cx"> 
</span><span class="cx">                 return apply_filters( 'bp_akismet_comment_row_action', $actions );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpcoreadminbpcorefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-functions.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-functions.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-core/admin/bp-core-functions.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">                 &lt;h2&gt;&lt;?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?&gt;&lt;/h2&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;p&gt;&lt;?php _e( &quot;Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.&quot;, 'buddypress' ); ?&gt;&lt;/p&gt;
</span><del>-                &lt;p&gt;&lt;?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to &lt;a href=&quot;%s&quot;&gt;Settings &amp;gt; BuddyPress&lt;/a&gt;. Profile Fields has been moved into the &lt;a href=&quot;%s&quot;&gt;Users&lt;/a&gt; menu.', 'buddypress' ), $settings_url, network_admin_url( 'users.php?page=bp-profile-setup' ) ); ?&gt;&lt;/p&gt;
</del><ins>+                &lt;p&gt;&lt;?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to &lt;a href=&quot;%s&quot;&gt;Settings &amp;gt; BuddyPress&lt;/a&gt;. Profile Fields has been moved into the &lt;a href=&quot;%s&quot;&gt;Users&lt;/a&gt; menu.', 'buddypress' ), esc_url( $settings_url ), bp_get_admin_url( 'users.php?page=bp-profile-setup' ) ); ?&gt;&lt;/p&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span></span></pre></div>
<a id="trunkbpcoreadminbpcoresettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-settings.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-settings.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-core/admin/bp-core-settings.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx"> function bp_core_admin_settings() {
</span><span class="cx"> 
</span><span class="cx">         // We're saving our own options, until the WP Settings API is updated to work with Multisite
</span><del>-        $form_action = add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) );
</del><ins>+        $form_action = add_query_arg( 'page', 'bp-settings', bp_get_admin_url( 'admin.php' ) );
</ins><span class="cx"> 
</span><span class="cx">         ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -313,7 +313,7 @@
</span><span class="cx">                         bp_update_option( $legacy_option, $value );
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                bp_core_redirect( add_query_arg( array( 'page' =&gt; 'bp-settings', 'updated' =&gt; 'true' ), bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) );
</del><ins>+                bp_core_redirect( add_query_arg( array( 'page' =&gt; 'bp-settings', 'updated' =&gt; 'true' ), bp_get_admin_url( 'admin.php' ) ) );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> add_action( 'bp_admin_init', 'bp_core_admin_settings_save', 100 );
</span></span></pre></div>
<a id="trunkbpcoreadminbpcoreslugsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-slugs.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-slugs.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-core/admin/bp-core-slugs.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -94,9 +94,9 @@
</span><span class="cx">                                                 &lt;/th&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;td&gt;
</span><del>-                                                        &lt;?php if ( !bp_is_root_blog() )
-                                                                switch_to_blog( bp_get_root_blog_id() ) ?&gt;
</del><span class="cx"> 
</span><ins>+                                                        &lt;?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?&gt;
+
</ins><span class="cx">                                                         &lt;?php echo wp_dropdown_pages( array(
</span><span class="cx">                                                                 'name'             =&gt; 'bp_pages[' . esc_attr( $name ) . ']',
</span><span class="cx">                                                                 'echo'             =&gt; false,
</span><span class="lines">@@ -113,8 +113,7 @@
</span><span class="cx"> 
</span><span class="cx">                                                         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><del>-                                                        &lt;?php if ( !bp_is_root_blog() )
-                                                                restore_current_blog() ?&gt;
</del><ins>+                                                        &lt;?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                                                 &lt;/td&gt;
</span><span class="cx">                                         &lt;/tr&gt;
</span><span class="lines">@@ -158,6 +157,9 @@
</span><span class="cx">                                                 &lt;/th&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;td&gt;
</span><ins>+                                                        
+                                                        &lt;?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?&gt;
+
</ins><span class="cx">                                                         &lt;?php echo wp_dropdown_pages( array(
</span><span class="cx">                                                                 'name'             =&gt; 'bp_pages[' . esc_attr( $name ) . ']',
</span><span class="cx">                                                                 'echo'             =&gt; false,
</span><span class="lines">@@ -174,6 +176,8 @@
</span><span class="cx"> 
</span><span class="cx">                                                         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><ins>+                                                        &lt;?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?&gt;
+
</ins><span class="cx">                                                 &lt;/td&gt;
</span><span class="cx">                                         &lt;/tr&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpcorebpcoreadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-admin.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-admin.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-core/bp-core-admin.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -367,9 +367,8 @@
</span><span class="cx">          * @return array Processed links
</span><span class="cx">          */
</span><span class="cx">         public function add_settings_link( $links, $file ) {
</span><del>-                global $bp;
</del><span class="cx"> 
</span><del>-                if ( plugin_basename( $bp-&gt;file ) == $file ) {
</del><ins>+                if ( buddypress()-&gt;basename == $file ) {
</ins><span class="cx">                         $url           = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );
</span><span class="cx">                         $settings_link = '&lt;a href=&quot;' . add_query_arg( array( 'page' =&gt; 'bp-components' ), $url ) . '&quot;&gt;' . __( 'Settings', 'buddypress' ) . '&lt;/a&gt;';
</span><span class="cx">                         array_unshift( $links, $settings_link );
</span></span></pre></div>
<a id="trunkbpcorebpcoreclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-classes.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-classes.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-core/bp-core-classes.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -876,114 +876,111 @@
</span><span class="cx">  * @since BuddyPress (1.2.6)
</span><span class="cx">  */
</span><span class="cx"> class BP_Button {
</span><del>-        // Button properties
</del><span class="cx"> 
</span><ins>+        /** Button properties *****************************************************/
+
</ins><span class="cx">         /**
</span><span class="cx">          * The button ID
</span><span class="cx">          *
</span><span class="cx">          * @var integer
</span><span class="cx">          */
</span><del>-        var $id;
</del><ins>+        private $id = '';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The component name that button belongs to.
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $component;
</del><ins>+        private $component = 'core';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Does the user need to be logged in to see this button?
</span><span class="cx">          *
</span><span class="cx">          * @var boolean
</span><span class="cx">          */
</span><del>-        var $must_be_logged_in;
</del><ins>+        private $must_be_logged_in = true;
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><del>-         * True or false if the button should not be displayed while viewing your own profile.
</del><ins>+         * True or false if the button should not be displayed while viewing your
+         * own profile.
</ins><span class="cx">          *
</span><span class="cx">          * @var boolean
</span><span class="cx">          */
</span><del>-        var $block_self;
</del><ins>+        private $block_self = true;
</ins><span class="cx"> 
</span><ins>+        /** Wrapper ***************************************************************/
</ins><span class="cx"> 
</span><del>-        // Wrapper
-
</del><span class="cx">         /**
</span><span class="cx">          * What type of DOM element to use for a wrapper.
</span><span class="cx">          *
</span><span class="cx">          *
</span><span class="cx">          * @var mixed div|span|p|li, or false for no wrapper
</span><span class="cx">          */
</span><del>-        var $wrapper;
</del><ins>+        private $wrapper = 'div';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The DOM class of the button wrapper
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $wrapper_class;
</del><ins>+        private $wrapper_class = '';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The DOM ID of the button wrapper
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $wrapper_id;
</del><ins>+        private $wrapper_id = '';
</ins><span class="cx"> 
</span><ins>+        /** Button ****************************************************************/
</ins><span class="cx"> 
</span><del>-        // Button
-
</del><span class="cx">         /**
</span><span class="cx">          * The destination link of the button
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $link_href;
</del><ins>+        private $link_href = '';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The DOM class of the button link
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $link_class;
</del><ins>+        private $link_class = '';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The DOM ID of the button link
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $link_id;
</del><ins>+        private $link_id = '';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The DOM rel value of the button link
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $link_rel;
</del><ins>+        private $link_rel = '';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Title of the button link
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $link_title;
</del><ins>+        private $link_title = '';
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * The contents of the button link
</span><span class="cx">          *
</span><span class="cx">          * @var string
</span><span class="cx">          */
</span><del>-        var $link_text;
</del><ins>+        private $link_text = '';
</ins><span class="cx"> 
</span><ins>+        /** HTML result ***********************************************************/
</ins><span class="cx"> 
</span><del>-        // HTML result
</del><ins>+        public $contents = '';
</ins><span class="cx"> 
</span><del>-        var $contents;
-
</del><span class="cx">         /**
</span><del>-         * bp_button()
-         *
</del><span class="cx">          * Builds the button based on passed parameters:
</span><span class="cx">          *
</span><span class="cx">          * component: Which component this button is for
</span><span class="lines">@@ -1002,28 +999,9 @@
</span><span class="cx">          * @param array $args
</span><span class="cx">          * @return bool False if not allowed
</span><span class="cx">          */
</span><del>-        function __construct( $args = '' ) {
</del><ins>+        public function __construct( $args = '' ) {
</ins><span class="cx"> 
</span><del>-                // Default arguments
-                $defaults = array(
-                        'id'                =&gt; '',
-                        'component'         =&gt; 'core',
-                        'must_be_logged_in' =&gt; true,
-                        'block_self'        =&gt; true,
-
-                        'wrapper'           =&gt; 'div',
-                        'wrapper_id'        =&gt; '',
-                        'wrapper_class'     =&gt; '',
-
-                        'link_href'         =&gt; '',
-                        'link_title'        =&gt; '',
-                        'link_id'           =&gt; '',
-                        'link_class'        =&gt; '',
-                        'link_rel'          =&gt; '',
-                        'link_text'         =&gt; '',
-                );
-
-                $r = wp_parse_args( $args, $defaults );
</del><ins>+                $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) );
</ins><span class="cx">                 extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><span class="cx">                 // Required button properties
</span><span class="lines">@@ -1100,22 +1078,18 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><del>-         * contents()
-         *
</del><span class="cx">          * Return contents of button
</span><span class="cx">          *
</span><span class="cx">          * @return string
</span><span class="cx">          */
</span><del>-        function contents() {
</del><ins>+        public function contents() {
</ins><span class="cx">                 return $this-&gt;contents;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><del>-         * display()
-         *
</del><span class="cx">          * Output contents of button
</span><span class="cx">          */
</span><del>-        function display() {
</del><ins>+        public function display() {
</ins><span class="cx">                 if ( !empty( $this-&gt;contents ) )
</span><span class="cx">                         echo $this-&gt;contents;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpcorebpcorecssjsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-cssjs.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-cssjs.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-core/bp-core-cssjs.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -104,12 +104,11 @@
</span><span class="cx">  * @package BuddyPress Core
</span><span class="cx">  */
</span><span class="cx"> function bp_core_add_cropper_inline_css() {
</span><del>-        global $bp;
</del><span class="cx"> ?&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;style type=&quot;text/css&quot;&gt;
</span><span class="cx">                 .jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
</span><del>-                .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url( &lt;?php echo BP_PLUGIN_URL ?&gt;/bp-core/images/Jcrop.gif ); }
</del><ins>+                .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url('&lt;?php echo BP_PLUGIN_URL ?&gt;/bp-core/images/Jcrop.gif'); }
</ins><span class="cx">                 .jcrop-vline { height: 100%; width: 1px !important; }
</span><span class="cx">                 .jcrop-hline { width: 100%; height: 1px !important; }
</span><span class="cx">                 .jcrop-handle { font-size: 1px; width: 7px !important; height: 7px !important; border: 1px #eee solid; background-color: #333; *width: 9px; *height: 9px; }
</span></span></pre></div>
<a id="trunkbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-functions.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-functions.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-core/bp-core-functions.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -910,17 +910,26 @@
</span><span class="cx"> /**
</span><span class="cx">  * Are we running multiblog mode?
</span><span class="cx">  *
</span><del>- * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WP Multisite. &quot;Multiblog&quot; is
- * a BP setup that allows BP content to be viewed in the theme, and with the URL, of every blog
- * on the network. Thus, instead of having all 'boonebgorges' links go to
</del><ins>+ * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WordPress
+ * Multisite. &quot;Multiblog&quot; is BuddyPress setup that allows BuddyPress components
+ * to be viewed on every blog on the network, each with their own settings.
+ *
+ * Thus, instead of having all 'boonebgorges' links go to
</ins><span class="cx">  *   http://example.com/members/boonebgorges
</span><del>- * on the root blog, each blog will have its own version of the same profile content, eg
</del><ins>+ * on the root blog, each blog will have its own version of the same content, eg
</ins><span class="cx">  *   http://site2.example.com/members/boonebgorges (for subdomains)
</span><span class="cx">  *   http://example.com/site2/members/boonebgorges (for subdirectories)
</span><span class="cx">  *
</span><del>- * Multiblog mode is disabled by default, meaning that all BP content must be viewed on the root
- * blog.
</del><ins>+ * Multiblog mode is disabled by default, meaning that all BuddyPress content
+ * must be viewed on the root blog. It's also recommended not to use the
+ * BP_ENABLE_MULTIBLOG constant beyond 1.7, as BuddyPress can now be activated
+ * on individual sites.
</ins><span class="cx">  *
</span><ins>+ * Why would you want to use this? Originally it was intended to allow
+ * BuddyPress to live in mu-plugins and be visible on mapped domains. This is
+ * a very small use-case with large architectural shortcomings, so do not go
+ * down this road unless you specifically need to.
+ *
</ins><span class="cx">  * @package BuddyPress
</span><span class="cx">  * @since BuddyPress (1.5)
</span><span class="cx">  *
</span><span class="lines">@@ -928,7 +937,23 @@
</span><span class="cx">  * @return bool False when multiblog mode is disabled (default); true when enabled
</span><span class="cx">  */
</span><span class="cx"> function bp_is_multiblog_mode() {
</span><del>-        return apply_filters( 'bp_is_multiblog_mode', is_multisite() &amp;&amp; defined( 'BP_ENABLE_MULTIBLOG' ) &amp;&amp; BP_ENABLE_MULTIBLOG );
</del><ins>+
+        // Setup some default values
+        $retval         = false;
+        $is_multisite   = is_multisite();
+        $network_active = bp_is_network_activated();
+        $is_multiblog   = defined( 'BP_ENABLE_MULTIBLOG' ) &amp;&amp; BP_ENABLE_MULTIBLOG;
+
+        // Multisite, Network Activated, and Specifically Multiblog
+        if ( $is_multisite &amp;&amp; $network_active &amp;&amp; $is_multiblog ) {
+                $retval = true;
+
+        // Multisite, but not network activated
+        } elseif ( $is_multisite &amp;&amp; ! $network_active ) {
+                $retval = true;
+        }
+
+        return apply_filters( 'bp_is_multiblog_mode', $retval );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><span class="lines">@@ -1076,23 +1101,40 @@
</span><span class="cx">         function bp_get_admin_url( $path = '', $scheme = 'admin' ) {
</span><span class="cx"> 
</span><span class="cx">                 // Links belong in network admin
</span><del>-                if ( bp_core_do_network_admin() )
</del><ins>+                if ( bp_core_do_network_admin() ) {
</ins><span class="cx">                         $url = network_admin_url( $path, $scheme );
</span><span class="cx"> 
</span><span class="cx">                 // Links belong in site admin
</span><del>-                else
</del><ins>+                } else {
</ins><span class="cx">                         $url = admin_url( $path, $scheme );
</span><ins>+                }
</ins><span class="cx"> 
</span><span class="cx">                 return $url;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+/**
+ * Should BuddyPress appear in network admin, or site admin?
+ *
+ * Because BuddyPress can be installed in multiple ways and with multiple
+ * configurations, we need to check a few things to be confident about where
+ * to hook into certain areas of WordPress's admin.
+ *
+ * This function defaults to BuddyPress being network activated.
+ * @since BuddyPress (1.5)
+ *
+ * @uses bp_is_network_activated()
+ * @uses bp_is_multiblog_mode()
+ * @return boolean
+ */
</ins><span class="cx"> function bp_core_do_network_admin() {
</span><del>-        $do_network_admin = false;
</del><span class="cx"> 
</span><del>-        if ( is_multisite() &amp;&amp; !bp_is_multiblog_mode() )
-                $do_network_admin = true;
</del><ins>+        // Default 
+        $retval = bp_is_network_activated();
</ins><span class="cx"> 
</span><del>-        return apply_filters( 'bp_core_do_network_admin', $do_network_admin );
</del><ins>+        if ( bp_is_multiblog_mode() )
+                $retval = false;
+
+        return (bool) apply_filters( 'bp_core_do_network_admin', $retval );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_core_admin_hook() {
</span><span class="lines">@@ -1101,6 +1143,32 @@
</span><span class="cx">         return apply_filters( 'bp_core_admin_hook', $hook );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+/**
+ * Is BuddyPress active at the network level for this network?
+ *
+ * Used to determine admin menu placement, and where settings and options are
+ * stored. If you're being *really* clever and manually pulling BuddyPress in
+ * with an mu-plugin or some other method, you'll want to 
+ *
+ * @since BuddyPress (1.7)
+ * @return boolean
+ */
+function bp_is_network_activated() {
+
+        // Default to is_multisite()
+        $retval  = is_multisite();
+
+        // Check the sitewide plugins array
+        $base    = buddypress()-&gt;basename;
+        $plugins = get_site_option( 'active_sitewide_plugins' );
+
+        // Override is_multisite() if not network activated
+        if ( ! is_array( $plugins ) || ! isset( $plugins[$base] ) )
+                $retval = false;
+
+        return (bool) apply_filters( 'bp_is_network_activated', $retval );
+}
+
</ins><span class="cx"> /** Global Manipulators *******************************************************/
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkbpforumsbpforumsadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-admin.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-admin.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-forums/bp-forums-admin.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -3,7 +3,6 @@
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx"> 
</span><span class="cx"> function bp_forums_add_admin_menu() {
</span><del>-        global $bp;
</del><span class="cx"> 
</span><span class="cx">         if ( !is_super_admin() )
</span><span class="cx">                 return false;
</span><span class="lines">@@ -22,7 +21,6 @@
</span><span class="cx">  * Outputs the markup for the bb-forums-admin panel
</span><span class="cx">  */
</span><span class="cx"> function bp_forums_bbpress_admin() {
</span><del>-        global $bp;
</del><span class="cx"> 
</span><span class="cx">         // The text and URL of the Site Wide Forums button differs depending on whether bbPress
</span><span class="cx">         // is running
</span><span class="lines">@@ -109,7 +107,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_forums_bbpress_install_wizard() {
</span><del>-        $post_url                 = network_admin_url( 'admin.php?page=bb-forums-setup' );
</del><ins>+        $post_url                 = bp_get_admin_url( 'admin.php?page=bb-forums-setup' );
</ins><span class="cx">         $bbpress_plugin_is_active = false;
</span><span class="cx"> 
</span><span class="cx">         $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
</span></span></pre></div>
<a id="trunkbpforumsdeprecated16php"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/deprecated/1.6.php (6309 => 6310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/deprecated/1.6.php        2012-09-06 03:48:42 UTC (rev 6309)
+++ trunk/bp-forums/deprecated/1.6.php        2012-09-06 04:24:22 UTC (rev 6310)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_forums_bbpress_install_wizard() {
</span><del>-        $post_url = network_admin_url( 'admin.php?page=bb-forums-setup' );
</del><ins>+        $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' );
</ins><span class="cx"> 
</span><span class="cx">         $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : '';
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>