<!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][6579] trunk/bp-core: See #4761:</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/6579">6579</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-12-10 06:50:12 +0000 (Mon, 10 Dec 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>See <a href="http://buddypress.trac.wordpress.org/ticket/4761">#4761</a>:
* More Credits changes...
* Update contributor avatars and metadata.
* Add update/activate redirection helpers.
* Code improvements to updater.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcorefunctionsphp">trunk/bp-core/admin/bp-core-functions.php</a></li>
<li><a href="#trunkbpcorebpcoreactionsphp">trunk/bp-core/bp-core-actions.php</a></li>
<li><a href="#trunkbpcorebpcoreadminphp">trunk/bp-core/bp-core-admin.php</a></li>
<li><a href="#trunkbpcorebpcorefunctionsphp">trunk/bp-core/bp-core-functions.php</a></li>
<li><a href="#trunkbpcorebpcoreupdatephp">trunk/bp-core/bp-core-update.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcoreadminbpcorefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-functions.php (6578 => 6579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-functions.php        2012-12-10 06:36:53 UTC (rev 6578)
+++ trunk/bp-core/admin/bp-core-functions.php        2012-12-10 06:50:12 UTC (rev 6579)
</span><span class="lines">@@ -161,11 +161,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Redirect user to bbPress's What's New page on activation
</del><ins>+ * Redirect user to BuddyPress's What's New page on activation
</ins><span class="cx"> *
</span><del>- * @since bbPress (r4389)
</del><ins>+ * @since BuddyPress (1.7)
</ins><span class="cx"> *
</span><del>- * @internal Used internally to redirect bbPress to the about page on activation
</del><ins>+ * @internal Used internally to redirect BuddyPress to the about page on activation
</ins><span class="cx"> *
</span><span class="cx"> * @uses get_transient() To see if transient to redirect exists
</span><span class="cx"> * @uses delete_transient() To delete the transient if it exists
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> * @uses add_query_arg() To help build the URL to redirect to
</span><span class="cx"> * @uses admin_url() To get the admin URL to index.php
</span><span class="cx"> *
</span><del>- * @return If no transient, or in network admin, or is bulk activation
</del><ins>+ * @return If no transient, or is bulk activation
</ins><span class="cx"> */
</span><span class="cx"> function bp_do_activation_redirect() {
</span><span class="cx">
</span><span class="lines">@@ -186,11 +186,11 @@
</span><span class="cx">         delete_transient( '_bp_activation_redirect' );
</span><span class="cx">
</span><span class="cx">         // Bail if activating from network, or bulk
</span><del>-        if ( is_network_admin() || isset( $_GET['activate-multi'] ) )
</del><ins>+        if ( isset( $_GET['activate-multi'] ) )
</ins><span class="cx">                 return;
</span><span class="cx">
</span><del>-        // Redirect to bbPress about page
-        wp_safe_redirect( add_query_arg( array( 'page' => 'bp-about' ), admin_url( 'index.php' ) ) );
</del><ins>+        // Redirect to BuddyPress about page
+        wp_safe_redirect( add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /** UI/Styling ****************************************************************/
</span></span></pre></div>
<a id="trunkbpcorebpcoreactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-actions.php (6578 => 6579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-actions.php        2012-12-10 06:36:53 UTC (rev 6578)
+++ trunk/bp-core/bp-core-actions.php        2012-12-10 06:50:12 UTC (rev 6579)
</span><span class="lines">@@ -92,3 +92,6 @@
</span><span class="cx"> if ( is_admin() ) {
</span><span class="cx">         add_action( 'bp_loaded', 'bp_admin' );
</span><span class="cx"> }
</span><ins>+
+// Activation redirect
+add_action( 'bp_activation', 'bp_add_activation_redirect' );
</ins></span></pre></div>
<a id="trunkbpcorebpcoreadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-admin.php (6578 => 6579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-admin.php        2012-12-10 06:36:53 UTC (rev 6578)
+++ trunk/bp-core/bp-core-admin.php        2012-12-10 06:50:12 UTC (rev 6579)
</span><span class="lines">@@ -374,6 +374,9 @@
</span><span class="cx">          */
</span><span class="cx">         public function about_screen() {
</span><span class="cx">
</span><ins>+                // Switch page to use for settings
+                $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php';
+
</ins><span class="cx">                 list( $display_version ) = explode( '-', bp_get_version() ); ?>
</span><span class="cx">
</span><span class="cx">                 <div class="wrap about-wrap">
</span><span class="lines">@@ -441,7 +444,7 @@
</span><span class="cx">                         </div>
</span><span class="cx">
</span><span class="cx">                         <div class="return-to-dashboard">
</span><del>-                                <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'buddypress' ), 'options-general.php' ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>
</del><ins>+                                <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $settings_page ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>
</ins><span class="cx">                         </div>
</span><span class="cx">
</span><span class="cx">                 </div>
</span><span class="lines">@@ -459,6 +462,9 @@
</span><span class="cx">          */
</span><span class="cx">         public function credits_screen() {
</span><span class="cx">
</span><ins>+                // Switch page to use for settings
+                $settings_page = bp_is_network_activated() ? 'settings.php' : 'options-general.php';
+
</ins><span class="cx">                 list( $display_version ) = explode( '-', bp_get_version() ); ?>
</span><span class="cx">
</span><span class="cx">                 <div class="wrap about-wrap">
</span><span class="lines">@@ -479,7 +485,7 @@
</span><span class="cx">                         <h4 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h4>
</span><span class="cx">                         <ul class="wp-people-group " id="wp-people-group-project-leaders">
</span><span class="cx">                                 <li class="wp-person" id="wp-person-apeatling">
</span><del>-                                        <a href="http://profiles.wordpress.org/apeatling"><img src="http://0.gravatar.com/avatar/767fc9c115a1b989744c755db47feb60?s=60" class="gravatar" alt="Andy Peatling" /></a>
</del><ins>+                                        <a href="http://profiles.wordpress.org/apeatling"><img src="http://0.gravatar.com/avatar/bb29d699b5cba218c313b61aa82249da?s=60" class="gravatar" alt="Andy Peatling" /></a>
</ins><span class="cx">                                         <a class="web" href="http://profiles.wordpress.org/apeatling">Andy Peatling</a>
</span><span class="cx">                                         <span class="title"><?php _e( 'Founding Developer', 'buddypress' ); ?></span>
</span><span class="cx">                                 </li>
</span><span class="lines">@@ -489,12 +495,12 @@
</span><span class="cx">                                         <span class="title"><?php _e( 'Project Lead', 'buddypress' ); ?></span>
</span><span class="cx">                                 </li>
</span><span class="cx">                                 <li class="wp-person" id="wp-person-boonebgorges">
</span><del>-                                        <a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Boone B. Gorges" /></a>
</del><ins>+                                        <a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60" class="gravatar" alt="Boone B. Gorges" /></a>
</ins><span class="cx">                                         <a class="web" href="http://profiles.wordpress.org/boonebgorges">Boone B. Gorges</a>
</span><span class="cx">                                         <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
</span><span class="cx">                                 </li>
</span><span class="cx">                                 <li class="wp-person" id="wp-person-djpaul">
</span><del>-                                        <a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Paul Gibbs" /></a>
</del><ins>+                                        <a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60" class="gravatar" alt="Paul Gibbs" /></a>
</ins><span class="cx">                                         <a class="web" href="http://profiles.wordpress.org/djpaul">Paul Gibbs</a>
</span><span class="cx">                                         <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
</span><span class="cx">                                 </li>
</span><span class="lines">@@ -502,40 +508,35 @@
</span><span class="cx">
</span><span class="cx">                         <h4 class="wp-people-group"><?php _e( 'Contributing Developers', 'buddypress' ); ?></h4>
</span><span class="cx">                         <ul class="wp-people-group " id="wp-people-group-contributing-developers">
</span><del>-                                <li class="wp-person" id="wp-person-jmdodd">
-                                        <a href="http://profiles.wordpress.org/jmdodd"><img src="http://0.gravatar.com/avatar/6a7c997edea340616bcc6d0fe03f65dd?s=60" class="gravatar" alt="Jennifer M. Dodd" /></a>
-                                        <a class="web" href="http://profiles.wordpress.org/jmdodd">Jennifer M. Dodd</a>
-                                        <span class="title"></span>
</del><ins>+                                <li class="wp-person" id="wp-person-r-a-y">
+                                        <a href="http://profiles.wordpress.org/r-a-y"><img src="http://0.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60" class="gravatar" alt="Ray" /></a>
+                                        <a class="web" href="http://profiles.wordpress.org/r-a-y">Ray</a>
+                                        <span class="title"><?php _e( 'Quality Officer', 'buddypress' ); ?></span>
</ins><span class="cx">                                 </li>
</span><del>-                                <li class="wp-person" id="wp-person-jaredatch">
-                                        <a href="http://profiles.wordpress.org/jaredatch"><img src="http://0.gravatar.com/avatar/e341eca9e1a85dcae7127044301b4363?s=60" class="gravatar" alt="Jared Atchison" /></a>
-                                        <a class="web" href="http://profiles.wordpress.org/jaredatch">Jared Atchison</a>
-                                        <span class="title"></span>
</del><ins>+                                <li class="wp-person" id="wp-person-karmatosed">
+                                        <a href="http://profiles.wordpress.org/karmatosed"><img src="http://0.gravatar.com/avatar/d36d2c1821af9249b69ff7f5ed60529b?s=60" class="gravatar" alt="Tammie Lister" /></a>
+                                        <a class="web" href="http://profiles.wordpress.org/karmatosed">Tammie Lister</a>
+                                        <span class="title"><?php _e( 'Mark-up Officer', 'buddypress' ); ?></span>
</ins><span class="cx">                                 </li>
</span><del>-                                <li class="wp-person" id="wp-person-gautamgupta">
-                                        <a href="http://profiles.wordpress.org/gautamgupta"><img src="http://0.gravatar.com/avatar/b0810422cbe6e4eead4def5ae7a90b34?s=60" class="gravatar" alt="Gautam Gupta" /></a>
-                                        <a class="web" href="http://profiles.wordpress.org/gautamgupta">Gautam Gupta</a>
-                                        <span class="title"></span>
</del><ins>+                                <li class="wp-person" id="wp-person-mercime">
+                                        <a href="http://profiles.wordpress.org/mercime"><img src="http://0.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60" class="gravatar" alt="Mercime" /></a>
+                                        <a class="web" href="http://profiles.wordpress.org/mercime">Mercime</a>
+                                        <span class="title"><?php _e( 'Support Officer', 'buddypress' ); ?></span>
</ins><span class="cx">                                 </li>
</span><span class="cx">                         </ul>
</span><span class="cx">
</span><span class="cx">                         <h4 class="wp-people-group"><?php _e( 'Codex Rockstars', 'buddypress' ); ?></h4>
</span><span class="cx">                         <ul class="wp-people-group " id="wp-people-group-codex-rockstars">
</span><del>-                                <li class="wp-person" id="wp-person-masonjames">
-                                        <a href="http://profiles.wordpress.org/masonjames"><img src="http://0.gravatar.com/avatar/99dee4d5287d0f9e26ff72e7228d97ac?s=60" class="gravatar" alt="Mason James" /></a>
-                                        <a class="web" href="http://profiles.wordpress.org/masonjames">Mason James</a>
-                                        <span class="title"></span>
</del><ins>+                                <li class="wp-person" id="wp-person-modemlooper">
+                                        <a href="http://profiles.wordpress.org/modemlooper"><img src="http://0.gravatar.com/avatar/1c07be1016e845de514931477c939307?s=60" class="gravatar" alt="Modemlooper" /></a>
+                                        <a class="web" href="http://profiles.wordpress.org/modemlooper">Modemlooper</a>
+                                        <span class="title"><?php _e( 'Mobile Officer', 'buddypress' ); ?></span>
</ins><span class="cx">                                 </li>
</span><del>-                                <li class="wp-person" id="wp-person-wordsforwp">
-                                        <a href="http://profiles.wordpress.org/wordsforwp"><img src="http://0.gravatar.com/avatar/5437119b446adad1af813c44944e6c9c?s=60" class="gravatar" alt="Siobhan McKeown" /></a>
-                                        <a class="web" href="http://profiles.wordpress.org/wordsforwp">Siobhan McKeown</a>
</del><ins>+                                <li class="wp-person" id="wp-person-dennissmolek">
+                                        <a href="http://profiles.wordpress.org/dennissmolek"><img src="http://0.gravatar.com/avatar/015eeb0cebb40f949d0f317e2dfe66c3?s=60" class="gravatar" alt="Dennis Smolek" /></a>
+                                        <a class="web" href="http://profiles.wordpress.org/dennissmolek">Dennis Smolek</a>
</ins><span class="cx">                                         <span class="title"></span>
</span><span class="cx">                                 </li>
</span><del>-                                <li class="wp-person" id="wp-person-JarretC">
-                                        <a href="http://profiles.wordpress.org/JarretC"><img src="http://0.gravatar.com/avatar/e00501bf782b42d5db19ff75fca14f6a?s=60" class="gravatar" alt="Jarret Cade" /></a>
-                                        <a class="web" href="http://profiles.wordpress.org/JarretC">Jarret Cade</a>
-                                        <span class="title"></span>
-                                </li>
</del><span class="cx">                         </ul>
</span><span class="cx">
</span><span class="cx">                         <h4 class="wp-people-group"><?php _e( 'Core Contributors to BuddyPress 1.7', 'buddypress' ); ?></h4>
</span><span class="lines">@@ -576,7 +577,7 @@
</span><span class="cx">                         </p>
</span><span class="cx">
</span><span class="cx">                         <div class="return-to-dashboard">
</span><del>-                                <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'buddypress' ), 'options-general.php' ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>
</del><ins>+                                <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $settings_page ) ) ); ?>"><?php _e( 'Go to Community Settings' ); ?></a>
</ins><span class="cx">                         </div>
</span><span class="cx">
</span><span class="cx">                 </div>
</span></span></pre></div>
<a id="trunkbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-functions.php (6578 => 6579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-functions.php        2012-12-10 06:36:53 UTC (rev 6578)
+++ trunk/bp-core/bp-core-functions.php        2012-12-10 06:50:12 UTC (rev 6579)
</span><span class="lines">@@ -25,12 +25,10 @@
</span><span class="cx">          * Return the BuddyPress version
</span><span class="cx">          *
</span><span class="cx">          * @since BuddyPress (1.6)
</span><del>-         * @global BuddyPress $bp
</del><span class="cx">          * @return string The BuddyPress version
</span><span class="cx">          */
</span><span class="cx">         function bp_get_version() {
</span><del>-                global $bp;
-                return $bp->version;
</del><ins>+                return buddypress()->version;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -46,12 +44,10 @@
</span><span class="cx">          * Return the BuddyPress database version
</span><span class="cx">          *
</span><span class="cx">          * @since BuddyPress (1.6)
</span><del>-         * @global BuddyPress $bp
</del><span class="cx">          * @return string The BuddyPress version
</span><span class="cx">          */
</span><span class="cx">         function bp_get_db_version() {
</span><del>-                global $bp;
-                return $bp->db_version;
</del><ins>+                return buddypress()->db_version;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -67,17 +63,11 @@
</span><span class="cx">          * Return the BuddyPress database version
</span><span class="cx">          *
</span><span class="cx">          * @since BuddyPress (1.6)
</span><del>-         * @global BuddyPress $bp
</del><span class="cx">          * @return string The BuddyPress version direct from the database
</span><span class="cx">          */
</span><span class="cx">         function bp_get_db_version_raw() {
</span><del>-                global $bp;
-
-                $retval = 0;
-                if ( !empty( $bp->db_version_raw ) )
-                        $retval = $bp->db_version_raw;
-
-                return $retval;
</del><ins>+                $bp = buddypress();
+                return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx"> /** Functions *****************************************************************/
</span></span></pre></div>
<a id="trunkbpcorebpcoreupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-update.php (6578 => 6579)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-update.php        2012-12-10 06:36:53 UTC (rev 6578)
+++ trunk/bp-core/bp-core-update.php        2012-12-10 06:50:12 UTC (rev 6579)
</span><span class="lines">@@ -11,6 +11,19 @@
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * If there is no raw DB version, this is the first installation
+ *
+ * @since BuddyPress (1.7)
+ *
+ * @uses get_option()
+ * @uses bp_get_db_version() To get BuddyPress's database version
+ * @return bool True if update, False if not
+ */
+function bp_is_install() {
+        return ! bp_get_db_version_raw();
+}
+
+/**
</ins><span class="cx"> * Compare the BuddyPress version to the DB version to determine if updating
</span><span class="cx"> *
</span><span class="cx"> * @since BuddyPress (1.6)
</span><span class="lines">@@ -41,31 +54,36 @@
</span><span class="cx"> * @return bool True if activating BuddyPress, false if not
</span><span class="cx"> */
</span><span class="cx"> function bp_is_activation( $basename = '' ) {
</span><del>-        $bp = buddypress();
</del><ins>+        $bp = buddypress();
+        $action = false;
</ins><span class="cx">
</span><del>-        $action = false;
-        if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) )
</del><ins>+        if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
</ins><span class="cx">                 $action = $_REQUEST['action'];
</span><del>-        elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) )
</del><ins>+        } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
</ins><span class="cx">                 $action = $_REQUEST['action2'];
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Bail if not activating
</span><del>-        if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) )
</del><ins>+        if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) {
</ins><span class="cx">                 return false;
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // The plugin(s) being activated
</span><del>-        if ( $action == 'activate' )
</del><ins>+        if ( $action == 'activate' ) {
</ins><span class="cx">                 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
</span><del>-        else
</del><ins>+        } else {
</ins><span class="cx">                 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Set basename if empty
</span><del>-        if ( empty( $basename ) && !empty( $bp->basename ) )
</del><ins>+        if ( empty( $basename ) && !empty( $bp->basename ) ) {
</ins><span class="cx">                 $basename = $bp->basename;
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Bail if no basename
</span><del>-        if ( empty( $basename ) )
</del><ins>+        if ( empty( $basename ) ) {
</ins><span class="cx">                 return false;
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Is BuddyPress being activated?
</span><span class="cx">         return in_array( $basename, $plugins );
</span><span class="lines">@@ -80,31 +98,36 @@
</span><span class="cx"> * @return bool True if deactivating BuddyPress, false if not
</span><span class="cx"> */
</span><span class="cx"> function bp_is_deactivation( $basename = '' ) {
</span><del>-        $bp = buddypress();
</del><ins>+        $bp = buddypress();
+        $action = false;
</ins><span class="cx">
</span><del>-        $action = false;
-        if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) )
</del><ins>+        if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) {
</ins><span class="cx">                 $action = $_REQUEST['action'];
</span><del>-        elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) )
</del><ins>+        } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) {
</ins><span class="cx">                 $action = $_REQUEST['action2'];
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Bail if not deactivating
</span><del>-        if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) )
</del><ins>+        if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) {
</ins><span class="cx">                 return false;
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // The plugin(s) being deactivated
</span><del>-        if ( $action == 'deactivate' )
</del><ins>+        if ( 'deactivate' == $action ) {
</ins><span class="cx">                 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
</span><del>-        else
</del><ins>+        } else {
</ins><span class="cx">                 $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Set basename if empty
</span><del>-        if ( empty( $basename ) && !empty( $bp->basename ) )
</del><ins>+        if ( empty( $basename ) && !empty( $bp->basename ) ) {
</ins><span class="cx">                 $basename = $bp->basename;
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Bail if no basename
</span><del>-        if ( empty( $basename ) )
</del><ins>+        if ( empty( $basename ) ) {
</ins><span class="cx">                 return false;
</span><ins>+        }
</ins><span class="cx">
</span><span class="cx">         // Is bbPress being deactivated?
</span><span class="cx">         return in_array( $basename, $plugins );
</span><span class="lines">@@ -134,19 +157,60 @@
</span><span class="cx"> function bp_setup_updater() {
</span><span class="cx">
</span><span class="cx">         // Are we running an outdated version of BuddyPress?
</span><del>-        if ( bp_is_update() ) {
</del><ins>+        if ( ! bp_is_update() )
+                return;
+        
+        bp_version_updater();
+}
</ins><span class="cx">
</span><del>-                // Bump the version
-                bp_version_bump();
</del><ins>+/**
+ * bbPress's version updater looks at what the current database version is, and
+ * runs whatever other code is needed.
+ *
+ * This is most-often used when the data schema changes, but should also be used
+ * to correct issues with bbPress meta-data silently on software update.
+ *
+ * @since bbPress (r4104)
+ */
+function bp_version_updater() {
</ins><span class="cx">
</span><del>-                // Run the deactivation function to wipe roles, caps, and rewrite rules
-                bp_deactivation();
</del><ins>+        // Get the raw database version
+        $raw_db_version = (int) bp_get_db_version_raw();
</ins><span class="cx">
</span><del>-                // Run the activation function to reset roles, caps, and rewrite rules
-                bp_activation();
</del><ins>+        /** 1.6 Branch ************************************************************/
+
+        // 1.6
+        if ( $raw_db_version < 6067 ) {
+                // Do nothing
</ins><span class="cx">         }
</span><ins>+
+        /** All done! *************************************************************/
+
+        // Bump the version
+        bp_version_bump();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Redirect user to BuddyPress's What's New page on activation
+ *
+ * @since BuddyPress (1.7)
+ *
+ * @internal Used internally to redirect BuddyPress to the about page on activation
+ *
+ * @uses set_transient() To drop the activation transient for 30 seconds
+ *
+ * @return If bulk activation
+ */
+function bp_add_activation_redirect() {
+
+        // Bail if activating from network, or bulk
+        if ( isset( $_GET['activate-multi'] ) )
+                return;
+
+        // Add the transient to redirect
+ set_transient( '_bp_activation_redirect', true, 30 );
+}
+
</ins><span class="cx"> /** Activation Actions ********************************************************/
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>
</body>
</html>