<!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 && $page && $max )
</del><ins>+                if ( $per_page && $page )
</ins><span class="cx">                         $activities = $wpdb->get_results( $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) );
</span><span class="cx">                 else
</span><span class="cx">                         $activities = $wpdb->get_results( $wpdb->prepare( "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}" ) );
</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"> ?>
</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">         ?>
</span><span class="cx">
</span><del>-        <?php if ( bp_has_activities( 'include=' . $fav_ids . '&max=50&display_comments=inline' ) ) : ?>
</del><ins>+        <?php if ( bp_has_activities( 'include=' . $fav_ids . '&max=50&display_comments=stream' ) ) : ?>
</ins><span class="cx">                 <?php while ( bp_activities() ) : bp_the_activity(); ?>
</span><span class="cx">                         <item>
</span><span class="cx">                                 <guid><?php bp_activity_thread_permalink() ?></guid>
</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">         <?php do_action('bp_activity_friends_feed_head'); ?>
</span><span class="cx">
</span><span class="cx">         <?php $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->displayed_user->id ) ); ?>
</span><del>-        <?php if ( bp_has_activities( 'user_id=' . $friend_ids . '&max=50&display_comments=inline' ) ) : ?>
</del><ins>+        <?php if ( bp_has_activities( 'user_id=' . $friend_ids . '&max=50&display_comments=stream' ) ) : ?>
</ins><span class="cx">                 <?php while ( bp_activities() ) : bp_the_activity(); ?>
</span><span class="cx">                         <item>
</span><span class="cx">                                 <guid><?php bp_activity_thread_permalink() ?></guid>
</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">         <language><?php echo get_option('rss_language'); ?></language>
</span><span class="cx">         <?php do_action('bp_activity_mentions_feed_head'); ?>
</span><span class="cx">
</span><del>-        <?php if ( bp_has_activities( 'max=50&display_comments=inline&search_terms=@' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ) : ?>
</del><ins>+        <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ) : ?>
</ins><span class="cx">                 <?php while ( bp_activities() ) : bp_the_activity(); ?>
</span><span class="cx">                         <item>
</span><span class="cx">                                 <guid><?php bp_activity_thread_permalink() ?></guid>
</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">         <language><?php echo get_option('rss_language'); ?></language>
</span><span class="cx">         <?php do_action('bp_activity_personal_feed_head'); ?>
</span><span class="cx">
</span><del>-        <?php if ( bp_has_activities( 'user_id=' . $bp->displayed_user->id . '&max=50&display_comments=inline' ) ) : ?>
</del><ins>+        <?php if ( bp_has_activities( 'user_id=' . $bp->displayed_user->id . '&max=50&display_comments=stream' ) ) : ?>
</ins><span class="cx">                 <?php while ( bp_activities() ) : bp_the_activity(); ?>
</span><span class="cx">                         <item>
</span><span class="cx">                                 <guid><?php bp_activity_thread_permalink() ?></guid>
</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<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>';
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><del>-?>
-        <li id="acomment-<?php echo $comment_id ?>">
-                <div class="acomment-avatar">
-                        <?php echo bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'width' => 25, 'height' => 25 ) ) ?>
-                </div>
</del><span class="cx">
</span><del>-                <div class="acomment-meta">
-                        <?php echo bp_core_get_userlink( $bp->loggedin_user->id ) ?> &middot; <?php echo bp_core_time_since( time() ) ?> &middot;
-                        <a class="acomment-reply" href="#acomment-<?php echo $comment_id ?>" id="acomment-reply-<?php echo attribute_escape( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ) ?></a>
-                         &middot; <a href="<?php echo wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . $comment_id, 'bp_activity_delete_link' ) ?>" class="item-button delete-activity confirm"><?php _e( 'Delete', 'buddypress' ) ?></a>
-                </div>
</del><ins>+        if ( bp_has_activities ( 'include=' . $comment_id ) ) : ?>
+                <?php while ( bp_activities() ) : bp_the_activity(); ?>
+                        <li id="acomment-<?php bp_activity_id() ?>">
+                                <div class="acomment-avatar">
+                                        <?php bp_activity_avatar( array( 'width' => 25, 'height' => 25 ) ) ?>
+                                </div>
</ins><span class="cx">
</span><del>-                <div class="acomment-content">
-                        <?php echo apply_filters( 'bp_get_activity_content', $_POST['content'] ) ?>
-                </div>
-        </li>
-<?php
</del><ins>+                                <div class="acomment-meta">
+                                        <?php echo bp_core_get_userlink( bp_get_activity_user_id() ) ?> &middot; <?php printf( __( '%s ago', 'buddypress' ), bp_core_time_since( time() ) ) ?> &middot;
+                                        <a class="acomment-reply" href="#acomment-<?php bp_activity_id() ?>" id="acomment-reply-<?php echo attribute_escape( $_POST['form_id'] ) ?>"><?php _e( 'Reply', 'buddypress' ) ?></a>
+                                         &middot; <a href="<?php echo wp_nonce_url( $bp->root_domain . '/' . $bp->activity->slug . '/delete/' . bp_get_activity_id(), 'bp_activity_delete_link' ) ?>" class="item-button delete-activity confirm"><?php _e( 'Delete', 'buddypress' ) ?></a>
+                                </div>
+
+                                <div class="acomment-content">
+                                        <?php bp_activity_content() ?>
+                                </div>
+                        </li>
+                <?php endwhile; ?>
+         <?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 .= '&per_page=' . $per_page;
</span><span class="cx">
</span><span class="cx">                 /* Add the comments param */
</span><del>-                if ( $bp->displayed_user->id )
</del><ins>+                if ( $bp->displayed_user->id || 'atme' == $type )
</ins><span class="cx">                         $query_string .= '&display_comments=stream';
</span><span class="cx">                 else
</span><span class="cx">                         $query_string .= '&display_comments=threaded';
</span></span></pre>
</div>
</div>
</body>
</html>