<!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] [2692] trunk:
  Fixed support for specific actions such as new update,
  new reply and favoriting activities when JS is turned off.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2692</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-02-12 01:17:56 +0000 (Fri, 12 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixed support for specific actions such as new update, new reply and favoriting activities when JS is turned off.</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="#trunkbpactivityphp">trunk/bp-activity.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpdefault_inccssdefaultcss">trunk/bp-themes/bp-default/_inc/css/default.css</a></li>
<li><a href="#trunkbpthemesbpdefault_incglobaljs">trunk/bp-themes/bp-default/_inc/global.js</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityentryphp">trunk/bp-themes/bp-default/activity/entry.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivitypostformphp">trunk/bp-themes/bp-default/activity/post-form.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 (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-classes.php        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-activity/bp-activity-classes.php        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">                         'user_id' =&gt; false,
</span><span class="cx">                         'item_id' =&gt; false,
</span><span class="cx">                         'secondary_item_id' =&gt; false,
</span><del>-                        'recorded_time' =&gt; false,
</del><ins>+                        'date_recorded' =&gt; false,
</ins><span class="cx">                         'hide_sitewide' =&gt; false
</span><span class="cx">                 );
</span><span class="cx"> 
</span><span class="lines">@@ -280,11 +280,11 @@
</span><span class="cx">                 if ( !empty( $secondary_item_id ) )
</span><span class="cx">                         $where_args[] = $wpdb-&gt;prepare( &quot;secondary_item_id = %s&quot;, $secondary_item_id );
</span><span class="cx"> 
</span><del>-                if ( !empty( $recorded_time ) )
-                        $where_args[] = $wpdb-&gt;prepare( &quot;recorded_time = %s&quot;, $recorded_time );
</del><ins>+                if ( !empty( $date_recorded ) )
+                        $where_args[] = $wpdb-&gt;prepare( &quot;date_recorded = %s&quot;, $date_recorded );
</ins><span class="cx"> 
</span><span class="cx">                 if ( !empty( $hide_sitewide ) )
</span><del>-                        $where_args[] = $wpdb-&gt;prepare( &quot;recorded_time = %d&quot;, $hide_sitewide );
</del><ins>+                        $where_args[] = $wpdb-&gt;prepare( &quot;hide_sitewide = %d&quot;, $hide_sitewide );
</ins><span class="cx"> 
</span><span class="cx">                 if ( !empty( $where_args ) )
</span><span class="cx">                         $where_sql = 'WHERE ' . join( ' AND ', $where_args );
</span></span></pre></div>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-activity/bp-activity-templatetags.php        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -568,9 +568,9 @@
</span><span class="cx">                                 $content .= '&lt;div class=&quot;acomment-avatar&quot;&gt;&lt;a href=&quot;' . bp_core_get_user_domain( $comment-&gt;user_id, $comment-&gt;user_nicename, $comment-&gt;user_login ) . '&quot;&gt;' . bp_core_fetch_avatar( array( 'item_id' =&gt; $comment-&gt;user_id, 'width' =&gt; 25, 'height' =&gt; 25, 'email' =&gt; $comment-&gt;user_email ) ) . '&lt;/a&gt;&lt;/div&gt;';
</span><span class="cx">                                 $content .= '&lt;div class=&quot;acomment-meta&quot;&gt;&lt;a href=&quot;' . bp_core_get_user_domain( $comment-&gt;user_id, $comment-&gt;user_nicename, $comment-&gt;user_login ) . '&quot;&gt;' . apply_filters( 'bp_get_member_name', $comment-&gt;user_fullname ) . '&lt;/a&gt; &amp;middot; ' . sprintf( __( '%s ago', 'buddypress' ), bp_core_time_since( strtotime( $comment-&gt;date_recorded ) ) );
</span><span class="cx"> 
</span><del>-                                /* Reply link */
</del><ins>+                                /* Reply link - the span is so that threaded reply links can be hidden when JS is off. */
</ins><span class="cx">                                 if ( is_user_logged_in() )
</span><del>-                                        $content .= ' &amp;middot; &lt;a href=&quot;#acomment-' . $comment-&gt;id . '&quot; class=&quot;acomment-reply&quot; id=&quot;acomment-reply-' . $activities_template-&gt;activity-&gt;id . '&quot;&gt;' . __( 'Reply', 'buddypress' ) . '&lt;/a&gt;';
</del><ins>+                                        $content .= '&lt;span class=&quot;acomment-replylink&quot;&gt; &amp;middot; &lt;a href=&quot;#acomment-' . $comment-&gt;id . '&quot; class=&quot;acomment-reply&quot; id=&quot;acomment-reply-' . $activities_template-&gt;activity-&gt;id . '&quot;&gt;' . __( 'Reply', 'buddypress' ) . '&lt;/a&gt;&lt;/span&gt;';
</ins><span class="cx"> 
</span><span class="cx">                                 /* Delete link */
</span><span class="cx">                                 if ( is_site_admin() || $bp-&gt;loggedin_user-&gt;id == $comment-&gt;user_id )
</span><span class="lines">@@ -614,6 +614,32 @@
</span><span class="cx">                         return $count;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><ins>+function bp_activity_comment_link() {
+        echo bp_get_activity_comment_link();
+}
+        function bp_get_activity_comment_link() {
+                global $activities_template;
+                return apply_filters( 'bp_get_activity_comment_link', '?ac=' . $activities_template-&gt;activity-&gt;id . '/#ac-form-' . $activities_template-&gt;activity-&gt;id );
+        }
+
+function bp_activity_comment_form_nojs_display() {
+        echo bp_get_activity_comment_form_nojs_display();
+}
+        function bp_get_activity_comment_form_nojs_display() {
+                global $activities_template;
+                if ( $_GET['ac'] == $activities_template-&gt;activity-&gt;id . '/' )
+                        return 'style=&quot;display: block&quot;';
+
+                return false;
+        }
+
+function bp_activity_comment_form_action() {
+        echo bp_get_activity_comment_form_action();
+}
+        function bp_get_activity_comment_form_action() {
+                return apply_filters( 'bp_get_activity_comment_form_action', site_url( BP_ACTIVITY_SLUG . '/reply/' ) );
+        }
+
</ins><span class="cx"> function bp_activity_permalink_id() {
</span><span class="cx">         echo bp_get_activity_permalink_id();
</span><span class="cx"> }
</span><span class="lines">@@ -634,6 +660,22 @@
</span><span class="cx">                  return apply_filters( 'bp_get_activity_thread_permalink', $link );
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+function bp_activity_favorite_link() {
+        echo bp_get_activity_favorite_link();
+}
+        function bp_get_activity_favorite_link() {
+                global $activities_template;
+                return apply_filters( 'bp_get_activity_favorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/favorite/' . $activities_template-&gt;activity-&gt;id . '/' ), 'mark_favorite' ) );
+        }
+
+function bp_activity_unfavorite_link() {
+        echo bp_get_activity_unfavorite_link();
+}
+        function bp_get_activity_unfavorite_link() {
+                global $activities_template;
+                return apply_filters( 'bp_get_activity_unfavorite_link', wp_nonce_url( site_url( BP_ACTIVITY_SLUG . '/unfavorite/' . $activities_template-&gt;activity-&gt;id . '/' ), 'unmark_favorite' ) );
+        }
+
</ins><span class="cx"> function bp_activity_css_class() {
</span><span class="cx">         echo bp_get_activity_css_class();
</span><span class="cx"> }
</span><span class="lines">@@ -791,6 +833,12 @@
</span><span class="cx">                 return apply_filters( 'bp_get_send_public_message_link', $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;activity-&gt;slug . '/?r=' . bp_core_get_username( $bp-&gt;displayed_user-&gt;user_id, $bp-&gt;displayed_user-&gt;userdata-&gt;user_nicename, $bp-&gt;displayed_user-&gt;userdata-&gt;user_login ) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+function bp_activity_post_form_action() {
+        echo bp_get_activity_post_form_action();
+}
+        function bp_get_activity_post_form_action() {
+                return apply_filters( 'bp_get_activity_post_form_action', site_url( BP_ACTIVITY_SLUG . '/post/' ) );
+        }
</ins><span class="cx"> 
</span><span class="cx"> /* RSS Feed Template Tags ***************************/
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-activity.php        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -360,6 +360,111 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp', 'bp_activity_action_delete_activity', 3 );
</span><span class="cx"> 
</span><ins>+function bp_activity_action_post_update() {
+        global $bp;
+
+        if ( !is_user_logged_in() || $bp-&gt;current_component != $bp-&gt;activity-&gt;slug || $bp-&gt;current_action != 'post' )
+                return false;
+
+        /* Check the nonce */
+        check_admin_referer( 'post_update', '_wpnonce_post_update' );
+
+        $content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );
+        $object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );
+        $item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );
+
+        if ( empty( $content ) ) {
+                bp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );
+                bp_core_redirect( wp_get_referer() );
+        }
+
+        if ( !(int)$item_id ) {
+                $activity_id = bp_activity_post_update( array( 'content' =&gt; $content ) );
+
+        } else if ( 'groups' == $object &amp;&amp; function_exists( 'groups_post_update' ) ) {
+                if ( (int)$item_id ) {
+                        $activity_id = groups_post_update( array( 'content' =&gt; $content, 'group_id' =&gt; $item_id ) );
+                }
+        } else
+                $activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );
+
+        if ( !empty( $activity_id ) )
+                bp_core_add_message( __( 'Update Posted!', 'buddypress' ) );
+        else
+                bp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );
+
+        bp_core_redirect( wp_get_referer() );
+}
+add_action( 'wp', 'bp_activity_action_post_update', 3 );
+
+function bp_activity_action_post_comment() {
+        global $bp;
+
+        if ( !is_user_logged_in() || $bp-&gt;current_component != $bp-&gt;activity-&gt;slug || $bp-&gt;current_action != 'reply' )
+                return false;
+
+        /* Check the nonce */
+        check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' );
+
+        $activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] );
+        $content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] );
+
+        if ( empty( $content ) ) {
+                bp_core_add_message( __( 'Please do not leave the comment area blank.', 'buddypress' ), 'error' );
+                bp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );
+        }
+
+        $comment_id = bp_activity_new_comment( array(
+                'content' =&gt; $content,
+                'activity_id' =&gt; $activity_id,
+                'parent_id' =&gt; $parent_id
+        ));
+
+        if ( !empty( $comment_id ) )
+                bp_core_add_message( __( 'Reply Posted!', 'buddypress' ) );
+        else
+                bp_core_add_message( __( 'There was an error posting that reply, please try again.', 'buddypress' ), 'error' );
+
+        bp_core_redirect( wp_get_referer() . '#ac-form-' . $activity_id );
+}
+add_action( 'wp', 'bp_activity_action_post_comment', 3 );
+
+function bp_activity_action_mark_favorite() {
+        global $bp;
+
+        if ( !is_user_logged_in() || $bp-&gt;current_component != $bp-&gt;activity-&gt;slug || $bp-&gt;current_action != 'favorite' )
+                return false;
+
+        /* Check the nonce */
+        check_admin_referer( 'mark_favorite' );
+
+        if ( bp_activity_add_user_favorite( $bp-&gt;action_variables[0] ) )
+                bp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) );
+        else
+                bp_core_add_message( __( 'There was an error marking that activity as a favorite, please try again.', 'buddypress' ), 'error' );
+
+        bp_core_redirect( wp_get_referer() . '#activity-' . $bp-&gt;action_variables[0] );
+}
+add_action( 'wp', 'bp_activity_action_mark_favorite', 3 );
+
+function bp_activity_action_remove_favorite() {
+        global $bp;
+
+        if ( !is_user_logged_in() || $bp-&gt;current_component != $bp-&gt;activity-&gt;slug || $bp-&gt;current_action != 'unfavorite' )
+                return false;
+
+        /* Check the nonce */
+        check_admin_referer( 'unmark_favorite' );
+
+        if ( bp_activity_remove_user_favorite( $bp-&gt;action_variables[0] ) )
+                bp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) );
+        else
+                bp_core_add_message( __( 'There was an error removing that activity as a favorite, please try again.', 'buddypress' ), 'error' );
+
+        bp_core_redirect( wp_get_referer() . '#activity-' . $bp-&gt;action_variables[0] );
+}
+add_action( 'wp', 'bp_activity_action_remove_favorite', 3 );
+
</ins><span class="cx"> function bp_activity_action_sitewide_feed() {
</span><span class="cx">         global $bp, $wp_query;
</span><span class="cx"> 
</span><span class="lines">@@ -894,10 +999,10 @@
</span><span class="cx"> 
</span><span class="cx">         /* Update the user's personal favorites */
</span><span class="cx">         $my_favs = maybe_unserialize( get_usermeta( $bp-&gt;loggedin_user-&gt;id, 'bp_favorite_activities' ) );
</span><del>-        $my_favs[] = $_POST['id'];
</del><ins>+        $my_favs[] = $activity_id;
</ins><span class="cx"> 
</span><span class="cx">         /* Update the total number of users who have favorited this activity */
</span><del>-        $fav_count = bp_activity_get_meta( $_POST['id'], 'favorite_count' );
</del><ins>+        $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' );
</ins><span class="cx"> 
</span><span class="cx">         if ( !empty( $fav_count ) )
</span><span class="cx">                 $fav_count = (int)$fav_count + 1;
</span><span class="lines">@@ -905,7 +1010,7 @@
</span><span class="cx">                 $fav_count = 1;
</span><span class="cx"> 
</span><span class="cx">         update_usermeta( $bp-&gt;loggedin_user-&gt;id, 'bp_favorite_activities', $my_favs );
</span><del>-        bp_activity_update_meta( $_POST['id'], 'favorite_count', $fav_count );
</del><ins>+        bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
</ins><span class="cx"> 
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="lines">@@ -919,15 +1024,15 @@
</span><span class="cx">         /* Remove the fav from the user's favs */
</span><span class="cx">         $my_favs = maybe_unserialize( get_usermeta( $user_id, 'bp_favorite_activities' ) );
</span><span class="cx">         $my_favs = array_flip( (array) $my_favs );
</span><del>-        unset( $my_favs[$_POST['id']] );
</del><ins>+        unset( $my_favs[$activity_id] );
</ins><span class="cx">         $my_favs = array_unique( array_flip( $my_favs ) );
</span><span class="cx"> 
</span><span class="cx">         /* Update the total number of users who have favorited this activity */
</span><del>-        $fav_count = bp_activity_get_meta( $_POST['id'], 'favorite_count' );
</del><ins>+        $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' );
</ins><span class="cx"> 
</span><span class="cx">         if ( !empty( $fav_count ) ) {
</span><span class="cx">                 $fav_count = (int)$fav_count - 1;
</span><del>-                bp_activity_update_meta( $_POST['id'], 'favorite_count', $fav_count );
</del><ins>+                bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         update_usermeta( $user_id, 'bp_favorite_activities', $my_favs );
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -10,10 +10,12 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> /***
</span><del>- * Each object loop (activity/members/groups/blogs/forums) contains parameters to
</del><ins>+ * This function looks scarier than it actually is. :)
+ * Each object loop (activity/members/groups/blogs/forums) contains default parameters to
</ins><span class="cx">  * show specific information based on the page we are currently looking at.
</span><span class="cx">  * The following function will take into account any cookies set in the JS and allow us
</span><span class="cx">  * to override the parameters sent. That way we can change the results returned without reloading the page.
</span><ins>+ * By using cookies we can also make sure that user settings are retained across page loads.
</ins><span class="cx">  */
</span><span class="cx"> function bp_dtheme_ajax_querystring( $object = false ) {
</span><span class="cx">         global $bp;
</span><span class="lines">@@ -60,6 +62,7 @@
</span><span class="cx">         return apply_filters( 'bp_dtheme_ajax_querystring', $query_string, $object, $_BP_COOKIE['bp-' . $object . '-filter'], $_BP_COOKIE['bp-' . $object . '-scope'], $_BP_COOKIE['bp-' . $object . '-page'], $_BP_COOKIE['bp-' . $object . '-search-terms'], $_BP_COOKIE['bp-' . $object . '-extras'] );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+/* This function will simply load the template loop for the current object. On an AJAX request */
</ins><span class="cx"> function bp_dtheme_object_template_loader() {
</span><span class="cx">         $object = esc_attr( $_POST['object'] );
</span><span class="cx">         locate_template( array( &quot;$object/$object-loop.php&quot; ), true );
</span><span class="lines">@@ -69,6 +72,7 @@
</span><span class="cx"> add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' );
</span><span class="cx"> add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' );
</span><span class="cx"> 
</span><ins>+/* This function will load the activity loop template when activity is requested via AJAX */
</ins><span class="cx"> function bp_dtheme_activity_template_loader() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -103,6 +107,7 @@
</span><span class="cx"> add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_activity_template_loader' );
</span><span class="cx"> add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_activity_template_loader' );
</span><span class="cx"> 
</span><ins>+/* AJAX update posting */
</ins><span class="cx"> function bp_dtheme_post_update() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -119,20 +124,13 @@
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( empty( $_POST['object'] ) ) {
-                $activity_id = bp_activity_post_update( array(
-                        'content' =&gt; $_POST['content']
-                ));
</del><ins>+        if ( empty( $_POST['object'] ) &amp;&amp; function_exists( 'bp_activity_post_update' ) ) {
+                $activity_id = bp_activity_post_update( array( 'content' =&gt; $_POST['content'] ) );
</ins><span class="cx">         } elseif ( $_POST['object'] == 'groups' ) {
</span><del>-                if ( !empty( $_POST['item_id'] ) ) {
-                $activity_id = groups_post_update( array(
-                        'content' =&gt; $_POST['content'],
-                                'group_id' =&gt; $_POST['item_id']
-                ));
-                }
-        } else {
</del><ins>+                if ( !empty( $_POST['item_id'] ) &amp;&amp; function_exists( 'groups_post_update' ) )
+                        $activity_id = groups_post_update( array( 'content' =&gt; $_POST['content'], 'group_id' =&gt; $_POST['item_id'] ) );
+        } else
</ins><span class="cx">                 $activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
</span><del>-        }
</del><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">@@ -147,6 +145,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_post_update', 'bp_dtheme_post_update' );
</span><span class="cx"> 
</span><ins>+/* AJAX activity comment posting */
</ins><span class="cx"> function bp_dtheme_new_activity_comment() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -201,6 +200,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
</span><span class="cx"> 
</span><ins>+/* AJAX delete an activity */
</ins><span class="cx"> function bp_dtheme_delete_activity() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -227,6 +227,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
</span><span class="cx"> 
</span><ins>+/* AJAX delete an activity comment */
</ins><span class="cx"> function bp_dtheme_delete_activity_comment() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -253,6 +254,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity_comment' );
</span><span class="cx"> 
</span><ins>+/* AJAX mark an activity as a favorite */
</ins><span class="cx"> function bp_dtheme_mark_activity_favorite() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -261,6 +263,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_activity_mark_fav', 'bp_dtheme_mark_activity_favorite' );
</span><span class="cx"> 
</span><ins>+/* AJAX mark an activity as not a favorite */
</ins><span class="cx"> function bp_dtheme_unmark_activity_favorite() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -269,6 +272,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
</span><span class="cx"> 
</span><ins>+/* AJAX invite a friend to a group functionality */
</ins><span class="cx"> function bp_dtheme_ajax_invite_user() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -312,6 +316,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_groups_invite_user', 'bp_dtheme_ajax_invite_user' );
</span><span class="cx"> 
</span><ins>+/* AJAX add/remove a user as a friend when clicking the button */
</ins><span class="cx"> function bp_dtheme_ajax_addremove_friend() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -342,6 +347,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_addremove_friend', 'bp_dtheme_ajax_addremove_friend' );
</span><span class="cx"> 
</span><ins>+/* AJAX accept a user as a friend when clicking the &quot;accept&quot; button */
</ins><span class="cx"> function bp_dtheme_ajax_accept_friendship() {
</span><span class="cx">         check_admin_referer( 'friends_accept_friendship' );
</span><span class="cx"> 
</span><span class="lines">@@ -352,6 +358,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_accept_friendship', 'bp_dtheme_ajax_accept_friendship' );
</span><span class="cx"> 
</span><ins>+/* AJAX reject a user as a friend when clicking the &quot;reject&quot; button */
</ins><span class="cx"> function bp_dtheme_ajax_reject_friendship() {
</span><span class="cx">         check_admin_referer( 'friends_reject_friendship' );
</span><span class="cx"> 
</span><span class="lines">@@ -362,6 +369,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_reject_friendship', 'bp_dtheme_ajax_reject_friendship' );
</span><span class="cx"> 
</span><ins>+/* AJAX join or leave a group when clicking the &quot;join/leave&quot; button */
</ins><span class="cx"> function bp_dtheme_ajax_joinleave_group() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -414,6 +422,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_joinleave_group', 'bp_dtheme_ajax_joinleave_group' );
</span><span class="cx"> 
</span><ins>+/* AJAX close and keep closed site wide notices from an admin in the sidebar */
</ins><span class="cx"> function bp_dtheme_ajax_close_notice() {
</span><span class="cx">         global $userdata;
</span><span class="cx"> 
</span><span class="lines">@@ -429,6 +438,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_messages_close_notice', 'bp_dtheme_ajax_close_notice' );
</span><span class="cx"> 
</span><ins>+/* AJAX send a private message reply to a thread */
</ins><span class="cx"> function bp_dtheme_ajax_messages_send_reply() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -464,6 +474,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_messages_send_reply', 'bp_dtheme_ajax_messages_send_reply' );
</span><span class="cx"> 
</span><ins>+/* AJAX mark a private message as unread in your inbox */
</ins><span class="cx"> function bp_dtheme_ajax_message_markunread() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -479,6 +490,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_messages_markunread', 'bp_dtheme_ajax_message_markunread' );
</span><span class="cx"> 
</span><ins>+/* AJAX mark a private message as read in your inbox */
</ins><span class="cx"> function bp_dtheme_ajax_message_markread() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -494,6 +506,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_messages_markread', 'bp_dtheme_ajax_message_markread' );
</span><span class="cx"> 
</span><ins>+/* AJAX delete a private message or array of messages in your inbox */
</ins><span class="cx"> function bp_dtheme_ajax_messages_delete() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="lines">@@ -510,6 +523,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_messages_delete', 'bp_dtheme_ajax_messages_delete' );
</span><span class="cx"> 
</span><ins>+/* AJAX autocomplete your friends names on the compose screen */
</ins><span class="cx"> function bp_dtheme_ajax_messages_autocomplete_results() {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssdefaultcss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/default.css (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/default.css        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-themes/bp-default/_inc/css/default.css        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -1295,6 +1295,8 @@
</span><span class="cx">                         padding: 15px 0 15px 0;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><ins>+                div.activity-comments span.acomment-replylink { display: none; }
+
</ins><span class="cx">                 div.activity-comments ul li p:last-child {
</span><span class="cx">                         margin-bottom: 0;
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -7,6 +7,14 @@
</span><span class="cx"> j(document).ready( function() {
</span><span class="cx">         /**** Page Load Actions *******************************************************/
</span><span class="cx"> 
</span><ins>+        /* Hide Forums Post Form */
+        if ( j('div.forums').length )
+                j('div#new-topic-post').hide();
+
+        /* Show threaded reply links */
+        if ( j('span.acomment-replylink').length )
+                j('span.acomment-replylink').show();
+
</ins><span class="cx">         /* Activity filter and scope set */
</span><span class="cx">         bp_init_activity();
</span><span class="cx"> 
</span><span class="lines">@@ -14,10 +22,6 @@
</span><span class="cx">         var objects = [ 'members', 'groups', 'blogs', 'forums' ];
</span><span class="cx">         bp_init_objects( objects );
</span><span class="cx"> 
</span><del>-        /* Hide Forums Post Form */
-        if ( j('div.forums').length )
-                j('div#new-topic-post').hide();
-
</del><span class="cx">         /* @mention Compose Scrolling */
</span><span class="cx">         if ( j.query.get('r') ) {
</span><span class="cx">                 if ( j('textarea#whats-new').length ) {
</span><span class="lines">@@ -307,7 +311,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 /* Activity comment posting */
</span><del>-                if ( target.attr('name') == 'ac-form-submit' ) {
</del><ins>+                if ( target.attr('name') == 'ac_form_submit' ) {
</ins><span class="cx">                         var form = target.parent().parent();
</span><span class="cx">                         var form_parent = form.parent();
</span><span class="cx">                         var form_id = form.attr('id').split('-');
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityentryphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/entry.php (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/entry.php        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-themes/bp-default/activity/entry.php        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -25,14 +25,14 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;div class=&quot;activity-meta&quot;&gt;
</span><span class="cx">                         &lt;?php if ( is_user_logged_in() &amp;&amp; bp_activity_can_comment() ) : ?&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( 'Reply', 'buddypress' ) ?&gt; (&lt;span&gt;&lt;?php bp_activity_comment_count() ?&gt;&lt;/span&gt;)&lt;/a&gt;
</del><ins>+                                &lt;a href=&quot;&lt;?php bp_activity_comment_link() ?&gt;&quot; class=&quot;acomment-reply&quot; id=&quot;acomment-comment-&lt;?php bp_activity_id() ?&gt;&quot;&gt;&lt;?php _e( 'Reply', 'buddypress' ) ?&gt; (&lt;span&gt;&lt;?php bp_activity_comment_count() ?&gt;&lt;/span&gt;)&lt;/a&gt;
</ins><span class="cx">                         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;?php if ( is_user_logged_in() ) : ?&gt;
</span><span class="cx">                                 &lt;?php if ( !bp_get_activity_is_favorite() ) : ?&gt;
</span><del>-                                        &lt;a href=&quot;&quot; class=&quot;fav&quot; title=&quot;&lt;?php _e( 'Mark as Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
</del><ins>+                                        &lt;a href=&quot;&lt;?php bp_activity_favorite_link() ?&gt;&quot; class=&quot;fav&quot; title=&quot;&lt;?php _e( 'Mark as Favorite', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Favorite', 'buddypress' ) ?&gt;&lt;/a&gt;
</ins><span class="cx">                                 &lt;?php else : ?&gt;
</span><del>-                                        &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;
</del><ins>+                                        &lt;a href=&quot;&lt;?php bp_activity_unfavorite_link() ?&gt;&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;
</ins><span class="cx">                                 &lt;?php endif; ?&gt;
</span><span class="cx">                         &lt;?php endif;?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -54,13 +54,14 @@
</span><span class="cx">                         &lt;?php bp_activity_comments() ?&gt;
</span><span class="cx"> 
</span><span class="cx">                         &lt;?php if ( is_user_logged_in() ) : ?&gt;
</span><del>-                        &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;
</del><ins>+                        &lt;form action=&quot;&lt;?php bp_activity_comment_form_action() ?&gt;&quot; method=&quot;post&quot; id=&quot;ac-form-&lt;?php bp_activity_id() ?&gt;&quot; class=&quot;ac-form&quot;&lt;?php bp_activity_comment_form_nojs_display() ?&gt;&gt;
</ins><span class="cx">                                 &lt;div class=&quot;ac-reply-avatar&quot;&gt;&lt;?php bp_loggedin_user_avatar( 'width=25&amp;height=25' ) ?&gt;&lt;/div&gt;
</span><span class="cx">                                 &lt;div class=&quot;ac-reply-content&quot;&gt;
</span><span class="cx">                                         &lt;div class=&quot;ac-textarea&quot;&gt;
</span><del>-                                                &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;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;
</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;
</del><ins>+                                        &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;input type=&quot;hidden&quot; name=&quot;comment_form_id&quot; value=&quot;&lt;?php bp_activity_id() ?&gt;&quot; /&gt;
</ins><span class="cx">                                 &lt;/div&gt;
</span><span class="cx">                                 &lt;?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?&gt;
</span><span class="cx">                         &lt;/form&gt;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivitypostformphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/post-form.php (2691 => 2692)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/post-form.php        2010-02-11 21:36:52 UTC (rev 2691)
+++ trunk/bp-themes/bp-default/activity/post-form.php        2010-02-12 01:17:56 UTC (rev 2692)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-&lt;form action=&quot;&quot; method=&quot;post&quot; id=&quot;whats-new-form&quot; name=&quot;whats-new-form&quot;&gt;
</del><ins>+&lt;form action=&quot;&lt;?php bp_activity_post_form_action() ?&gt;&quot; method=&quot;post&quot; id=&quot;whats-new-form&quot; name=&quot;whats-new-form&quot;&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;?php do_action( 'bp_before_activity_post_form' ) ?&gt;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>