<!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] [2217] trunk:
  Removing activity comment posting logic from the theme, where it doesn'
 t belong.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2217</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-12-27 15:05:26 +0000 (Sun, 27 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Removing activity comment posting logic from the theme, where it doesn't belong. Removing duplication of activity item template.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityactivityloopphp">trunk/bp-themes/bp-default/activity/activity-loop.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityentryphp">trunk/bp-themes/bp-default/activity/entry.php</a></li>
<li><a href="#trunkbpxprofilephp">trunk/bp-xprofile.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2216 => 2217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2009-12-27 14:46:30 UTC (rev 2216)
+++ trunk/bp-activity.php        2009-12-27 15:05:26 UTC (rev 2217)
</span><span class="lines">@@ -395,6 +395,42 @@
</span><span class="cx">         return $activity-&gt;id;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function bp_activity_new_comment( $args = '' ) {
+        global $bp;
+
+        $defaults = array(
+                'content' =&gt; false,
+                'user_id' =&gt; $bp-&gt;loggedin_user-&gt;id,
+                'activity_id' =&gt; false, // ID of the root activity item
+                'parent_id' =&gt; false // ID of a parent comment (optional)
+        );
+
+        $r = wp_parse_args( $args, $defaults );
+        extract( $r, EXTR_SKIP );
+
+        if ( empty($content) || empty($user_id) || empty($activity_id) )
+                return false;
+
+        if ( empty($parent_id) )
+                $parent_id = $activity_id;
+
+        /* Insert the &quot;user posted a new activity comment header text&quot; */
+        $comment_header = '&lt;div class=&quot;comment-header&quot;&gt;' . sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $user_id ) ) . ' &lt;span class=&quot;time-since&quot;&gt;%s&lt;/span&gt;&lt;/div&gt; ';
+
+        /* Insert the activity comment */
+        $comment_id = bp_activity_add( array(
+                'content' =&gt; apply_filters( 'bp_activity_comment_content', $comment_header . '&lt;div class=&quot;activity-inner&quot;&gt;' . $content . '&lt;/div&gt;' ),
+                'primary_link' =&gt; '',
+                'component_name' =&gt; $bp-&gt;activity-&gt;id,
+                'component_action' =&gt; 'activity_comment',
+                'user_id' =&gt; $user_id,
+                'item_id' =&gt; $activity_id,
+                'secondary_item_id' =&gt; $parent_id
+        ) );
+
+        return $comment_id;
+}
+
</ins><span class="cx"> /* There are multiple ways to delete activity items, depending on the information you have at the time. */
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_delete_by_item_id( $args = '' ) {
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2216 => 2217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-12-27 14:46:30 UTC (rev 2216)
+++ trunk/bp-groups.php        2009-12-27 15:05:26 UTC (rev 2217)
</span><span class="lines">@@ -1978,29 +1978,31 @@
</span><span class="cx"> 
</span><span class="cx"> /*** Group Activity Posting **************************************************/
</span><span class="cx"> 
</span><del>-function groups_post_update( $content, $user_id = false, $group_id = false ) {
</del><ins>+function groups_post_update( $args = '' ) {
</ins><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        if ( !$user_id )
-                $user_id = $bp-&gt;loggedin_user-&gt;id;
</del><ins>+        $defaults = array(
+                'content' =&gt; false,
+                'user_id' =&gt; $bp-&gt;loggedin_user-&gt;id,
+                'group_id' =&gt; false
+        );
</ins><span class="cx"> 
</span><del>-        if ( !$group_id )
-                $group_id = $bp-&gt;groups-&gt;current_group-&gt;id;
</del><ins>+        $r = wp_parse_args( $args, $defaults );
+        extract( $r, EXTR_SKIP );
</ins><span class="cx"> 
</span><del>-        if ( !$group_id )
</del><ins>+        if ( empty($content) || empty($user_id) || empty($group_id) )
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-        if ( !$bp-&gt;groups-&gt;current_group )
-                $bp-&gt;groups-&gt;current_group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = new BP_Groups_Group( $group_id );
</ins><span class="cx"> 
</span><span class="cx">         /* Record this in activity streams */
</span><del>-        $activity_content = sprintf( __( '%s posted an update in the group %s:', 'buddypress'), bp_core_get_userlink( $user_id ), '&lt;a href=&quot;' . bp_get_group_permalink( $bp-&gt;groups-&gt;current_group ) . '&quot;&gt;' . attribute_escape( $bp-&gt;groups-&gt;current_group-&gt;name ) . '&lt;/a&gt;' );
</del><ins>+        $activity_content = sprintf( __( '%s posted an update in the group %s:', 'buddypress'), bp_core_get_userlink( $user_id ), '&lt;a href=&quot;' . bp_get_group_permalink( $group ) . '&quot;&gt;' . attribute_escape( $group-&gt;name ) . '&lt;/a&gt;' );
</ins><span class="cx">         $activity_content .= '&lt;div class=&quot;activity-inner&quot;&gt;' . $content . '&lt;/div&gt;';
</span><span class="cx"> 
</span><span class="cx">         $activity_id = groups_record_activity( array(
</span><span class="cx">                 'user_id' =&gt; $user_id,
</span><span class="cx">                 'content' =&gt; apply_filters( 'groups_activity_new_wire_post', $activity_content ),
</span><del>-                'primary_link' =&gt; apply_filters( 'groups_activity_new_wire_post_primary_link', bp_get_group_permalink( $bp-&gt;groups-&gt;current_group ) ),
</del><ins>+                'primary_link' =&gt; apply_filters( 'groups_activity_new_wire_post_primary_link', bp_get_group_permalink( $group ) ),
</ins><span class="cx">                 'component_action' =&gt; 'new_wire_post',
</span><span class="cx">                 'item_id' =&gt; $item_id
</span><span class="cx">         ) );
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2216 => 2217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2009-12-27 14:46:30 UTC (rev 2216)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2009-12-27 15:05:26 UTC (rev 2217)
</span><span class="lines">@@ -177,10 +177,16 @@
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( (int)$_POST['group'] )
-                $activity_id = groups_post_update( $_POST['content'], $bp-&gt;loggedin_user-&gt;id, $_POST['group'] );
-        else
-                $activity_id = xprofile_post_update( $_POST['content'], $bp-&gt;loggedin_user-&gt;id );
</del><ins>+        if ( (int)$_POST['group'] ) {
+                $activity_id = groups_post_update( array(
+                        'content' =&gt; $_POST['content'],
+                        'group_id' =&gt; $_POST['group']
+                ));
+        } else {
+                $activity_id = xprofile_post_update( array(
+                        'content' =&gt; $_POST['content']
+                ));
+        }
</ins><span class="cx"> 
</span><span class="cx">         if ( !$activity_id ) {
</span><span class="cx">                 echo '-1&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;&lt;p&gt;' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '&lt;/p&gt;&lt;/div&gt;';
</span><span class="lines">@@ -216,22 +222,12 @@
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        /* TODO - move the business logic to the activity plugin */
</del><ins>+        $comment_id = bp_activity_new_comment( array(
+                'content' =&gt; $_POST['content'],
+                'activity_id' =&gt; $_POST['form_id'],
+                'parent_id' =&gt; $_POST['comment_id']
+        ));
</ins><span class="cx"> 
</span><del>-        /* Insert the &quot;user posted a new activity comment header text&quot; */
-        $comment_header = '&lt;div class=&quot;comment-header&quot;&gt;' . sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $bp-&gt;loggedin_user-&gt;id ) ) . ' &lt;span class=&quot;time-since&quot;&gt;%s&lt;/span&gt;&lt;/div&gt; ';
-
-        /* Insert the activity comment */
-        $comment_id = bp_activity_add( array(
-                'content' =&gt; apply_filters( 'bp_activity_comment_content', $comment_header . '&lt;div class=&quot;activity-inner&quot;&gt;' . $_POST['content'] . '&lt;/div&gt;' ),
-                'primary_link' =&gt; '',
-                'component_name' =&gt; $bp-&gt;activity-&gt;id,
-                'component_action' =&gt; 'activity_comment',
-                'user_id' =&gt; $bp-&gt;loggedin_user-&gt;id,
-                'item_id' =&gt; $_POST['form_id'],
-                'secondary_item_id' =&gt; $_POST['comment_id']
-        ) );
-
</del><span class="cx">         if ( !$comment_id ) {
</span><span class="cx">                 echo '-1&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;&lt;p&gt;' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '&lt;/p&gt;&lt;/div&gt;';
</span><span class="cx">                 return false;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityactivityloopphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/activity-loop.php (2216 => 2217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/activity-loop.php        2009-12-27 14:46:30 UTC (rev 2216)
+++ trunk/bp-themes/bp-default/activity/activity-loop.php        2009-12-27 15:05:26 UTC (rev 2217)
</span><span class="lines">@@ -7,59 +7,8 @@
</span><span class="cx"> 
</span><span class="cx">         &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
</span><span class="cx"> 
</span><del>-                &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( 'type=full&amp;width=60&amp;height=60' ) ?&gt;
-                        &lt;/div&gt;
</del><ins>+                &lt;?php include( locate_template( array( 'activity/entry.php' ), false ) ) ?&gt;
</ins><span class="cx"> 
</span><del>-                        &lt;div class=&quot;activity-content&quot;&gt;
-                                &lt;?php bp_activity_content() ?&gt;
-
-                                &lt;div class=&quot;activity-meta&quot;&gt;
-                                        &lt;?php if ( is_user_logged_in() &amp;&amp; bp_activity_can_comment() ) : ?&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;
-                                        &lt;?php endif; ?&gt;
-
-                                        &lt;?php if ( !bp_is_activity_permalink() ) : ?&gt;
-                                                &lt;a href=&quot;&lt;?php bp_activity_thread_permalink() ?&gt;&quot; class=&quot;view&quot; title=&quot;&lt;?php _e( 'View Thread', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'View Thread', 'buddypress' ) ?&gt;&lt;/a&gt;
-                                        &lt;?php endif; ?&gt;
-
-                                        &lt;?php if ( is_user_logged_in() ) : ?&gt;
-                                                &lt;?php if ( !bp_get_activity_is_favorite() ) : ?&gt;
-                                                        &lt;a href=&quot;&quot; class=&quot;fav&quot; title=&quot;&lt;?php _e( 'Mark Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Mark Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
-                                                &lt;?php else : ?&gt;
-                                                        &lt;a href=&quot;&quot; class=&quot;unfav&quot; title=&quot;&lt;?php _e( 'Remove Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Remove Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
-                                                &lt;?php endif; ?&gt;
-                                        &lt;?php endif;?&gt;
-                                &lt;/div&gt;
-                        &lt;/div&gt;
-
-                        &lt;?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?&gt;
-                                &lt;div class=&quot;activity-inreplyto&quot;&gt;
-                                        &lt;strong&gt;&lt;?php _e( 'In reply to', 'buddypress' ) ?&gt;&lt;/strong&gt; - &lt;?php bp_activity_parent_content() ?&gt;
-                                &lt;/div&gt;
-                        &lt;?php endif; ?&gt;
-
-                        &lt;?php if ( bp_activity_can_comment() ) : ?&gt;
-                                &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;div class=&quot;ac-textarea&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;/div&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; &amp;nbsp; &lt;?php _e( 'or press esc to cancel.', 'buddypress' ) ?&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;
-                        &lt;?php endif; ?&gt;
-                &lt;/li&gt;
-
</del><span class="cx">         &lt;?php endwhile; ?&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;li class=&quot;load-more&quot;&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityentryphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/entry.php (2216 => 2217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/entry.php        2009-12-27 14:46:30 UTC (rev 2216)
+++ trunk/bp-themes/bp-default/activity/entry.php        2009-12-27 15:05:26 UTC (rev 2217)
</span><span class="lines">@@ -1,34 +1,53 @@
</span><span class="cx"> &lt;?php /* This template is used by permalink pages and AJAX functions to load in new updates */ ?&gt;
</span><span class="cx"> &lt;li class=&quot;&lt;?php bp_activity_css_class() ?&gt; new-update&quot; id=&quot;activity-&lt;?php bp_activity_id() ?&gt;&quot;&gt;
</span><span class="cx">         &lt;div class=&quot;activity-avatar&quot;&gt;
</span><del>-                &lt;?php bp_activity_avatar('width=40&amp;height=40') ?&gt;
</del><ins>+                &lt;?php bp_activity_avatar( 'type=full&amp;width=60&amp;height=60' ) ?&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;activity-content&quot;&gt;
</span><span class="cx">                 &lt;?php bp_activity_content() ?&gt;
</span><span class="cx"> 
</span><del>-                &lt;?php if ( is_user_logged_in() ) : ?&gt;
</del><span class="cx">                 &lt;div class=&quot;activity-meta&quot;&gt;
</span><del>-                        &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;
</del><ins>+                        &lt;?php if ( is_user_logged_in() &amp;&amp; bp_activity_can_comment() ) : ?&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;
+                        &lt;?php endif; ?&gt;
+
+                        &lt;?php if ( !bp_is_activity_permalink() ) : ?&gt;
+                                &lt;a href=&quot;&lt;?php bp_activity_thread_permalink() ?&gt;&quot; class=&quot;view&quot; title=&quot;&lt;?php _e( 'View Thread', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'View Thread', 'buddypress' ) ?&gt;&lt;/a&gt;
+                        &lt;?php endif; ?&gt;
+
+                        &lt;?php if ( is_user_logged_in() ) : ?&gt;
+                                &lt;?php if ( !bp_get_activity_is_favorite() ) : ?&gt;
+                                        &lt;a href=&quot;&quot; class=&quot;fav&quot; title=&quot;&lt;?php _e( 'Mark Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Mark Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
+                                &lt;?php else : ?&gt;
+                                        &lt;a href=&quot;&quot; class=&quot;unfav&quot; title=&quot;&lt;?php _e( 'Remove Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Remove Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
+                                &lt;?php endif; ?&gt;
+                        &lt;?php endif;?&gt;
</ins><span class="cx">                 &lt;/div&gt;
</span><del>-                &lt;?php endif; ?&gt;
</del><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><del>-        &lt;div class=&quot;activity-comments&quot;&gt;
-                &lt;?php bp_activity_comments() ?&gt;
</del><ins>+        &lt;?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?&gt;
+                &lt;div class=&quot;activity-inreplyto&quot;&gt;
+                        &lt;strong&gt;&lt;?php _e( 'In reply to', 'buddypress' ) ?&gt;&lt;/strong&gt; - &lt;?php bp_activity_parent_content() ?&gt;
+                &lt;/div&gt;
+        &lt;?php endif; ?&gt;
</ins><span class="cx"> 
</span><del>-                &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;div class=&quot;ac-textarea&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;
</del><ins>+        &lt;?php if ( bp_activity_can_comment() ) : ?&gt;
+                &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;div class=&quot;ac-textarea&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;/div&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; &amp;nbsp; &lt;?php _e( 'or press esc to cancel.', 'buddypress' ) ?&gt;
</ins><span class="cx">                                 &lt;/div&gt;
</span><del>-
-                                &lt;input type=&quot;submit&quot; name=&quot;ac-form-submit&quot; value=&quot;&lt;?php _e( 'Post', 'buddypress' ) ?&gt; &amp;rarr;&quot; /&gt; &amp;nbsp; &lt;?php _e( 'or press esc to cancel.', 'buddypress' ) ?&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;
-&lt;/li&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+                                &lt;?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?&gt;
+                        &lt;/form&gt;
+                        &lt;?php endif; ?&gt;
+                &lt;/div&gt;
+        &lt;?php endif; ?&gt;
+&lt;/li&gt;
</ins></span></pre></div>
<a id="trunkbpxprofilephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile.php (2216 => 2217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile.php        2009-12-27 14:46:30 UTC (rev 2216)
+++ trunk/bp-xprofile.php        2009-12-27 15:05:26 UTC (rev 2217)
</span><span class="lines">@@ -742,12 +742,20 @@
</span><span class="cx">  * true or false on success or failure.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-function xprofile_post_update( $content, $user_id = false ) {
</del><ins>+function xprofile_post_update( $args = '' ) {
</ins><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        if ( !$user_id )
-                $user_id = $bp-&gt;loggedin_user-&gt;id;
</del><ins>+        $defaults = array(
+                'content' =&gt; false,
+                'user_id' =&gt; $bp-&gt;loggedin_user-&gt;id
+        );
</ins><span class="cx"> 
</span><ins>+        $r = wp_parse_args( $args, $defaults );
+        extract( $r, EXTR_SKIP );
+
+        if ( empty($content) || empty($content) )
+                return false;
+
</ins><span class="cx">         /* Record this on the user's profile */
</span><span class="cx">         $from_user_link = bp_core_get_userlink( $user_id );
</span><span class="cx">         $activity_content = sprintf( __('%s posted an update:', 'buddypress'), $from_user_link );
</span></span></pre>
</div>
</div>

</body>
</html>