<!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] [2291] trunk: Fixing RSS links on activity tabs.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2291</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-11 13:05:11 +0000 (Mon, 11 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixing RSS links on activity tabs.</pre>

<h3>Modified Paths</h3>
<ul>
<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="#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="#trunkbpthemesbpdefault_incglobaljs">trunk/bp-themes/bp-default/_inc/global.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkbpactivityfeedsbpactivitymentionsfeedphp">trunk/bp-activity/feeds/bp-activity-mentions-feed.php</a></li>
<li><a href="#trunkbpactivityfeedsbpactivitymygroupsfeedphp">trunk/bp-activity/feeds/bp-activity-mygroups-feed.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2290 => 2291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2010-01-11 11:53:11 UTC (rev 2290)
+++ trunk/bp-activity/bp-activity-templatetags.php        2010-01-11 13:05:11 UTC (rev 2291)
</span><span class="lines">@@ -726,8 +726,18 @@
</span><span class="cx">         function bp_get_activity_feed_item_title() {
</span><span class="cx">                 global $activities_template;
</span><span class="cx"> 
</span><del>-                $title = explode( '&lt;span', $activities_template-&gt;activity-&gt;content );
-                return apply_filters( 'bp_get_activity_feed_item_title', trim( strip_tags( html_entity_decode( $title[0] ) ) ) );
</del><ins>+                $content = explode( '&lt;span', $activities_template-&gt;activity-&gt;content );
+                $title = trim( strip_tags( html_entity_decode( $content[0] ) ) );
+
+                if ( ':' == substr( $title, -1 ) )
+                        $title = substr( $title, 0, -1 );
+
+                if ( 'new_wire_post' == $activities_template-&gt;activity-&gt;component_action ) {
+                        $content = explode( '&lt;div class=&quot;activity-inner&quot;&gt;', $activities_template-&gt;activity-&gt;content );
+                        $title .= ': ' . strip_tags( bp_create_excerpt( $content[1], 15 ));
+                }
+
+                return apply_filters( 'bp_get_activity_feed_item_title', $title );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_activity_feed_item_link() {
</span></span></pre></div>
<a id="trunkbpactivityfeedsbpactivitymentionsfeedphp"></a>
<div class="addfile"><h4>Added: trunk/bp-activity/feeds/bp-activity-mentions-feed.php (0 => 2291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/feeds/bp-activity-mentions-feed.php                                (rev 0)
+++ trunk/bp-activity/feeds/bp-activity-mentions-feed.php        2010-01-11 13:05:11 UTC (rev 2291)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+&lt;?php
+/**
+ * RSS2 Feed Template for displaying a member's group's activity
+ *
+ * @package BuddyPress
+ */
+header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
+header('Status: 200 OK');
+?&gt;
+&lt;?php echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;'.get_option('blog_charset').'&quot;?'.'&gt;'; ?&gt;
+
+&lt;rss version=&quot;2.0&quot;
+        xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
+        xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
+        xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
+        xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot;
+        &lt;?php do_action('bp_activity_mentions_feed'); ?&gt;
+&gt;
+
+&lt;channel&gt;
+        &lt;title&gt;&lt;?php echo $bp-&gt;displayed_user-&gt;fullname; ?&gt; - &lt;?php _e( 'Mentions', 'buddypress' ) ?&gt;&lt;/title&gt;
+        &lt;atom:link href=&quot;&lt;?php self_link(); ?&gt;&quot; rel=&quot;self&quot; type=&quot;application/rss+xml&quot; /&gt;
+        &lt;link&gt;&lt;?php echo site_url( BP_ACTIVITY_SLUG . '/#mentions/' ) ?&gt;&lt;/link&gt;
+        &lt;description&gt;&lt;?php echo $bp-&gt;displayed_user-&gt;fullname; ?&gt; - &lt;?php _e( 'Mentions', 'buddypress' ) ?&gt;&lt;/description&gt;
+        &lt;pubDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?&gt;&lt;/pubDate&gt;
+        &lt;generator&gt;http://buddypress.org/?v=&lt;?php echo BP_VERSION ?&gt;&lt;/generator&gt;
+        &lt;language&gt;&lt;?php echo get_option('rss_language'); ?&gt;&lt;/language&gt;
+        &lt;?php do_action('bp_activity_mentions_feed_head'); ?&gt;
+
+        &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;
+                &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
+                        &lt;item&gt;
+                                &lt;guid&gt;&lt;?php bp_activity_thread_permalink() ?&gt;&lt;/guid&gt;
+                                &lt;title&gt;&lt;![CDATA[&lt;?php bp_activity_feed_item_title() ?&gt;]]&gt;&lt;/title&gt;
+                                &lt;link&gt;&lt;?php echo bp_activity_thread_permalink() ?&gt;&lt;/link&gt;
+                                &lt;pubDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?&gt;&lt;/pubDate&gt;
+
+                                &lt;description&gt;
+                                        &lt;![CDATA[
+                                        &lt;?php bp_activity_feed_item_description() ?&gt;
+
+                                        &lt;?php if ( bp_activity_can_comment() ) : ?&gt;
+                                                &lt;p&gt;&lt;?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?&gt;&lt;/p&gt;
+                                        &lt;?php endif; ?&gt;
+
+                                        &lt;?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?&gt;
+                                                &lt;br /&gt;&lt;strong&gt;&lt;?php _e( 'In reply to', 'buddypress' ) ?&gt;&lt;/strong&gt; -
+                                                &lt;?php bp_activity_parent_content() ?&gt;
+                                        &lt;?php endif; ?&gt;
+                                        ]]&gt;
+                                &lt;/description&gt;
+                                &lt;?php do_action('bp_activity_mentions_feed_item'); ?&gt;
+                        &lt;/item&gt;
+                &lt;?php endwhile; ?&gt;
+
+        &lt;?php endif; ?&gt;
+&lt;/channel&gt;
+&lt;/rss&gt;
</ins></span></pre></div>
<a id="trunkbpactivityfeedsbpactivitymygroupsfeedphp"></a>
<div class="addfile"><h4>Added: trunk/bp-activity/feeds/bp-activity-mygroups-feed.php (0 => 2291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/feeds/bp-activity-mygroups-feed.php                                (rev 0)
+++ trunk/bp-activity/feeds/bp-activity-mygroups-feed.php        2010-01-11 13:05:11 UTC (rev 2291)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+&lt;?php
+/**
+ * RSS2 Feed Template for displaying a member's group's activity
+ *
+ * @package BuddyPress
+ */
+header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
+header('Status: 200 OK');
+?&gt;
+&lt;?php echo '&lt;?xml version=&quot;1.0&quot; encoding=&quot;'.get_option('blog_charset').'&quot;?'.'&gt;'; ?&gt;
+
+&lt;rss version=&quot;2.0&quot;
+        xmlns:content=&quot;http://purl.org/rss/1.0/modules/content/&quot;
+        xmlns:wfw=&quot;http://wellformedweb.org/CommentAPI/&quot;
+        xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;
+        xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot;
+        &lt;?php do_action('bp_activity_mygroups_feed'); ?&gt;
+&gt;
+
+&lt;channel&gt;
+        &lt;title&gt;&lt;?php echo $bp-&gt;displayed_user-&gt;fullname; ?&gt; - &lt;?php _e( 'My Groups - Public Activity', 'buddypress' ) ?&gt;&lt;/title&gt;
+        &lt;atom:link href=&quot;&lt;?php self_link(); ?&gt;&quot; rel=&quot;self&quot; type=&quot;application/rss+xml&quot; /&gt;
+        &lt;link&gt;&lt;?php echo site_url( BP_ACTIVITY_SLUG . '/#my-groups/' ) ?&gt;&lt;/link&gt;
+        &lt;description&gt;&lt;?php echo $bp-&gt;displayed_user-&gt;fullname; ?&gt; - &lt;?php _e( 'My Groups - Public Activity', 'buddypress' ) ?&gt;&lt;/description&gt;
+        &lt;pubDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?&gt;&lt;/pubDate&gt;
+        &lt;generator&gt;http://buddypress.org/?v=&lt;?php echo BP_VERSION ?&gt;&lt;/generator&gt;
+        &lt;language&gt;&lt;?php echo get_option('rss_language'); ?&gt;&lt;/language&gt;
+        &lt;?php do_action('bp_activity_mygroups_feed_head'); ?&gt;
+
+        &lt;?php
+                $groups = groups_get_user_groups( $bp-&gt;loggedin_user-&gt;id );
+                $group_ids = implode( ',', $groups['groups'] );
+        ?&gt;
+
+        &lt;?php if ( bp_has_activities( 'object=' . $bp-&gt;groups-&gt;id . '&amp;primary_id=' . $group_ids . '&amp;max=50&amp;display_comments=threaded' ) ) : ?&gt;
+                &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
+                        &lt;item&gt;
+                                &lt;guid&gt;&lt;?php bp_activity_thread_permalink() ?&gt;&lt;/guid&gt;
+                                &lt;title&gt;&lt;![CDATA[&lt;?php bp_activity_feed_item_title() ?&gt;]]&gt;&lt;/title&gt;
+                                &lt;link&gt;&lt;?php echo bp_activity_thread_permalink() ?&gt;&lt;/link&gt;
+                                &lt;pubDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?&gt;&lt;/pubDate&gt;
+
+                                &lt;description&gt;
+                                        &lt;![CDATA[
+                                                &lt;?php bp_activity_feed_item_description() ?&gt;
+
+                                                &lt;?php if ( bp_activity_can_comment() ) : ?&gt;
+                                                        &lt;p&gt;&lt;?php printf( __( 'Comments: %s', 'buddypress' ), bp_activity_get_comment_count() ); ?&gt;&lt;/p&gt;
+                                                &lt;?php endif; ?&gt;
+                                        ]]&gt;
+                                &lt;/description&gt;
+                                &lt;?php do_action('bp_activity_mygroups_feed_item'); ?&gt;
+                        &lt;/item&gt;
+                &lt;?php endwhile; ?&gt;
+
+        &lt;?php endif; ?&gt;
+&lt;/channel&gt;
+&lt;/rss&gt;
</ins></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2290 => 2291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2010-01-11 11:53:11 UTC (rev 2290)
+++ trunk/bp-activity.php        2010-01-11 13:05:11 UTC (rev 2291)
</span><span class="lines">@@ -341,7 +341,35 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp', 'bp_activity_action_friends_feed', 3 );
</span><span class="cx"> 
</span><ins>+function bp_activity_action_my_groups_feed() {
+        global $bp, $wp_query;
</ins><span class="cx"> 
</span><ins>+        if ( $bp-&gt;current_component != $bp-&gt;activity-&gt;slug || !$bp-&gt;displayed_user-&gt;id || $bp-&gt;current_action != 'my-groups' || $bp-&gt;action_variables[0] != 'feed' )
+                return false;
+
+        $wp_query-&gt;is_404 = false;
+        status_header( 200 );
+
+        include_once( 'bp-activity/feeds/bp-activity-mygroups-feed.php' );
+        die;
+}
+add_action( 'wp', 'bp_activity_action_my_groups_feed', 3 );
+
+function bp_activity_action_mentions_feed() {
+        global $bp, $wp_query;
+
+        if ( $bp-&gt;current_component != $bp-&gt;activity-&gt;slug || !$bp-&gt;displayed_user-&gt;id || $bp-&gt;current_action != 'mentions' || $bp-&gt;action_variables[0] != 'feed' )
+                return false;
+
+        $wp_query-&gt;is_404 = false;
+        status_header( 200 );
+
+        include_once( 'bp-activity/feeds/bp-activity-mentions-feed.php' );
+        die;
+}
+add_action( 'wp', 'bp_activity_action_mentions_feed', 3 );
+
+
</ins><span class="cx"> /********************************************************************************
</span><span class="cx">  * Business Functions
</span><span class="cx">  *
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2290 => 2291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-01-11 11:53:11 UTC (rev 2290)
+++ trunk/bp-groups.php        2010-01-11 13:05:11 UTC (rev 2291)
</span><span class="lines">@@ -1354,7 +1354,7 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp', 'groups_action_redirect_to_random_group', 6 );
</span><span class="cx"> 
</span><del>-function groups_action_groups_feed() {
</del><ins>+function groups_action_group_feed() {
</ins><span class="cx">         global $bp, $wp_query;
</span><span class="cx"> 
</span><span class="cx">         if ( $bp-&gt;current_component != $bp-&gt;groups-&gt;slug || !$bp-&gt;groups-&gt;current_group || $bp-&gt;current_action != 'feed' )
</span><span class="lines">@@ -1371,7 +1371,7 @@
</span><span class="cx">         include_once( 'bp-activity/feeds/bp-activity-group-feed.php' );
</span><span class="cx">         die;
</span><span class="cx"> }
</span><del>-add_action( 'wp', 'groups_action_groups_feed', 3 );
</del><ins>+add_action( 'wp', 'groups_action_group_feed', 3 );
</ins><span class="cx"> 
</span><span class="cx"> 
</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 (2290 => 2291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-11 11:53:11 UTC (rev 2290)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-11 13:05:11 UTC (rev 2291)
</span><span class="lines">@@ -172,15 +172,19 @@
</span><span class="cx">                         if ( empty($type) )
</span><span class="cx">                                 $type = 'all';
</span><span class="cx"> 
</span><ins>+                        $feed_url = site_url( BP_ACTIVITY_SLUG . '/feed/' );
+
</ins><span class="cx">                         switch ( $type ) {
</span><span class="cx">                                 case 'friends':
</span><span class="cx">                                         $friend_ids = implode( ',', friends_get_friend_user_ids( $bp-&gt;loggedin_user-&gt;id ) );
</span><span class="cx">                                         $query_string = 'user_id=' . $friend_ids;
</span><ins>+                                        $feed_url = $bp-&gt;loggedin_user-&gt;domain . BP_ACTIVITY_SLUG . '/my-friends/feed/';
</ins><span class="cx">                                         break;
</span><span class="cx">                                 case 'groups':
</span><span class="cx">                                         $groups = groups_get_user_groups( $bp-&gt;loggedin_user-&gt;id );
</span><span class="cx">                                         $group_ids = implode( ',', $groups['groups'] );
</span><span class="cx">                                         $query_string = 'object=groups&amp;primary_id=' . $group_ids . '&amp;show_hidden=1';
</span><ins>+                                        $feed_url = $bp-&gt;loggedin_user-&gt;domain . BP_ACTIVITY_SLUG . '/my-groups/feed/';
</ins><span class="cx">                                         break;
</span><span class="cx">                                 case 'favorites':
</span><span class="cx">                                         $favs = bp_activity_get_user_favorites( $bp-&gt;loggedin_user-&gt;id );
</span><span class="lines">@@ -190,9 +194,11 @@
</span><span class="cx"> 
</span><span class="cx">                                         $favorite_ids = implode( ',', (array)$favs );
</span><span class="cx">                                         $query_string = 'include=' . $favorite_ids;
</span><ins>+                                        $feed_url = $bp-&gt;loggedin_user-&gt;domain  . BP_ACTIVITY_SLUG . '/my-favorites/feed/';
</ins><span class="cx">                                         break;
</span><span class="cx">                                 case 'atme':
</span><span class="cx">                                         $query_string = 'search_terms=@' . bp_core_get_username( $bp-&gt;loggedin_user-&gt;id, $bp-&gt;loggedin_user-&gt;userdata-&gt;user_nicename, $bp-&gt;loggedin_user-&gt;userdata-&gt;user_login );
</span><ins>+                                        $feed_url = $bp-&gt;loggedin_user-&gt;domain . BP_ACTIVITY_SLUG . '/mentions/feed/';
</ins><span class="cx"> 
</span><span class="cx">                                         /* Reset the number of new @ mentions for the user */
</span><span class="cx">                                         delete_usermeta( $bp-&gt;loggedin_user-&gt;id, 'bp_new_mention_count' );
</span><span class="lines">@@ -233,6 +239,7 @@
</span><span class="cx"> 
</span><span class="cx">         $bp-&gt;ajax_querystring = $query_string;
</span><span class="cx">         $result['query_string'] = $bp-&gt;ajax_querystring;
</span><ins>+        $result['feed_url'] = $feed_url;
</ins><span class="cx"> 
</span><span class="cx">         /* Buffer the loop in the template to a var for JS to spit out. */
</span><span class="cx">         ob_start();
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2290 => 2291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-01-11 11:53:11 UTC (rev 2290)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-01-11 13:05:11 UTC (rev 2291)
</span><span class="lines">@@ -250,6 +250,7 @@
</span><span class="cx">                                 j(this).fadeIn(100);
</span><span class="cx">                         });
</span><span class="cx"> 
</span><ins>+                        j('div#subnav li.feed a').attr('href', response.feed_url);
</ins><span class="cx">                         j('div.item-list-tabs li.selected, div.item-list-tabs li.current').removeClass('loading');
</span><span class="cx"> 
</span><span class="cx">                         /* Selectively hide comments */
</span></span></pre>
</div>
</div>

</body>
</html>