<!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->query( $wpdb->prepare( "DELETE FROM {$bp->activity->table_name} WHERE component_action = 'activity_comment' AND item_id IN ({$activity_ids})" ) );
</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 && $page )
</span><span class="lines">@@ -246,9 +246,11 @@
</span><span class="cx">                 return array( 'activities' => $activities, 'total' => (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 && $page )
</span><span class="cx">                         $pag_sql = $wpdb->prepare( "LIMIT %d, %d", 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->escape( $search_terms );
</span><del>-                        $search_sql = "AND content LIKE '%%" . like_escape( $search_terms ) . "%%'";
</del><ins>+                        $where_conditions['search_sql'] = "content LIKE '%%" . like_escape( $search_terms ) . "%%'";
</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 && $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' && $sort != 'DESC' )
</span><span class="cx">                         $sort = 'DESC';
</span><span class="cx">
</span><ins>+                /* Hide Hidden Items? */
+                if ( !$show_hidden )
+                        $where_conditions['hidden_sql'] = "hide_sitewide = 0";
+
</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[] = "component_action != 'activity_comment'";
+                        $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
+
</ins><span class="cx">                         if ( $per_page && $page && $max )
</span><del>-                                $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql}" ) );
</del><ins>+                                $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} {$where_sql} ORDER BY date_recorded {$sort} {$pag_sql}" ) );
</ins><span class="cx">                         else
</span><del>-                                $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}" ) );
</del><ins>+                                $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} {$where_sql} ORDER BY date_recorded {$sort} {$pag_sql} {$max_sql}" ) );
</ins><span class="cx">
</span><del>-                        $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} AND component_action != 'activity_comment' ORDER BY date_recorded {$sort} {$max_sql}" ) );
</del><ins>+                        $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->activity->table_name} {$where_sql} ORDER BY date_recorded {$sort} {$max_sql}" ) );
</ins><span class="cx">
</span><span class="cx">                         if ( $activities && $display_comments )
</span><span class="cx">                                 $activities = BP_Activity_Activity::append_comments( &$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->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY id {$sort}" ) );
</del><ins>+                                $all_activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} {$where_sql} ORDER BY id {$sort}" ) );
</ins><span class="cx">
</span><span class="cx">                                 foreach ( (array)$all_activities as $activity ) {
</span><span class="cx">                                         $tmp_activities[$activity->id] = $activity;
</span><span class="lines">@@ -295,7 +307,8 @@
</span><span class="cx">                                 $activity_ids = $wpdb->escape( implode( ',', $a_ids ) );
</span><span class="cx">
</span><span class="cx">                                 /* Fetch the comments for the activity items */
</span><del>-                                $all_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 AND item_id IN ({$activity_ids}) {$search_sql} ORDER BY id {$sort}" ) );
</del><ins>+                                $search_sql = $where_conditions['search_sql'];
+                                $all_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE item_id IN ({$activity_ids}) {$search_sql} ORDER BY id {$sort}" ) );
</ins><span class="cx">
</span><span class="cx">                                 foreach ( (array)$all_comments as $comment ) {
</span><span class="cx">                                         $tmp_comments[$comment->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 && $page && $max )
</span><del>-                                        $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY id {$sort} {$pag_sql}" ) );
</del><ins>+                                        $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} {$where_sql} ORDER BY id {$sort} {$pag_sql}" ) );
</ins><span class="cx">                                 else
</span><del>-                                        $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY id {$sort} {$pag_sql} {$max_sql}" ) );
</del><ins>+                                        $activities = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->activity->table_name} {$where_sql} ORDER BY id {$sort} {$pag_sql} {$max_sql}" ) );
</ins><span class="cx">
</span><del>-                                $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->activity->table_name} WHERE hide_sitewide = 0 {$search_sql} {$filter_sql} ORDER BY date_recorded {$sort} {$max_sql}" ) );
</del><ins>+                                $total_activities = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->activity->table_name} {$where_sql} ORDER BY date_recorded {$sort} {$max_sql}" ) );
</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->pag_page = isset( $_REQUEST['acpage'] ) ? intval( $_REQUEST['acpage'] ) : 1;
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">                         $this->activities = bp_activity_get_specific( array( 'activity_ids' => explode( ',', $include ), 'max' => $max, 'page' => $page, 'per_page' => $per_page, 'sort' => $sort, 'display_comments' => $display_comments ) );
</span><span class="cx">                 } else {
</span><span class="cx">                         if ( $type == 'sitewide' )
</span><del>-                                $this->activities = bp_activity_get_sitewide( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter ) );
</del><ins>+                                $this->activities = bp_activity_get_sitewide( array( 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter, 'show_hidden' => $show_hidden ) );
</ins><span class="cx">
</span><span class="cx">                         if ( $type == 'personal' )
</span><span class="cx">                                 $this->activities = bp_activity_get_for_user( array( 'user_id' => $user_id, 'display_comments' => $display_comments, 'max' => $max, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'sort' => $sort, 'search_terms' => $search_terms, 'filter' => $filter ) );
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">                 'sort' => 'DESC', // sort DESC or ASC
</span><span class="cx">                 'per_page' => 25, // number of items per page
</span><span class="cx">                 'max' => false, // max number to return
</span><ins>+                'show_hidden' => false, // Show activity items that are hidden site-wide?
</ins><span class="cx">
</span><span class="cx">                 /* Filtering */
</span><span class="cx">                 'user_id' => 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' => $object, 'action' => $action, 'primary_id' => $primary_id, 'secondary_id' => $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->has_activities(), &$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'] ) && $component_name == $_GET['afilter'] )
</span><span class="cx">                                 $selected = ' class="selected"';
</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">                          ' <a class="rss-image" href="' . bp_get_sitewide_activity_feed_link() . '" title="' . __( 'Site Wide Activity RSS Feed', 'buddypress' ) . '">' . __( '[RSS]', 'buddypress' ) . '</a>'
</span><span class="cx">                  . $after_title; ?>
</span><span class="cx">
</span><del>-        <?php if ( bp_has_activities( 'type=sitewide&max=' . $instance['max_items'] . '&per_page=' . $instance['per_page'] ) ) : ?>
</del><ins>+        <?php if ( bp_has_activities( 'type=sitewide&max=' . $instance['max_items'] . '&per_page=' . $instance['per_page'] . '&display_comments=threaded' ) ) : ?>
</ins><span class="cx">
</span><span class="cx">                 <?php if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) : ?>
</span><span class="cx">                         <div class="pagination">
</span><span class="lines">@@ -42,14 +42,36 @@
</span><span class="cx">
</span><span class="cx">                 <ul id="site-wide-stream" class="activity-list">
</span><span class="cx">                 <?php while ( bp_activities() ) : bp_the_activity(); ?>
</span><del>-                        <li class="<?php bp_activity_css_class() ?>">
-                                <?php if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) : ?>
-                                        <div class="activity-avatar">
-                                                <?php bp_activity_avatar() ?>
</del><ins>+                        <li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">
+                                <div class="activity-avatar">
+                                        <?php bp_activity_avatar('width=40&height=40') ?>
+                                </div>
+
+                                <div class="activity-content">
+                                        <?php bp_activity_content() ?>
+
+                                        <?php if ( is_user_logged_in() ) : ?>
+                                        <div class="activity-meta">
+                                                <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Comment', 'buddypress' ) ?> (<?php bp_activity_comment_count() ?>)</a>
</ins><span class="cx">                                         </div>
</span><del>-                                <?php endif; ?>
</del><ins>+                                        <?php endif; ?>
+                                </div>
</ins><span class="cx">
</span><del>-                                <?php bp_activity_content() ?>
</del><ins>+                                <div class="activity-comments">
+                                        <?php bp_activity_comments() ?>
+
+                                        <?php if ( is_user_logged_in() ) : ?>
+                                        <form action="" method="post" name="activity-comment-form" id="ac-form-<?php bp_activity_id() ?>" class="ac-form">
+                                                <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=25&height=25' ) ?></div>
+                                                <div class="ac-reply-content">
+                                                        <textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac-input-<?php bp_activity_id() ?>"></textarea>
+                                                        <input type="submit" name="ac-form-submit" value="<?php _e( 'Post', 'buddypress' ) ?> &rarr;" />
+                                                </div>
+                                                <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
+                                        </form>
+                                        <?php endif; ?>
+                                </div>
+
</ins><span class="cx">                         </li>
</span><span class="cx">                 <?php endwhile; ?>
</span><span class="cx">                 </ul>
</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' => 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' => false, // Pass search terms as a string
</span><ins>+                'show_hidden' => 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 ), &$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 ), &$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' => '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' => false, // Pass search terms as a string
</span><ins>+                'show_hidden' => false, // Show activity items that are hidden site-wide?
+
+                /* See bp_activity_get_sitewide() for filters */
</ins><span class="cx">                 'filter' => 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 ), &$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 ), &$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->current_component == BP_HOME_BLOG_SLUG )
</span><span class="cx">                 return true;
</span><span class="cx">
</span><del>-        if ( !$is_member_page && !in_array( $bp->current_component, $bp->root_components ) )
</del><ins>+        if ( is_front_page() || ( !$is_member_page && !in_array( $bp->current_component, $bp->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("#wp-admin-bar ul.main-nav li").mouseover( function() {
</span><span class="cx">                 jQuery(this).addClass('sfhover');
</span><span class="cx">         });
</span><del>-        
</del><ins>+
</ins><span class="cx">         jQuery("#wp-admin-bar ul.main-nav li").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->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->default_component = BP_XPROFILE_SLUG;
-        else
-                $bp->default_component = 'profile';
</del><ins>+        if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
+                if ( defined( 'BP_ACTIVITY_SLUG' ) )
+                        $bp->default_component = BP_ACTIVITY_SLUG;
+                else
+                        $bp->default_component = 'profile';
+        } else {
+                $bp->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->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 > $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->friendship->friend->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->friendship->friend->avatar_thumb );
</del><ins>+                $defaults = array(
+                        'type' => 'thumb',
+                        'width' => false,
+                        'height' => false,
+                        'class' => 'avatar',
+                        'id' => false,
+                        'alt' => __( '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' => $friends_template->friendship->friend->id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $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->groups->current_group->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->groups->current_group->status )
+                $hide_sitewide = false;
+        else
+                $hide_sitewide = true;
</ins><span class="cx">
</span><span class="cx">         $defaults = array(
</span><span class="cx">                 'user_id' => $bp->loggedin_user->id,
</span><span class="lines">@@ -1482,7 +1484,7 @@
</span><span class="cx">                 'item_id' => false,
</span><span class="cx">                 'secondary_item_id' => false,
</span><span class="cx">                 'recorded_time' => time(),
</span><del>-                'hide_sitewide' => false
</del><ins>+                'hide_sitewide' => $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>