<!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] [2369] trunk: Fixing @mentions in activity comments.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2369</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-19 17:51:30 +0000 (Tue, 19 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixing @mentions in activity comments. Fixing mixup of inline vs stream setting.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityclassesphp">trunk/bp-activity/bp-activity-classes.php</a></li>
<li><a href="#trunkbpactivitybpactivityfiltersphp">trunk/bp-activity/bp-activity-filters.php</a></li>
<li><a href="#trunkbpactivityfeedsbpactivityfavoritesfeedphp">trunk/bp-activity/feeds/bp-activity-favorites-feed.php</a></li>
<li><a href="#trunkbpactivityfeedsbpactivityfriendsfeedphp">trunk/bp-activity/feeds/bp-activity-friends-feed.php</a></li>
<li><a href="#trunkbpactivityfeedsbpactivitymentionsfeedphp">trunk/bp-activity/feeds/bp-activity-mentions-feed.php</a></li>
<li><a href="#trunkbpactivityfeedsbpactivitypersonalfeedphp">trunk/bp-activity/feeds/bp-activity-personal-feed.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.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 (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-classes.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-activity/bp-activity-classes.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> 
</span><span class="cx">                 $where_sql = 'WHERE ' . join( ' AND ', $where_conditions );
</span><span class="cx"> 
</span><del>-                if ( $per_page &amp;&amp; $page &amp;&amp; $max )
</del><ins>+                if ( $per_page &amp;&amp; $page )
</ins><span class="cx">                         $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}&quot; ) );
</span><span class="cx">                 else
</span><span class="cx">                         $activities = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}&quot; ) );
</span></span></pre></div>
<a id="trunkbpactivitybpactivityfiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-filters.php (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-filters.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-activity/bp-activity-filters.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -92,5 +92,6 @@
</span><span class="cx"> add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' );
</span><span class="cx"> add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' );
</span><span class="cx"> add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' );
</span><ins>+add_filter( 'bp_activity_comment_content', 'bp_activity_at_name_filter' );
</ins><span class="cx"> 
</span><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpactivityfeedsbpactivityfavoritesfeedphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/feeds/bp-activity-favorites-feed.php (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/feeds/bp-activity-favorites-feed.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-activity/feeds/bp-activity-favorites-feed.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">                 $fav_ids = implode( ',', (array)$favs );
</span><span class="cx">         ?&gt;
</span><span class="cx"> 
</span><del>-        &lt;?php if ( bp_has_activities( 'include=' . $fav_ids . '&amp;max=50&amp;display_comments=inline' ) ) : ?&gt;
</del><ins>+        &lt;?php if ( bp_has_activities( 'include=' . $fav_ids . '&amp;max=50&amp;display_comments=stream' ) ) : ?&gt;
</ins><span class="cx">                 &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
</span><span class="cx">                         &lt;item&gt;
</span><span class="cx">                                 &lt;guid&gt;&lt;?php bp_activity_thread_permalink() ?&gt;&lt;/guid&gt;
</span></span></pre></div>
<a id="trunkbpactivityfeedsbpactivityfriendsfeedphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/feeds/bp-activity-friends-feed.php (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/feeds/bp-activity-friends-feed.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-activity/feeds/bp-activity-friends-feed.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">         &lt;?php do_action('bp_activity_friends_feed_head'); ?&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;?php $friend_ids = implode( ',', friends_get_friend_user_ids( $bp-&gt;displayed_user-&gt;id ) ); ?&gt;
</span><del>-        &lt;?php if ( bp_has_activities( 'user_id=' . $friend_ids . '&amp;max=50&amp;display_comments=inline' ) ) : ?&gt;
</del><ins>+        &lt;?php if ( bp_has_activities( 'user_id=' . $friend_ids . '&amp;max=50&amp;display_comments=stream' ) ) : ?&gt;
</ins><span class="cx">                 &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
</span><span class="cx">                         &lt;item&gt;
</span><span class="cx">                                 &lt;guid&gt;&lt;?php bp_activity_thread_permalink() ?&gt;&lt;/guid&gt;
</span></span></pre></div>
<a id="trunkbpactivityfeedsbpactivitymentionsfeedphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/feeds/bp-activity-mentions-feed.php (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/feeds/bp-activity-mentions-feed.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-activity/feeds/bp-activity-mentions-feed.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx">         &lt;language&gt;&lt;?php echo get_option('rss_language'); ?&gt;&lt;/language&gt;
</span><span class="cx">         &lt;?php do_action('bp_activity_mentions_feed_head'); ?&gt;
</span><span class="cx"> 
</span><del>-        &lt;?php if ( bp_has_activities( 'max=50&amp;display_comments=inline&amp;search_terms=@' . bp_core_get_username( $bp-&gt;displayed_user-&gt;id, $bp-&gt;displayed_user-&gt;userdata-&gt;user_nicename, $bp-&gt;displayed_user-&gt;userdata-&gt;user_login ) ) ) : ?&gt;
</del><ins>+        &lt;?php if ( bp_has_activities( 'max=50&amp;display_comments=stream&amp;search_terms=@' . bp_core_get_username( $bp-&gt;displayed_user-&gt;id, $bp-&gt;displayed_user-&gt;userdata-&gt;user_nicename, $bp-&gt;displayed_user-&gt;userdata-&gt;user_login ) ) ) : ?&gt;
</ins><span class="cx">                 &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
</span><span class="cx">                         &lt;item&gt;
</span><span class="cx">                                 &lt;guid&gt;&lt;?php bp_activity_thread_permalink() ?&gt;&lt;/guid&gt;
</span></span></pre></div>
<a id="trunkbpactivityfeedsbpactivitypersonalfeedphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/feeds/bp-activity-personal-feed.php (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/feeds/bp-activity-personal-feed.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-activity/feeds/bp-activity-personal-feed.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx">         &lt;language&gt;&lt;?php echo get_option('rss_language'); ?&gt;&lt;/language&gt;
</span><span class="cx">         &lt;?php do_action('bp_activity_personal_feed_head'); ?&gt;
</span><span class="cx"> 
</span><del>-        &lt;?php if ( bp_has_activities( 'user_id=' . $bp-&gt;displayed_user-&gt;id . '&amp;max=50&amp;display_comments=inline' ) ) : ?&gt;
</del><ins>+        &lt;?php if ( bp_has_activities( 'user_id=' . $bp-&gt;displayed_user-&gt;id . '&amp;max=50&amp;display_comments=stream' ) ) : ?&gt;
</ins><span class="cx">                 &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
</span><span class="cx">                         &lt;item&gt;
</span><span class="cx">                                 &lt;guid&gt;&lt;?php bp_activity_thread_permalink() ?&gt;&lt;/guid&gt;
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-friends.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -537,7 +537,7 @@
</span><span class="cx">         return BP_Friends_Friendship::get_bulk_last_active( $friend_ids );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function friends_get_friends_invite_list( $user_id = false, $group_id ) {
</del><ins>+function friends_get_friends_invite_list( $user_id = false ) {
</ins><span class="cx">         global $bp;
</span><span class="cx"> 
</span><span class="cx">         if ( !$user_id )
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2368 => 2369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-19 17:20:50 UTC (rev 2368)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-19 17:51:30 UTC (rev 2369)
</span><span class="lines">@@ -121,23 +121,26 @@
</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 class="cx">         }
</span><del>-?&gt;
-        &lt;li id=&quot;acomment-&lt;?php echo $comment_id ?&gt;&quot;&gt;
-                &lt;div class=&quot;acomment-avatar&quot;&gt;
-                        &lt;?php echo bp_core_fetch_avatar( array( 'item_id' =&gt; $bp-&gt;loggedin_user-&gt;id, 'width' =&gt; 25, 'height' =&gt; 25 ) ) ?&gt;
-                &lt;/div&gt;
</del><span class="cx"> 
</span><del>-                &lt;div class=&quot;acomment-meta&quot;&gt;
-                        &lt;?php echo bp_core_get_userlink( $bp-&gt;loggedin_user-&gt;id ) ?&gt; &amp;middot; &lt;?php echo bp_core_time_since( time() ) ?&gt; &amp;middot;
-                        &lt;a class=&quot;acomment-reply&quot; href=&quot;#acomment-&lt;?php echo $comment_id ?&gt;&quot; id=&quot;acomment-reply-&lt;?php echo attribute_escape( $_POST['form_id'] ) ?&gt;&quot;&gt;&lt;?php _e( 'Reply', 'buddypress' ) ?&gt;&lt;/a&gt;
-                         &amp;middot; &lt;a href=&quot;&lt;?php echo wp_nonce_url( $bp-&gt;root_domain . '/' . $bp-&gt;activity-&gt;slug . '/delete/' . $comment_id, 'bp_activity_delete_link' ) ?&gt;&quot; class=&quot;item-button delete-activity confirm&quot;&gt;&lt;?php _e( 'Delete', 'buddypress' ) ?&gt;&lt;/a&gt;
-                &lt;/div&gt;
</del><ins>+        if ( bp_has_activities ( 'include=' . $comment_id ) ) : ?&gt;
+                &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
+                        &lt;li id=&quot;acomment-&lt;?php bp_activity_id() ?&gt;&quot;&gt;
+                                &lt;div class=&quot;acomment-avatar&quot;&gt;
+                                        &lt;?php bp_activity_avatar( array( 'width' =&gt; 25, 'height' =&gt; 25 ) ) ?&gt;
+                                &lt;/div&gt;
</ins><span class="cx"> 
</span><del>-                &lt;div class=&quot;acomment-content&quot;&gt;
-                        &lt;?php echo apply_filters( 'bp_get_activity_content', $_POST['content'] ) ?&gt;
-                &lt;/div&gt;
-        &lt;/li&gt;
-&lt;?php
</del><ins>+                                &lt;div class=&quot;acomment-meta&quot;&gt;
+                                        &lt;?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?&gt; &amp;middot; &lt;?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( time() ) ) ?&gt; &amp;middot;
+                                        &lt;a class=&quot;acomment-reply&quot; href=&quot;#acomment-&lt;?php bp_activity_id() ?&gt;&quot; id=&quot;acomment-reply-&lt;?php echo attribute_escape( $_POST['form_id'] ) ?&gt;&quot;&gt;&lt;?php _e( 'Reply', 'buddypress' ) ?&gt;&lt;/a&gt;
+                                         &amp;middot; &lt;a href=&quot;&lt;?php echo wp_nonce_url( $bp-&gt;root_domain . '/' . $bp-&gt;activity-&gt;slug . '/delete/' . bp_get_activity_id(), 'bp_activity_delete_link' ) ?&gt;&quot; class=&quot;item-button delete-activity confirm&quot;&gt;&lt;?php _e( 'Delete', 'buddypress' ) ?&gt;&lt;/a&gt;
+                                &lt;/div&gt;
+
+                                &lt;div class=&quot;acomment-content&quot;&gt;
+                                        &lt;?php bp_activity_content() ?&gt;
+                                &lt;/div&gt;
+                        &lt;/li&gt;
+                &lt;?php endwhile; ?&gt;
+         &lt;?php endif;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_new_activity_comment', 'bp_dtheme_new_activity_comment' );
</span><span class="cx"> 
</span><span class="lines">@@ -222,7 +225,7 @@
</span><span class="cx">                 $query_string .= '&amp;per_page=' . $per_page;
</span><span class="cx"> 
</span><span class="cx">                 /* Add the comments param */
</span><del>-                if ( $bp-&gt;displayed_user-&gt;id )
</del><ins>+                if ( $bp-&gt;displayed_user-&gt;id || 'atme' == $type )
</ins><span class="cx">                         $query_string .= '&amp;display_comments=stream';
</span><span class="cx">                 else
</span><span class="cx">                         $query_string .= '&amp;display_comments=threaded';
</span></span></pre>
</div>
</div>

</body>
</html>