<!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] [2761] trunk: Merging 1.2 branch into trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2761</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-02-22 13:25:56 +0000 (Mon, 22 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merging 1.2 branch into trunk</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpblogsbpblogsclassesphp">trunk/bp-blogs/bp-blogs-classes.php</a></li>
<li><a href="#trunkbpblogsphp">trunk/bp-blogs.php</a></li>
<li><a href="#trunkbpcorebpcorewpabstractionphp">trunk/bp-core/bp-core-wpabstraction.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
<li><a href="#trunkbpforumsbpforumstemplatetagsphp">trunk/bp-forums/bp-forums-templatetags.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpmessagesphp">trunk/bp-messages.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityentryphp">trunk/bp-themes/bp-default/activity/entry.php</a></li>
<li><a href="#trunkbpthemesbpdefaultfunctionsphp">trunk/bp-themes/bp-default/functions.php</a></li>
<li><a href="#trunkbpxprofilephp">trunk/bp-xprofile.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-activity/bp-activity-templatetags.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -190,9 +190,9 @@
</span><span class="cx">                 if ( 'just-me' == $scope )
</span><span class="cx">                         $display_comments = 'stream';
</span><span class="cx"> 
</span><del>-                $show_hidden = ( $user_id == $bp-&gt;loggedin_user-&gt;id ) ? 1 : 0;
</del><ins>+                if ( $user_id = ( !empty( $bp-&gt;displayed_user-&gt;id ) ) ? $bp-&gt;displayed_user-&gt;id : $bp-&gt;loggedin_user-&gt;id ) {
+                        $show_hidden = ( $user_id == $bp-&gt;loggedin_user-&gt;id ) ? 1 : 0;
</ins><span class="cx"> 
</span><del>-                if ( $user_id = ( !empty( $bp-&gt;displayed_user-&gt;id ) ) ? $bp-&gt;displayed_user-&gt;id : $bp-&gt;loggedin_user-&gt;id ) {
</del><span class="cx">                         switch ( $scope ) {
</span><span class="cx">                                 case 'friends':
</span><span class="cx">                                         if ( function_exists( 'friends_get_friend_user_ids' ) )
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx">                                 case 'mentions':
</span><span class="cx">                                         $user_nicename = ( !empty( $bp-&gt;displayed_user-&gt;id ) ) ? $bp-&gt;displayed_user-&gt;userdata-&gt;user_nicename : $bp-&gt;loggedin_user-&gt;userdata-&gt;user_nicename;
</span><span class="cx">                                         $user_login = ( !empty( $bp-&gt;displayed_user-&gt;id ) ) ? $bp-&gt;displayed_user-&gt;userdata-&gt;user_login : $bp-&gt;loggedin_user-&gt;userdata-&gt;user_login;
</span><del>-                                        $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login );
</del><ins>+                                        $search_terms = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login ) . '&lt;'; // Start search at @ symbol and stop search at closing tag delimiter.
</ins><span class="cx">                                         $display_comments = 'stream';
</span><span class="cx">                                         $user_id = false;
</span><span class="cx">                                         break;
</span><span class="lines">@@ -459,6 +459,15 @@
</span><span class="cx">                 return apply_filters( 'bp_get_activity_content_body', $activities_template-&gt;activity-&gt;content, &amp;$activities_template-&gt;activity );
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        function bp_activity_has_content() {
+                global $activities_template;
+
+                if ( !empty( $activities_template-&gt;activity-&gt;content ) )
+                        return true;
+
+                return false;
+        }
+
</ins><span class="cx"> function bp_activity_content() {
</span><span class="cx">         echo bp_get_activity_content();
</span><span class="cx"> }
</span><span class="lines">@@ -573,7 +582,7 @@
</span><span class="cx">                                         $content .= '&lt;span class=&quot;acomment-replylink&quot;&gt; &amp;middot; &lt;a href=&quot;#acomment-' . $comment-&gt;id . '&quot; class=&quot;acomment-reply&quot; id=&quot;acomment-reply-' . $activities_template-&gt;activity-&gt;id . '&quot;&gt;' . __( 'Reply', 'buddypress' ) . '&lt;/a&gt;&lt;/span&gt;';
</span><span class="cx"> 
</span><span class="cx">                                 /* Delete link */
</span><del>-                                if ( is_site_admin() || $bp-&gt;loggedin_user-&gt;id == $comment-&gt;user_id )
</del><ins>+                                if ( $bp-&gt;loggedin_user-&gt;is_site_admin || $bp-&gt;loggedin_user-&gt;id == $comment-&gt;user_id )
</ins><span class="cx">                                         $content .= ' &amp;middot; &lt;a href=&quot;' . wp_nonce_url( $bp-&gt;root_domain . '/' . $bp-&gt;activity-&gt;slug . '/delete/?cid=' . $comment-&gt;id, 'bp_activity_delete_link' ) . '&quot; class=&quot;delete acomment-delete&quot;&gt;' . __( 'Delete', 'buddypress' ) . '&lt;/a&gt;';
</span><span class="cx"> 
</span><span class="cx">                                 $content .= '&lt;/div&gt;';
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-activity.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> function bp_activity_check_installed() {
</span><span class="cx">         global $wpdb, $bp;
</span><span class="cx"> 
</span><del>-        if ( $bp-&gt;site_options['bp-activity-db-version'] &lt; BP_ACTIVITY_DB_VERSION )
</del><ins>+        if ( get_site_option( 'bp-activity-db-version' ) &lt; BP_ACTIVITY_DB_VERSION )
</ins><span class="cx">                 bp_activity_install();
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'bp_activity_check_installed' );
</span><span class="lines">@@ -588,7 +588,7 @@
</span><span class="cx">         if ( 1 == (int)$page &amp;&amp; empty( $max ) &amp;&amp; empty( $search_terms ) &amp;&amp; empty( $filter ) &amp;&amp; 'DESC' == $sort ) {
</span><span class="cx">                 if ( !$activity = wp_cache_get( 'bp_activity_sitewide_front', 'bp' ) ) {
</span><span class="cx">                         $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
</span><del>-                        wp_cache_set( 'bp_activity_sitewide_front', BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden ), 'bp' );
</del><ins>+                        wp_cache_set( 'bp_activity_sitewide_front', $activity, 'bp' );
</ins><span class="cx">                 }
</span><span class="cx">         } else
</span><span class="cx">                 $activity = BP_Activity_Activity::get( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden );
</span><span class="lines">@@ -1011,6 +1011,8 @@
</span><span class="cx">         update_usermeta( $bp-&gt;loggedin_user-&gt;id, 'bp_favorite_activities', $my_favs );
</span><span class="cx">         bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
</span><span class="cx"> 
</span><ins>+        do_action( 'bp_activity_add_user_favorite', $activity_id, $user_id );
+
</ins><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1036,6 +1038,8 @@
</span><span class="cx"> 
</span><span class="cx">         update_usermeta( $user_id, 'bp_favorite_activities', $my_favs );
</span><span class="cx"> 
</span><ins>+        do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id );
+
</ins><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1109,7 +1113,7 @@
</span><span class="cx">         if ( empty($metas) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        $metas = array_map( 'maybe_unserialize', $metas );
</del><ins>+        $metas = array_map( 'maybe_unserialize', (array)$metas );
</ins><span class="cx"> 
</span><span class="cx">         if ( 1 == count($metas) )
</span><span class="cx">                 return $metas[0];
</span></span></pre></div>
<a id="trunkbpblogsbpblogsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs/bp-blogs-classes.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs/bp-blogs-classes.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-blogs/bp-blogs-classes.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -209,10 +209,10 @@
</span><span class="cx">                         $user_id = $bp-&gt;displayed_user-&gt;id;
</span><span class="cx"> 
</span><span class="cx">                 // If the user is logged in return the blog count including their hidden blogs.
</span><del>-                if ( !is_user_logged_in() || $user_id != $bp-&gt;loggedin_user-&gt;id )
</del><ins>+                if ( ( is_user_logged_in() &amp;&amp; $user_id == $bp-&gt;loggedin_user-&gt;id ) || is_site_admin() )
+                        return $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT(DISTINCT b.blog_id) FROM {$bp-&gt;blogs-&gt;table_name} b LEFT JOIN {$wpdb-&gt;base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d&quot;, $user_id) );
+                else
</ins><span class="cx">                         return $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT(DISTINCT b.blog_id) FROM {$bp-&gt;blogs-&gt;table_name} b LEFT JOIN {$wpdb-&gt;base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d&quot;, $user_id) );
</span><del>-                else
-                        return $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT(DISTINCT b.blog_id) FROM {$bp-&gt;blogs-&gt;table_name} b LEFT JOIN {$wpdb-&gt;base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d&quot;, $user_id) );
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function search_blogs( $filter, $limit = null, $page = null ) {
</span></span></pre></div>
<a id="trunkbpblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-blogs.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-blogs.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-blogs.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><del>-define ( 'BP_BLOGS_DB_VERSION', '2000' );
</del><ins>+define ( 'BP_BLOGS_DB_VERSION', '2015' );
</ins><span class="cx"> 
</span><span class="cx"> /* Define the slug for the component */
</span><span class="cx"> if ( !defined( 'BP_BLOGS_SLUG' ) )
</span><span class="lines">@@ -52,13 +52,13 @@
</span><span class="cx">                          ) {$charset_collate};&quot;;
</span><span class="cx"> 
</span><span class="cx">         $sql[] = &quot;CREATE TABLE {$bp-&gt;blogs-&gt;table_name_blogmeta} (
</span><del>-                        id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
-                        blog_id bigint(20) NOT NULL,
-                        meta_key varchar(255) DEFAULT NULL,
-                        meta_value longtext DEFAULT NULL,
-                        KEY blog_id (blog_id),
-                        KEY meta_key (meta_key)
-                   ) {$charset_collate};&quot;;
</del><ins>+                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+                                blog_id bigint(20) NOT NULL,
+                                meta_key varchar(255) DEFAULT NULL,
+                                meta_value longtext DEFAULT NULL,
+                                KEY blog_id (blog_id),
+                                KEY meta_key (meta_key)
+                     ) {$charset_collate};&quot;;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">         require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">         /* Only create the bp-blogs tables if this is a multisite install */
</span><span class="cx">         if ( is_site_admin() &amp;&amp; bp_core_is_multisite() ) {
</span><span class="cx">                 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
</span><del>-                if ( $bp-&gt;site_options['bp-blogs-db-version'] &lt; BP_BLOGS_DB_VERSION )
</del><ins>+                if ( get_site_option( 'bp-blogs-db-version' ) &lt; BP_BLOGS_DB_VERSION )
</ins><span class="cx">                         bp_blogs_install();
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -332,10 +332,13 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> function bp_blogs_record_existing_blogs() {
</span><del>-        global $wpdb;
</del><ins>+        global $bp, $wpdb;
</ins><span class="cx"> 
</span><del>-        $blog_ids = $wpdb-&gt;get_col( $wpdb-&gt;prepare( &quot;SELECT blog_id FROM {$wpdb-&gt;base_prefix}blogs WHERE public = 1 AND mature = 0 AND spam = 0 AND deleted = 0&quot; ) );
</del><ins>+        /* Truncate user blogs table and re-record. */
+        $wpdb-&gt;query( &quot;TRUNCATE TABLE {$bp-&gt;blogs-&gt;table_name}&quot; );
</ins><span class="cx"> 
</span><ins>+        $blog_ids = $wpdb-&gt;get_col( $wpdb-&gt;prepare( &quot;SELECT blog_id FROM {$wpdb-&gt;base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0&quot; ) );
+
</ins><span class="cx">         if ( $blog_ids ) {
</span><span class="cx">                 foreach( (array)$blog_ids as $blog_id ) {
</span><span class="cx">                         $users = get_users_of_blog( $blog_id );
</span><span class="lines">@@ -361,6 +364,9 @@
</span><span class="cx">         $name = get_blog_option( $blog_id, 'blogname' );
</span><span class="cx">         $description = get_blog_option( $blog_id, 'blogdescription' );
</span><span class="cx"> 
</span><ins>+        if ( empty( $name ) )
+                return false;
+
</ins><span class="cx">         $recorded_blog = new BP_Blogs_Blog;
</span><span class="cx">         $recorded_blog-&gt;user_id = $user_id;
</span><span class="cx">         $recorded_blog-&gt;blog_id = $blog_id;
</span><span class="lines">@@ -544,14 +550,23 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_set_comment_status', 'bp_blogs_manage_comment', 10, 2 );
</span><span class="cx"> 
</span><del>-function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id ) {
-        if ( $role != 'subscriber' ) {
</del><ins>+function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id = false ) {
+        global $current_blog;
+
+        if ( empty( $blog_id ) )
+                $blog_id = $current_blog-&gt;blog_id;
+
+        if ( $role != 'subscriber' )
</ins><span class="cx">                 bp_blogs_record_blog( $blog_id, $user_id, true );
</span><del>-        }
</del><span class="cx"> }
</span><span class="cx"> add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 );
</span><span class="cx"> 
</span><del>-function bp_blogs_remove_user_from_blog( $user_id, $blog_id ) {
</del><ins>+function bp_blogs_remove_user_from_blog( $user_id, $blog_id = false ) {
+        global $current_blog;
+
+        if ( empty( $blog_id ) )
+                $blog_id = $current_blog-&gt;blog_id;
+
</ins><span class="cx">         bp_blogs_remove_blog_for_user( $user_id, $blog_id );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 );
</span><span class="lines">@@ -773,7 +788,7 @@
</span><span class="cx">                         return '';
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $metas = array_map('maybe_unserialize', $metas);
</del><ins>+        $metas = array_map('maybe_unserialize', (array)$metas);
</ins><span class="cx"> 
</span><span class="cx">         if ( 1 == count($metas) )
</span><span class="cx">                 return $metas[0];
</span></span></pre></div>
<a id="trunkbpcorebpcorewpabstractionphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-wpabstraction.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-wpabstraction.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-core/bp-core-wpabstraction.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -96,7 +96,6 @@
</span><span class="cx"> 
</span><span class="cx">                 $errors = new WP_Error();
</span><span class="cx"> 
</span><del>-                $user_name = preg_replace( &quot;/\s+/&quot;, '', sanitize_user( $user_name, true ) );
</del><span class="cx">                 $user_email = sanitize_email( $user_email );
</span><span class="cx"> 
</span><span class="cx">                 if ( empty( $user_name ) )
</span><span class="lines">@@ -105,17 +104,14 @@
</span><span class="cx">                 $maybe = array();
</span><span class="cx">                 preg_match( &quot;/[a-z0-9]+/&quot;, $user_name, $maybe );
</span><span class="cx"> 
</span><del>-                if( $user_name != $maybe[0] ) {
-                    $errors-&gt;add('user_name', __(&quot;Only lowercase letters and numbers allowed&quot;));
-                }
-
</del><span class="cx">                 $illegal_names = get_site_option( &quot;illegal_names&quot; );
</span><span class="cx">                 if( is_array( $illegal_names ) == false ) {
</span><span class="cx">                         $illegal_names = array(  &quot;www&quot;, &quot;web&quot;, &quot;root&quot;, &quot;admin&quot;, &quot;main&quot;, &quot;invite&quot;, &quot;administrator&quot; );
</span><span class="cx">                         add_site_option( &quot;illegal_names&quot;, $illegal_names );
</span><span class="cx">                 }
</span><del>-                if( in_array( $user_name, $illegal_names ) == true ) {
-                    $errors-&gt;add('user_name',  __(&quot;That username is not allowed&quot;));
</del><ins>+
+                if ( !validate_username( $user_name ) || in_array( $user_name, $illegal_names ) == true || $user_name != $maybe[0] ) {
+                    $errors-&gt;add('user_name', __(&quot;Only lowercase letters and numbers allowed&quot;));
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if( strlen( $user_name ) &lt; 4 ) {
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-core.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -106,6 +106,9 @@
</span><span class="cx">         /* The core userdata of the user who is currently logged in. */
</span><span class="cx">         $bp-&gt;loggedin_user-&gt;userdata = bp_core_get_core_userdata( $bp-&gt;loggedin_user-&gt;id );
</span><span class="cx"> 
</span><ins>+        /* is_site_admin() hits the DB on single WP installs, so we need to get this separately so we can call it in a loop. */
+        $bp-&gt;loggedin_user-&gt;is_site_admin = is_site_admin();
+
</ins><span class="cx">         /* The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php */
</span><span class="cx">         $bp-&gt;displayed_user-&gt;id = $displayed_user_id;
</span><span class="cx"> 
</span><span class="lines">@@ -266,7 +269,7 @@
</span><span class="cx">         require ( BP_PLUGIN_DIR . '/bp-core/bp-core-admin.php' );
</span><span class="cx"> 
</span><span class="cx">         /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
</span><del>-        if ( $bp-&gt;site_options['bp-core-db-version'] &lt; BP_CORE_DB_VERSION )
</del><ins>+        if ( get_site_option( 'bp-core-db-version' ) &lt; BP_CORE_DB_VERSION )
</ins><span class="cx">                 bp_core_install();
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'bp_core_check_installed' );
</span><span class="lines">@@ -1559,13 +1562,6 @@
</span><span class="cx">         global $bp, $wpdb;
</span><span class="cx"> 
</span><span class="cx">         $options = apply_filters( 'bp_core_site_options', array(
</span><del>-                'bp-core-db-version',
-                'bp-activity-db-version',
-                'bp-blogs-db-version',
-                'bp-friends-db-version',
-                'bp-groups-db-version',
-                'bp-messages-db-version',
-                'bp-xprofile-db-version',
</del><span class="cx">                 'bp-deactivated-components',
</span><span class="cx">                 'bp-blogs-first-install',
</span><span class="cx">                 'bp-disable-blog-forum-comments',
</span><span class="lines">@@ -2047,9 +2043,10 @@
</span><span class="cx">                 /* Get current theme info */
</span><span class="cx">                 $ct = current_theme_info();
</span><span class="cx"> 
</span><del>-                if ( !in_array( 'buddypress', (array)$ct-&gt;tags ) ) { ?&gt;
</del><ins>+                /* The best way to remove this notice is to add a &quot;buddypress&quot; tag to your active theme's CSS header. */
+                if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) &amp;&amp; !in_array( 'buddypress', (array)$ct-&gt;tags ) ) { ?&gt;
</ins><span class="cx">                         &lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;
</span><del>-                                &lt;p style=&quot;line-height: 150%&quot;&gt;&lt;?php printf( __( &quot;&lt;strong&gt;BuddyPress is ready&lt;/strong&gt;. You'll need to &lt;a href='%s'&gt;activate a BuddyPress compatible theme&lt;/a&gt; to take advantage of all of the features. We've bundled a default theme, but you can always &lt;a href='%s'&gt;install some other compatible themes&lt;/a&gt;.&quot;, 'buddypress' ), admin_url( 'themes.php' ), admin_url( 'theme-install.php?type=tag&amp;s=buddypress&amp;tab=search' ) ) ?&gt;&lt;/p&gt;
</del><ins>+                                &lt;p style=&quot;line-height: 150%&quot;&gt;&lt;?php printf( __( &quot;&lt;strong&gt;BuddyPress is ready&lt;/strong&gt;. You'll need to &lt;a href='%s'&gt;activate a BuddyPress compatible theme&lt;/a&gt; to take advantage of all of the features. We've bundled a default theme, but you can always &lt;a href='%s'&gt;install some other compatible themes&lt;/a&gt; or &lt;a href='%s'&gt;upgrade your existing WordPress theme&lt;/a&gt;.&quot;, 'buddypress' ), admin_url( 'themes.php' ), admin_url( 'theme-install.php?type=tag&amp;s=buddypress&amp;tab=search' ), admin_url( 'plugin-install.php?type=term&amp;tab=search&amp;s=bp-template-pack' ) ) ?&gt;&lt;/p&gt;
</ins><span class="cx">                         &lt;/div&gt;&lt;?php
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpforumsbpforumstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-templatetags.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-templatetags.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-forums/bp-forums-templatetags.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -881,7 +881,7 @@
</span><span class="cx">         function bp_get_the_topic_post_poster_link() {
</span><span class="cx">                 global $topic_template;
</span><span class="cx"> 
</span><del>-                return apply_filters( 'bp_get_the_topic_post_poster_name', bp_core_get_user_domain( $topic_template-&gt;post-&gt;poster_id, $topic_template-&gt;post-&gt;poster_nicename, $topic_template-&gt;post-&gt;poster_login ) );
</del><ins>+                return apply_filters( 'bp_the_topic_post_poster_link', bp_core_get_user_domain( $topic_template-&gt;post-&gt;poster_id, $topic_template-&gt;post-&gt;poster_nicename, $topic_template-&gt;post-&gt;poster_login ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_the_topic_post_time_since() {
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-friends.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
</span><del>-        if ( $bp-&gt;site_options['bp-friends-db-version'] &lt; BP_FRIENDS_DB_VERSION )
</del><ins>+        if ( get_site_option( 'bp-friends-db-version' ) &lt; BP_FRIENDS_DB_VERSION )
</ins><span class="cx">                 friends_install();
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'friends_check_installed' );
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-groups/bp-groups-classes.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -1164,7 +1164,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         /* Register the group extension on the plugins_loaded action so we have access to all plugins */
</span><del>-        add_action( 'plugins_loaded', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( &quot;wp&quot;, array( &amp;$extension, &quot;_register&quot; ), 2 );' ) );
</del><ins>+        add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( &quot;wp&quot;, array( &amp;$extension, &quot;_register&quot; ), 2 );' ), 11 );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-groups.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> 
</span><span class="cx"> function groups_check_installed() {
</span><span class="cx">         /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
</span><del>-        if ( $bp-&gt;site_options['bp-groups-db-version'] &lt; BP_GROUPS_DB_VERSION )
</del><ins>+        if ( get_site_option( 'bp-groups-db-version' ) &lt; BP_GROUPS_DB_VERSION )
</ins><span class="cx">                 groups_install();
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'groups_check_installed' );
</span><span class="lines">@@ -1295,7 +1295,7 @@
</span><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><del>-        extract( $r, EXTR_SKIP );
</del><ins>+        extract( $r );
</ins><span class="cx"> 
</span><span class="cx">         return bp_activity_add( array( 'id' =&gt; $id, 'user_id' =&gt; $user_id, 'action' =&gt; $action, 'content' =&gt; $content, 'primary_link' =&gt; $primary_link, 'component' =&gt; $component, 'type' =&gt; $type, 'item_id' =&gt; $item_id, 'secondary_item_id' =&gt; $secondary_item_id, 'recorded_time' =&gt; $recorded_time, 'hide_sitewide' =&gt; $hide_sitewide ) );
</span><span class="cx"> }
</span><span class="lines">@@ -2450,7 +2450,7 @@
</span><span class="cx">                         return '';
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $metas = array_map('maybe_unserialize', $metas);
</del><ins>+        $metas = array_map('maybe_unserialize', (array)$metas);
</ins><span class="cx"> 
</span><span class="cx">         if ( 1 == count($metas) )
</span><span class="cx">                 return $metas[0];
</span></span></pre></div>
<a id="trunkbpmessagesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-messages.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
</span><del>-        if ( $bp-&gt;site_options['bp-messages-db-version'] &lt; BP_MESSAGES_DB_VERSION )
</del><ins>+        if ( get_site_option( 'bp-messages-db-version' ) &lt; BP_MESSAGES_DB_VERSION )
</ins><span class="cx">                 messages_install();
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'messages_check_installed' );
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityentryphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/entry.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/entry.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-themes/bp-default/activity/entry.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">                         &lt;?php bp_activity_action() ?&gt;
</span><span class="cx">                 &lt;/div&gt;
</span><span class="cx"> 
</span><del>-                &lt;?php if ( bp_get_activity_content_body() ) : ?&gt;
</del><ins>+                &lt;?php if ( bp_activity_has_content() ) : ?&gt;
</ins><span class="cx">                         &lt;div class=&quot;activity-inner&quot;&gt;
</span><span class="cx">                                 &lt;?php bp_activity_content_body() ?&gt;
</span><span class="cx">                         &lt;/div&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/functions.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/functions.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-themes/bp-default/functions.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx"> 
</span><span class="cx"> /****
</span><span class="cx">  * Custom header image support. You can remove this entirely in a child theme by adding this line
</span><del>- * to your functions.php: remove_action( 'init', 'bp_dtheme_add_custom_header_support' );
</del><ins>+ * to your functions.php: define( 'BP_DTHEME_DISABLE_CUSTOM_HEADER', true );
</ins><span class="cx">  */
</span><span class="cx"> function bp_dtheme_add_custom_header_support() {
</span><span class="cx">         /* Set the defaults for the custom header image (http://ryan.boren.me/2007/01/07/custom-image-header-api/) */
</span><span class="lines">@@ -199,7 +199,8 @@
</span><span class="cx">         }
</span><span class="cx">         add_custom_image_header( 'bp_dtheme_header_style', 'bp_dtheme_admin_header_style' );
</span><span class="cx"> }
</span><del>-add_action( 'init', 'bp_dtheme_add_custom_header_support' );
</del><ins>+if ( !defined( 'BP_DTHEME_DISABLE_CUSTOM_HEADER' ) )
+        add_action( 'init', 'bp_dtheme_add_custom_header_support' );
</ins><span class="cx"> 
</span><span class="cx"> /* Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html) */
</span><span class="cx"> function bp_dtheme_show_notice() { ?&gt;
</span><span class="lines">@@ -229,11 +230,4 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_footer', 'bp_dtheme_js_terms' );
</span><span class="cx"> 
</span><del>-//Google Maps Shortcode
-function fn_googleMaps($atts, $content = null) {
-        extract( shortcode_atts( array( &quot;width&quot; =&gt; '640', &quot;height&quot; =&gt; '480', &quot;src&quot; =&gt; '' ), $atts ) );
-        return '&lt;iframe width=&quot;'.$width.'&quot; height=&quot;'.$height.'&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; src=&quot;'.$src.'&quot;&gt;&lt;/iframe&gt;';
-}
-add_shortcode( &quot;googlemap&quot;, &quot;fn_googleMaps&quot; );
-
</del><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpxprofilephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile.php (2760 => 2761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile.php        2010-02-22 13:15:44 UTC (rev 2760)
+++ trunk/bp-xprofile.php        2010-02-22 13:25:56 UTC (rev 2761)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx">         add_submenu_page( 'bp-general-settings', __(&quot;Profile Field Setup&quot;, 'buddypress'), __(&quot;Profile Field Setup&quot;, 'buddypress'), 'manage_options', 'bp-profile-setup', &quot;xprofile_admin&quot; );
</span><span class="cx"> 
</span><span class="cx">         /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
</span><del>-        if ( $bp-&gt;site_options['bp-xprofile-db-version'] &lt; BP_XPROFILE_DB_VERSION )
</del><ins>+        if ( get_site_option( 'bp-xprofile-db-version' ) &lt; BP_XPROFILE_DB_VERSION )
</ins><span class="cx">                 xprofile_install();
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'xprofile_add_admin_menu' );
</span></span></pre>
</div>
</div>

</body>
</html>