<!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] [2128] trunk: Activity stream commenting updates</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2128</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-11-25 20:38:56 +0000 (Wed, 25 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Activity stream commenting updates</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityclassesphp">trunk/bp-activity/bp-activity-classes.php</a></li>
<li><a href="#trunkbpactivitybpactivitytemplatetagsphp">trunk/bp-activity/bp-activity-templatetags.php</a></li>
<li><a href="#trunkbpactivitybpactivitywidgetsphp">trunk/bp-activity/bp-activity-widgets.php</a></li>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpcorejsadminbarjs">trunk/bp-core/js/admin-bar.js</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
<li><a href="#trunkbpfriendsbpfriendstemplatetagsphp">trunk/bp-friends/bp-friends-templatetags.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-classes.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-classes.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-activity/bp-activity-classes.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">                 return $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$bp-&gt;activity-&gt;table_name} WHERE component_action = 'activity_comment' AND item_id IN ({$activity_ids})&quot; ) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function get_activity_for_user( $user_id, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false ) {
</del><ins>+        function get_activity_for_user( $user_id, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false, $show_hidden = false ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span><span class="cx">                 if ( $limit &amp;&amp; $page )
</span><span class="lines">@@ -246,9 +246,11 @@
</span><span class="cx">                 return array( 'activities' =&gt; $activities, 'total' =&gt; (int)$total_activities );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function get_sitewide_activity( $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false ) {
</del><ins>+        function get_sitewide_activity( $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $search_terms = false, $filter = false, $display_comments = false, $show_hidden = false ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span><ins>+                $where_conditions = array();
+
</ins><span class="cx">                 if ( $per_page &amp;&amp; $page )
</span><span class="cx">                         $pag_sql = $wpdb-&gt;prepare( &quot;LIMIT %d, %d&quot;, intval( ( $page - 1 ) * $per_page ), intval( $per_page ) );
</span><span class="cx"> 
</span><span class="lines">@@ -258,25 +260,32 @@
</span><span class="cx">                 /* Searching */
</span><span class="cx">                 if ( $search_terms ) {
</span><span class="cx">                         $search_terms = $wpdb-&gt;escape( $search_terms );
</span><del>-                        $search_sql = &quot;AND content LIKE '%%&quot; . like_escape( $search_terms ) . &quot;%%'&quot;;
</del><ins>+                        $where_conditions['search_sql'] = &quot;content LIKE '%%&quot; . like_escape( $search_terms ) . &quot;%%'&quot;;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 /* Filtering */
</span><del>-                if ( $filter )
-                        $filter_sql = BP_Activity_Activity::get_filter_sql( $filter );
</del><ins>+                if ( $filter &amp;&amp; $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) )
+                        $where_conditions['filter_sql'] = $filter_sql;
</ins><span class="cx"> 
</span><span class="cx">                 /* Sorting */
</span><span class="cx">                 if ( $sort != 'ASC' &amp;&amp; $sort != 'DESC' )
</span><span class="cx">                         $sort = 'DESC';
</span><span class="cx"> 
</span><ins>+                /* Hide Hidden Items? */
+                if ( !$show_hidden )
+                        $where_conditions['hidden_sql'] = &quot;hide_sitewide = 0&quot;;
+
</ins><span class="cx">                 /* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */
</span><span class="cx">                 if ( !$display_comments || 'threaded' == $display_comments ) {
</span><ins>+                        $where_conditions[] = &quot;component_action != 'activity_comment'&quot;;
+                        $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
+
</ins><span class="cx">                         if ( $per_page &amp;&amp; $page &amp;&amp; $max )
</span><del>-                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql}&quot; ) );
</del><ins>+                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} {$where_sql} ORDER BY date_recorded {$sort} {$pag_sql}&quot; ) );
</ins><span class="cx">                         else
</span><del>-                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}&quot; ) );
</del><ins>+                                $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} {$where_sql} ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}&quot; ) );
</ins><span class="cx"> 
</span><del>-                        $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$max_sql}&quot; ) );
</del><ins>+                        $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} {$where_sql} ORDER BY date_recorded {$sort} {$max_sql}&quot; ) );
</ins><span class="cx"> 
</span><span class="cx">                         if ( $activities &amp;&amp; $display_comments )
</span><span class="cx">                                 $activities = BP_Activity_Activity::append_comments( &amp;$activities );
</span><span class="lines">@@ -285,8 +294,11 @@
</span><span class="cx">                          * If we are filtering, this is going to stop activity comments showing in the stream,
</span><span class="cx">                          * we will need to do things slightly differently.
</span><span class="cx">                          */
</span><ins>+                        if ( !empty( $where_conditions ) )
+                                $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
+
</ins><span class="cx">                          if ( !empty( $filter_sql ) ) {
</span><del>-                                $all_activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY id {$sort}&quot; ) );
</del><ins>+                                $all_activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} {$where_sql} ORDER BY id {$sort}&quot; ) );
</ins><span class="cx"> 
</span><span class="cx">                                 foreach ( (array)$all_activities as $activity ) {
</span><span class="cx">                                         $tmp_activities[$activity-&gt;id] = $activity;
</span><span class="lines">@@ -295,7 +307,8 @@
</span><span class="cx">                                 $activity_ids = $wpdb-&gt;escape( implode( ',', $a_ids ) );
</span><span class="cx"> 
</span><span class="cx">                                 /* Fetch the comments for the activity items */
</span><del>-                                $all_comments = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 AND item_id IN ({$activity_ids}) {$search_sql} ORDER BY id {$sort}&quot; ) );
</del><ins>+                                $search_sql = $where_conditions['search_sql'];
+                                $all_comments = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE item_id IN ({$activity_ids}) {$search_sql} ORDER BY id {$sort}&quot; ) );
</ins><span class="cx"> 
</span><span class="cx">                                 foreach ( (array)$all_comments as $comment ) {
</span><span class="cx">                                         $tmp_comments[$comment-&gt;id] = $comment;
</span><span class="lines">@@ -312,11 +325,11 @@
</span><span class="cx"> 
</span><span class="cx">                          } else {
</span><span class="cx">                                 if ( $per_page &amp;&amp; $page &amp;&amp; $max )
</span><del>-                                        $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY id {$sort} {$pag_sql}&quot; ) );
</del><ins>+                                        $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} {$where_sql} ORDER BY id {$sort} {$pag_sql}&quot; ) );
</ins><span class="cx">                                 else
</span><del>-                                        $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY id {$sort} {$pag_sql} {$max_sql}&quot; ) );
</del><ins>+                                        $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT * FROM {$bp-&gt;activity-&gt;table_name} {$where_sql} ORDER BY id {$sort} {$pag_sql} {$max_sql}&quot; ) );
</ins><span class="cx"> 
</span><del>-                                $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY date_recorded {$sort} {$max_sql}&quot; ) );
</del><ins>+                                $total_activities = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT count(id) FROM {$bp-&gt;activity-&gt;table_name} {$where_sql} ORDER BY date_recorded {$sort} {$max_sql}&quot; ) );
</ins><span class="cx">                          }
</span><span class="cx"> 
</span><span class="cx">                         /* Append threaded comments to those activites that have them */
</span><span class="lines">@@ -448,7 +461,7 @@
</span><span class="cx"> 
</span><span class="cx">                 if ( !empty( $filter_array['object'] ) ) {
</span><span class="cx">                         $object_filter = explode( ',', $filter_array['object'] );
</span><del>-                        $object_sql = ' AND ( ';
</del><ins>+                        $object_sql = ' ( ';
</ins><span class="cx"> 
</span><span class="cx">                         $counter = 1;
</span><span class="cx">                         foreach( (array) $object_filter as $object ) {
</span><span class="lines">@@ -461,11 +474,12 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         $object_sql .= ' )';
</span><ins>+                        $filter_sql[] = $object_sql;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ( !empty( $filter_array['action'] ) ) {
</span><span class="cx">                         $action_filter = explode( ',', $filter_array['action'] );
</span><del>-                        $action_sql = ' AND ( ';
</del><ins>+                        $action_sql = ' ( ';
</ins><span class="cx"> 
</span><span class="cx">                         $counter = 1;
</span><span class="cx">                         foreach( (array) $action_filter as $action ) {
</span><span class="lines">@@ -478,11 +492,12 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         $action_sql .= ' )';
</span><ins>+                        $filter_sql[] = $action_sql;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ( !empty( $filter_array['primary_id'] ) ) {
</span><span class="cx">                         $pid_filter = explode( ',', $filter_array['primary_id'] );
</span><del>-                        $pid_sql = ' AND ( ';
</del><ins>+                        $pid_sql = ' ( ';
</ins><span class="cx"> 
</span><span class="cx">                         $counter = 1;
</span><span class="cx">                         foreach( (array) $pid_filter as $pid ) {
</span><span class="lines">@@ -495,11 +510,12 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         $pid_sql .= ' )';
</span><ins>+                        $filter_sql[] = $pid_sql;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ( !empty( $filter_array['secondary_id'] ) ) {
</span><span class="cx">                         $sid_filter = explode( ',', $filter_array['secondary_id'] );
</span><del>-                        $sid_sql = ' AND ( ';
</del><ins>+                        $sid_sql = ' ( ';
</ins><span class="cx"> 
</span><span class="cx">                         $counter = 1;
</span><span class="cx">                         foreach( (array) $sid_filter as $sid ) {
</span><span class="lines">@@ -512,9 +528,13 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         $sid_sql .= ' )';
</span><ins>+                        $filter_sql[] = $sid_sql;
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                return $object_sql . $action_sql . $pid_sql . $sid_sql;
</del><ins>+                if ( empty($filter_sql) )
+                        return false;
+
+                return join( ' AND ', $filter_sql );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function get_last_updated() {
</span></span></pre></div>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-activity/bp-activity-templatetags.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> 
</span><span class="cx">         var $full_name;
</span><span class="cx"> 
</span><del>-        function bp_activity_template( $type, $user_id, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments ) {
</del><ins>+        function bp_activity_template( $type, $user_id, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden ) {
</ins><span class="cx">                 global $bp;
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;pag_page = isset( $_REQUEST['acpage'] ) ? intval( $_REQUEST['acpage'] ) : 1;
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">                         $this-&gt;activities = bp_activity_get_specific( array( 'activity_ids' =&gt; explode( ',', $include ), 'max' =&gt; $max, 'page' =&gt; $page, 'per_page' =&gt; $per_page, 'sort' =&gt; $sort, 'display_comments' =&gt; $display_comments ) );
</span><span class="cx">                 } else {
</span><span class="cx">                         if ( $type == 'sitewide' )
</span><del>-                                $this-&gt;activities = bp_activity_get_sitewide( array( 'display_comments' =&gt; $display_comments, 'max' =&gt; $max, 'per_page' =&gt; $this-&gt;pag_num, 'page' =&gt; $this-&gt;pag_page, 'sort' =&gt; $sort, 'search_terms' =&gt; $search_terms, 'filter' =&gt; $filter ) );
</del><ins>+                                $this-&gt;activities = bp_activity_get_sitewide( array( 'display_comments' =&gt; $display_comments, 'max' =&gt; $max, 'per_page' =&gt; $this-&gt;pag_num, 'page' =&gt; $this-&gt;pag_page, 'sort' =&gt; $sort, 'search_terms' =&gt; $search_terms, 'filter' =&gt; $filter, 'show_hidden' =&gt; $show_hidden ) );
</ins><span class="cx"> 
</span><span class="cx">                         if ( $type == 'personal' )
</span><span class="cx">                                 $this-&gt;activities = bp_activity_get_for_user( array( 'user_id' =&gt; $user_id, 'display_comments' =&gt; $display_comments, 'max' =&gt; $max, 'per_page' =&gt; $this-&gt;pag_num, 'page' =&gt; $this-&gt;pag_page, 'sort' =&gt; $sort, 'search_terms' =&gt; $search_terms, 'filter' =&gt; $filter ) );
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">                 'sort' =&gt; 'DESC', // sort DESC or ASC
</span><span class="cx">                 'per_page' =&gt; 25, // number of items per page
</span><span class="cx">                 'max' =&gt; false, // max number to return
</span><ins>+                'show_hidden' =&gt; false, // Show activity items that are hidden site-wide?
</ins><span class="cx"> 
</span><span class="cx">                 /* Filtering */
</span><span class="cx">                 'user_id' =&gt; false, // user_id to filter on
</span><span class="lines">@@ -156,7 +157,7 @@
</span><span class="cx">         else
</span><span class="cx">                 $filter = array( 'object' =&gt; $object, 'action' =&gt; $action, 'primary_id' =&gt; $primary_id, 'secondary_id' =&gt; $secondary_id );
</span><span class="cx"> 
</span><del>-        $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments );
</del><ins>+        $activities_template = new BP_Activity_Template( $type, $user_id, $per_page, $max, $include, $sort, $filter, $search_terms, $display_comments, $show_hidden );
</ins><span class="cx"> 
</span><span class="cx">         return apply_filters( 'bp_has_activities', $activities_template-&gt;has_activities(), &amp;$activities_template );
</span><span class="cx"> }
</span><span class="lines">@@ -480,6 +481,10 @@
</span><span class="cx">                         return false;
</span><span class="cx"> 
</span><span class="cx">                 foreach ( (array) $component_names as $component_name ) {
</span><ins>+                        /* Skip the activity comment filter */
+                        if ( 'activity' == $component_name )
+                                continue;
+
</ins><span class="cx">                         if ( isset( $_GET['afilter'] ) &amp;&amp; $component_name == $_GET['afilter'] )
</span><span class="cx">                                 $selected = ' class=&quot;selected&quot;';
</span><span class="cx">                         else
</span></span></pre></div>
<a id="trunkbpactivitybpactivitywidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-widgets.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-widgets.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-activity/bp-activity-widgets.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx">                          ' &lt;a class=&quot;rss-image&quot; href=&quot;' . bp_get_sitewide_activity_feed_link() . '&quot; title=&quot;' . __( 'Site Wide Activity RSS Feed', 'buddypress' ) . '&quot;&gt;' . __( '[RSS]', 'buddypress' ) . '&lt;/a&gt;'
</span><span class="cx">                    . $after_title; ?&gt;
</span><span class="cx"> 
</span><del>-        &lt;?php if ( bp_has_activities( 'type=sitewide&amp;max=' . $instance['max_items'] . '&amp;per_page=' . $instance['per_page'] ) ) : ?&gt;
</del><ins>+        &lt;?php if ( bp_has_activities( 'type=sitewide&amp;max=' . $instance['max_items'] . '&amp;per_page=' . $instance['per_page'] . '&amp;display_comments=threaded' ) ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;?php if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) : ?&gt;
</span><span class="cx">                         &lt;div class=&quot;pagination&quot;&gt;
</span><span class="lines">@@ -42,14 +42,36 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;ul id=&quot;site-wide-stream&quot; class=&quot;activity-list&quot;&gt;
</span><span class="cx">                 &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
</span><del>-                        &lt;li class=&quot;&lt;?php bp_activity_css_class() ?&gt;&quot;&gt;
-                                &lt;?php if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) : ?&gt;
-                                        &lt;div class=&quot;activity-avatar&quot;&gt;
-                                                &lt;?php bp_activity_avatar() ?&gt;
</del><ins>+                        &lt;li class=&quot;&lt;?php bp_activity_css_class() ?&gt;&quot; id=&quot;activity-&lt;?php bp_activity_id() ?&gt;&quot;&gt;
+                                &lt;div class=&quot;activity-avatar&quot;&gt;
+                                        &lt;?php bp_activity_avatar('width=40&amp;height=40') ?&gt;
+                                &lt;/div&gt;
+
+                                &lt;div class=&quot;activity-content&quot;&gt;
+                                        &lt;?php bp_activity_content() ?&gt;
+
+                                        &lt;?php if ( is_user_logged_in() ) : ?&gt;
+                                        &lt;div class=&quot;activity-meta&quot;&gt;
+                                                &lt;a href=&quot;#acomment-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;acomment-reply&quot; id=&quot;acomment-comment-&lt;?php bp_activity_id() ?&gt;&quot;&gt;&lt;?php _e( 'Comment', 'buddypress' ) ?&gt; (&lt;?php bp_activity_comment_count() ?&gt;)&lt;/a&gt;
</ins><span class="cx">                                         &lt;/div&gt;
</span><del>-                                &lt;?php endif; ?&gt;
</del><ins>+                                        &lt;?php endif; ?&gt;
+                                &lt;/div&gt;
</ins><span class="cx"> 
</span><del>-                                &lt;?php bp_activity_content() ?&gt;
</del><ins>+                                &lt;div class=&quot;activity-comments&quot;&gt;
+                                        &lt;?php bp_activity_comments() ?&gt;
+
+                                        &lt;?php if ( is_user_logged_in() ) : ?&gt;
+                                        &lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;activity-comment-form&quot; id=&quot;ac-form-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;ac-form&quot;&gt;
+                                                &lt;div class=&quot;ac-reply-avatar&quot;&gt;&lt;?php bp_loggedin_user_avatar( 'width=25&amp;height=25' ) ?&gt;&lt;/div&gt;
+                                                &lt;div class=&quot;ac-reply-content&quot;&gt;
+                                                        &lt;textarea id=&quot;ac-input-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;ac-input&quot; name=&quot;ac-input-&lt;?php bp_activity_id() ?&gt;&quot;&gt;&lt;/textarea&gt;
+                                                        &lt;input type=&quot;submit&quot; name=&quot;ac-form-submit&quot; value=&quot;&lt;?php _e( 'Post', 'buddypress' ) ?&gt; &amp;rarr;&quot; /&gt;
+                                                &lt;/div&gt;
+                                                &lt;?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?&gt;
+                                        &lt;/form&gt;
+                                        &lt;?php endif; ?&gt;
+                                &lt;/div&gt;
+
</ins><span class="cx">                         &lt;/li&gt;
</span><span class="cx">                 &lt;?php endwhile; ?&gt;
</span><span class="cx">                 &lt;/ul&gt;
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-activity.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -240,6 +240,7 @@
</span><span class="cx">                 'display_comments' =&gt; false, // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
</span><span class="cx"> 
</span><span class="cx">                 'search_terms' =&gt; false, // Pass search terms as a string
</span><ins>+                'show_hidden' =&gt; false, // Show activity items that are hidden site-wide?
</ins><span class="cx"> 
</span><span class="cx">                 /**
</span><span class="cx">                  * Pass filters as an array:
</span><span class="lines">@@ -257,7 +258,7 @@
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><del>-        return apply_filters( 'bp_activity_get_sitewide', BP_Activity_Activity::get_sitewide_activity( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments ), &amp;$r );
</del><ins>+        return apply_filters( 'bp_activity_get_sitewide', BP_Activity_Activity::get_sitewide_activity( $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden ), &amp;$r );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_get_for_user( $args = '' ) {
</span><span class="lines">@@ -272,13 +273,16 @@
</span><span class="cx">                 'display_comments' =&gt; 'stream', // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item
</span><span class="cx"> 
</span><span class="cx">                 'search_terms' =&gt; false, // Pass search terms as a string
</span><ins>+                'show_hidden' =&gt; false, // Show activity items that are hidden site-wide?
+
+                /* See bp_activity_get_sitewide() for filters */
</ins><span class="cx">                 'filter' =&gt; array()
</span><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $r, EXTR_SKIP );
</span><span class="cx"> 
</span><del>-        return apply_filters( 'bp_activity_get_for_user', BP_Activity_Activity::get_activity_for_user( $user_id, $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments ), &amp;$r );
</del><ins>+        return apply_filters( 'bp_activity_get_for_user', BP_Activity_Activity::get_activity_for_user( $user_id, $max, $page, $per_page, $sort, $search_terms, $filter, $display_comments, $show_hidden ), &amp;$r );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_get_friends_activity( $user_id, $max = 30, $max_items_per_friend = false, $pag_num = false, $pag_page = false, $filter = false ) {
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-core/bp-core-templatetags.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -463,7 +463,7 @@
</span><span class="cx">         if ( $bp-&gt;current_component == BP_HOME_BLOG_SLUG )
</span><span class="cx">                 return true;
</span><span class="cx"> 
</span><del>-        if ( !$is_member_page &amp;&amp; !in_array( $bp-&gt;current_component, $bp-&gt;root_components ) )
</del><ins>+        if ( is_front_page() || ( !$is_member_page &amp;&amp; !in_array( $bp-&gt;current_component, $bp-&gt;root_components ) ) )
</ins><span class="cx">                 return true;
</span><span class="cx"> 
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkbpcorejsadminbarjs"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/js/admin-bar.js (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/js/admin-bar.js        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-core/js/admin-bar.js        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">         jQuery(&quot;#wp-admin-bar ul.main-nav li&quot;).mouseover( function() {
</span><span class="cx">                 jQuery(this).addClass('sfhover');
</span><span class="cx">         });
</span><del>-        
</del><ins>+
</ins><span class="cx">         jQuery(&quot;#wp-admin-bar ul.main-nav li&quot;).mouseout( function() {
</span><span class="cx">                 jQuery(this).removeClass('sfhover');
</span><span class="cx">         });
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-core.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -131,10 +131,14 @@
</span><span class="cx">         $bp-&gt;is_single_item = false;
</span><span class="cx"> 
</span><span class="cx">         /* The default component to use if none are set and someone visits: http://domain.com/members/andy */
</span><del>-        if ( defined( 'BP_XPROFILE_SLUG' ) )
-                $bp-&gt;default_component = BP_XPROFILE_SLUG;
-        else
-                $bp-&gt;default_component = 'profile';
</del><ins>+        if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
+                if ( defined( 'BP_ACTIVITY_SLUG' ) )
+                        $bp-&gt;default_component = BP_ACTIVITY_SLUG;
+                else
+                        $bp-&gt;default_component = 'profile';
+        } else {
+                $bp-&gt;default_component = BP_DEFAULT_COMPONENT;
+        }
</ins><span class="cx"> 
</span><span class="cx">         /* Sets up the array container for the component navigation rendered by bp_get_nav() */
</span><span class="cx">         $bp-&gt;bp_nav = array();
</span><span class="lines">@@ -1336,8 +1340,9 @@
</span><span class="cx">         /* Difference in seconds */
</span><span class="cx">         $since = $newer_date - $older_date;
</span><span class="cx"> 
</span><ins>+        /* Something went wrong with date calculation and we ended up with a negative date. */
</ins><span class="cx">         if ( 0 &gt; $since )
</span><del>-                return __( '[Use GMT Timezone]', 'buddypress' );
</del><ins>+                return __( 'sometime', 'buddypress' );
</ins><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * We only want to output two chunks of time here, eg:
</span></span></pre></div>
<a id="trunkbpfriendsbpfriendstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends/bp-friends-templatetags.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends/bp-friends-templatetags.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-friends/bp-friends-templatetags.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -193,13 +193,25 @@
</span><span class="cx">                 return apply_filters( 'bp_get_friend_id', $friends_template-&gt;friendship-&gt;friend-&gt;user_id );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-function bp_friend_avatar_thumb() {
-        echo bp_get_friend_avatar_thumb();
</del><ins>+function bp_friend_avatar_thumb( $args = '' ) {
+        echo bp_get_friend_avatar_thumb( $args );
</ins><span class="cx"> }
</span><del>-        function bp_get_friend_avatar_thumb() {
-                global $friends_template;
</del><ins>+        function bp_get_friend_avatar_thumb( $args = '' ) {
+                global $bp, $friends_template;
</ins><span class="cx"> 
</span><del>-                return apply_filters( 'bp_get_friend_avatar_thumb', $friends_template-&gt;friendship-&gt;friend-&gt;avatar_thumb );
</del><ins>+                $defaults = array(
+                        'type' =&gt; 'thumb',
+                        'width' =&gt; false,
+                        'height' =&gt; false,
+                        'class' =&gt; 'avatar',
+                        'id' =&gt; false,
+                        'alt' =&gt; __( 'Group avatar', 'buddypress' )
+                );
+
+                $r = wp_parse_args( $args, $defaults );
+                extract( $r, EXTR_SKIP );
+
+                return apply_filters( 'bp_get_friend_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' =&gt; $friends_template-&gt;friendship-&gt;friend-&gt;id, 'type' =&gt; $type, 'alt' =&gt; $alt, 'width' =&gt; $width, 'height' =&gt; $height, 'class' =&gt; $class ) ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_friend_name() {
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2127 => 2128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-11-25 20:35:57 UTC (rev 2127)
+++ trunk/bp-groups.php        2009-11-25 20:38:56 UTC (rev 2128)
</span><span class="lines">@@ -1469,9 +1469,11 @@
</span><span class="cx">         if ( !function_exists( 'bp_activity_add' ) )
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        /* If the group is not public, no recording of activity please. */
-        if ( 'public' != $bp-&gt;groups-&gt;current_group-&gt;status )
-                return false;
</del><ins>+        /* If the group is not public, hide the activity sitewide, or basically when not looking at the group feed. */
+        if ( 'public' == $bp-&gt;groups-&gt;current_group-&gt;status )
+                $hide_sitewide = false;
+        else
+                $hide_sitewide = true;
</ins><span class="cx"> 
</span><span class="cx">         $defaults = array(
</span><span class="cx">                 'user_id' =&gt; $bp-&gt;loggedin_user-&gt;id,
</span><span class="lines">@@ -1482,7 +1484,7 @@
</span><span class="cx">                 'item_id' =&gt; false,
</span><span class="cx">                 'secondary_item_id' =&gt; false,
</span><span class="cx">                 'recorded_time' =&gt; time(),
</span><del>-                'hide_sitewide' =&gt; false
</del><ins>+                'hide_sitewide' =&gt; $hide_sitewide
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span></span></pre>
</div>
</div>

</body>
</html>