<!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] [2212] trunk:
Added support for marking an activity as a favorite.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2212</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-12-27 13:04:36 +0000 (Sun, 27 Dec 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Added support for marking an activity as a favorite.</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="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.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_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="#trunkbpthemesbpdefaultactivityactivityloopphp">trunk/bp-themes/bp-default/activity/activity-loop.php</a></li>
<li><a href="#trunkbpthemesbpdefaultactivityindexphp">trunk/bp-themes/bp-default/activity/index.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 (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-classes.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-activity/bp-activity-classes.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -432,6 +432,15 @@
</span><span class="cx">                 return $wpdb->get_var( $wpdb->prepare( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded ASC LIMIT 1" ) );
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        function total_favorite_count( $user_id ) {
+                global $bp;
+
+                if ( !$favorite_activity_entries = get_usermeta( $user_id, 'bp_favorite_activities' ) )
+                        return 0;
+
+                return count( maybe_unserialize( $favorite_activity_entries ) );
+        }
+
</ins><span class="cx">         function check_exists_by_content( $content ) {
</span><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpactivitybpactivitytemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-templatetags.php (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-templatetags.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-activity/bp-activity-templatetags.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -399,6 +399,17 @@
</span><span class="cx">                 return apply_filters( 'bp_get_activity_parent_content', $parent_activity->content );
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+function bp_activity_is_favorite() {
+        echo bp_get_is_activity_favorite();
+}
+        function bp_get_activity_is_favorite() {
+                global $bp, $activities_template;
+
+                $my_favs = maybe_unserialize( get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
+
+                 return apply_filters( 'bp_get_activity_is_favorite', in_array( $activities_template->activity->id, (array)$my_favs ) );
+        }
+
</ins><span class="cx"> function bp_activity_comments( $args = '' ) {
</span><span class="cx">         echo bp_activity_get_comments( $args );
</span><span class="cx"> }
</span><span class="lines">@@ -644,6 +655,16 @@
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function bp_total_favorite_count_for_user( $user_id = false ) {
+        echo bp_get_total_favorite_count_for_user( $user_id );
+}
+        function bp_get_total_favorite_count_for_user( $user_id = false ) {
+                return apply_filters( 'bp_get_total_favorite_count_for_user', bp_activity_total_favorites_for_user( $user_id ) );
+        }
+
+
+/* RSS Feed Template Tags ***************************/
+
</ins><span class="cx"> function bp_sitewide_activity_feed_link() {
</span><span class="cx">         echo bp_get_sitewide_activity_feed_link();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbpactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity.php (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-activity.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -503,6 +503,15 @@
</span><span class="cx">         return apply_filters( 'bp_activity_get_last_updated', BP_Activity_Activity::get_last_updated() );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function bp_activity_total_favorites_for_user( $user_id = false ) {
+        global $bp;
+
+        if ( !$user_id )
+                $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id;
+
+        return BP_Activity_Activity::total_favorite_count( $user_id );
+}
+
</ins><span class="cx"> /**
</span><span class="cx"> * bp_activity_filter_template_paths()
</span><span class="cx"> *
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-groups/bp-groups-templatetags.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -1195,14 +1195,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function bp_total_group_count() {
</span><del>-        echo bp_get_total_blog_count();
</del><ins>+        echo bp_get_total_group_count();
</ins><span class="cx"> }
</span><span class="cx">         function bp_get_total_group_count() {
</span><span class="cx">                 return apply_filters( 'bp_get_total_group_count', groups_get_total_group_count() );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx"> function bp_total_group_count_for_user( $user_id = false ) {
</span><del>-        echo bp_get_total_blog_count_for_user( $user_id );
</del><ins>+        echo bp_get_total_group_count_for_user( $user_id );
</ins><span class="cx"> }
</span><span class="cx">         function bp_get_total_group_count_for_user( $user_id = false ) {
</span><span class="cx">                 return apply_filters( 'bp_get_total_group_count_for_user', groups_total_groups_for_user( $user_id ) );
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-groups.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -166,17 +166,6 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'admin_menu', 'groups_check_installed' );
</span><span class="cx">
</span><del>-function groups_add_admin_menu() {
-        global $wpdb, $bp;
-
-        if ( !is_site_admin() )
-                return false;
-
-        /* Add the administration tab under the "Site Admin" tab for site administrators */
-        add_submenu_page( 'wpmu-admin.php', __("Groups", 'buddypress'), __("Groups", 'buddypress'), 1, "groups_admin_settings", "groups_admin_settings" );
-}
-add_action( 'admin_menu', 'groups_add_admin_menu' );
-
</del><span class="cx"> function groups_setup_nav() {
</span><span class="cx">         global $bp, $current_blog, $group_obj;
</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 (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -161,7 +161,6 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_forums_filter', 'bp_dtheme_forums_filter' );
</span><span class="cx">
</span><del>-
</del><span class="cx"> function bp_dtheme_post_update() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><span class="lines">@@ -186,6 +185,8 @@
</span><span class="cx">                 $component = $bp->groups->id;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        /* TODO - move the business login to the activity plugin and make it extensible */
+
</ins><span class="cx">         if ( $bp->profile->id == $component ) {
</span><span class="cx">                 /* Record this on the poster's activity screen */
</span><span class="cx">                 $from_user_link = bp_core_get_userlink($bp->loggedin_user->id);
</span><span class="lines">@@ -258,6 +259,8 @@
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        /* TODO - move the business logic to the activity plugin */
+
</ins><span class="cx">         /* Insert the "user posted a new activity comment header text" */
</span><span class="cx">         $comment_header = '<div class="comment-header">' . sprintf( __( '%s posted a new activity comment:', 'buddypress' ), bp_core_get_userlink( $bp->loggedin_user->id ) ) . ' <span class="time-since">%s</span></div> ';
</span><span class="cx">
</span><span class="lines">@@ -326,13 +329,13 @@
</span><span class="cx">                         $query_string = 'user_id=' . $bp->displayed_user->id;
</span><span class="cx">                 } else {
</span><span class="cx">                         /* Set a valid type */
</span><del>-                        if ( !$type || ( 'all' != $type && 'friends' != $type && 'groups' != $type ) )
</del><ins>+                        if ( !$type || ( 'all' != $type && 'friends' != $type && 'groups' != $type && 'favorites' != $type ) )
</ins><span class="cx">                                 $type = 'all';
</span><span class="cx">
</span><del>-                        if ( ( 'friends' == $type || 'groups' == $type ) && !is_user_logged_in() )
</del><ins>+                        if ( ( 'friends' == $type || 'groups' == $type || 'favorites' == $type ) && !is_user_logged_in() )
</ins><span class="cx">                                 $type = 'all';
</span><span class="cx">
</span><del>-                        switch( $type ) {
</del><ins>+                        switch ( $type ) {
</ins><span class="cx">                                 case 'friends':
</span><span class="cx">                                         $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->loggedin_user->id ) );
</span><span class="cx">                                         $query_string = 'user_id=' . $friend_ids;
</span><span class="lines">@@ -342,6 +345,10 @@
</span><span class="cx">                                         $group_ids = implode( ',', $groups['groups'] );
</span><span class="cx">                                         $query_string = 'object=groups&primary_id=' . $group_ids;
</span><span class="cx">                                         break;
</span><ins>+                                case 'favorites':
+                                        $favorite_ids = implode( ',', (array)get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
+                                        $query_string = 'include=' . $favorite_ids;
+                                        break;
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -393,6 +400,36 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_activity_get_older_updates', 'bp_dtheme_ajax_load_older_updates' );
</span><span class="cx">
</span><ins>+function bp_dtheme_mark_activity_favorite() {
+        global $bp;
+
+        $my_favs = maybe_unserialize( get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
+        $my_favs[] = $_POST['id'];
+
+        update_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );
+
+        _e( 'Remove Favorite', 'buddypress' );
+}
+add_action( 'wp_ajax_activity_mark_fav', 'bp_dtheme_mark_activity_favorite' );
+
+function bp_dtheme_unmark_activity_favorite() {
+        global $bp;
+
+        $my_favs = maybe_unserialize( get_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );
+        $new_favs = array();
+
+        foreach( (array)$my_favs as $fav ) {
+                if ( $fav != $_POST['id'] )
+                        $new_favs[] = $fav;
+        }
+
+
+        update_usermeta( $bp->loggedin_user->id, 'bp_favorite_activities', $new_favs );
+
+        _e( 'Mark Favorite', 'buddypress' );
+}
+add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
+
</ins><span class="cx"> function bp_dtheme_ajax_invite_user() {
</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 (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/default.css        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-themes/bp-default/_inc/css/default.css        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -465,6 +465,12 @@
</span><span class="cx">                                 color: #aaa;
</span><span class="cx">                         }
</span><span class="cx">
</span><ins>+                        div.item-list-tabs ul li a span {
+                                display: inline;
+                                padding: 0;
+                                color: inherit;
+                        }
+
</ins><span class="cx">                 div.item-list-tabs ul li.selected a,
</span><span class="cx">                 div.item-list-tabs ul li.current a {
</span><span class="cx">                         background-color: #fff;
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-themes/bp-default/_inc/global.js        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -93,7 +93,8 @@
</span><span class="cx">                 /* Activity Stream Tabs */
</span><span class="cx">                 if ( target.attr('id') == 'activity-all' ||
</span><span class="cx">                           target.attr('id') == 'activity-friends' ||
</span><del>-                         target.attr('id') == 'activity-groups' ) {
</del><ins>+                         target.attr('id') == 'activity-groups' ||
+                         target.attr('id') == 'activity-favorites' ) {
</ins><span class="cx">
</span><span class="cx">                         var type = target.attr('id').substr( 9, target.attr('id').length );
</span><span class="cx">                         var filter = j("#activity-filter-select select").val();
</span><span class="lines">@@ -121,10 +122,59 @@
</span><span class="cx">
</span><span class="cx">         /* Stream event delegation */
</span><span class="cx">         j('div.activity').click( function(event) {
</span><del>-                var target = j(event.target).parent();
</del><ins>+                var target = j(event.target);
</ins><span class="cx">
</span><ins>+                /* Favoriting activity stream items */
+                if ( target.attr('class') == 'fav' || target.attr('class') == 'unfav' ) {
+                        var type = target.attr('class')
+                        var parent = target.parent().parent().parent();
+                        var parent_id = parent.attr('id').substr( 9, parent.attr('id').length );
+
+                        target.addClass('loading');
+
+                        j.post( ajaxurl, {
+                                action: 'activity_mark_' + type,
+                                'cookie': encodeURIComponent(document.cookie),
+                                'id': parent_id
+                        },
+                        function(response) {
+                                target.removeClass('loading');
+
+                                target.fadeOut( 100, function() {
+                                        j(this).html(response);
+                                        j(this).fadeIn(100);
+                                });
+
+                                if ( 'fav' == type ) {
+                                        if ( !j('div.item-list-tabs li#activity-favorites').length )
+                                                j('div.item-list-tabs ul').append( '<li id="activity-favorites"><a href="">My Favorites (<span>0</span>)</a></li>').fadeIn(100);
+
+                                        target.removeClass('fav');
+                                        target.addClass('unfav');
+
+                                        j('div.item-list-tabs ul li#activity-favorites span').html( Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) + 1 );
+                                } else {
+                                        target.removeClass('unfav');
+                                        target.addClass('fav');
+
+                                        j('div.item-list-tabs ul li#activity-favorites span').html( Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) - 1 );
+
+                                        if ( !Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) ) {
+                                                j('div.item-list-tabs ul li#activity-favorites').remove();
+
+                                                bp_activity_request( null, null );
+                                        }
+                                }
+
+                                if ( 'activity-favorites' == j( 'div.item-list-tabs li.selected').attr('id') )
+                                        target.parent().parent().parent().slideUp(100);
+                        });
+
+                        return false;
+                }
+
</ins><span class="cx">                 /* Load more updates at the end of the page */
</span><del>-                if ( target.attr('class') == 'load-more' ) {
</del><ins>+                if ( target.parent().attr('class') == 'load-more' ) {
</ins><span class="cx">                         j("li.load-more span.ajax-loader").show();
</span><span class="cx">
</span><span class="cx">                         var oldest_page = ( j.cookie('bp-activity-oldestpage') * 1 ) + 1;
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityactivityloopphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/activity-loop.php (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/activity-loop.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-themes/bp-default/activity/activity-loop.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -17,12 +17,18 @@
</span><span class="cx">
</span><span class="cx">                                 <div class="activity-meta">
</span><span class="cx">                                         <?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?>
</span><del>-                                                        <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Comment', 'buddypress' ) ?> (<?php bp_activity_comment_count() ?>)</a>
</del><ins>+                                                <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Comment', 'buddypress' ) ?> (<?php bp_activity_comment_count() ?>)</a>
</ins><span class="cx">                                         <?php endif; ?>
</span><span class="cx">
</span><span class="cx">                                         <?php if ( !bp_is_activity_permalink() ) : ?>
</span><del>-                                                <a href="<?php bp_activity_thread_permalink() ?>" title="<?php _e( 'View Thread', 'buddypress' ) ?>"><?php _e( 'View Thread', 'buddypress' ) ?></a>
</del><ins>+                                                <a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'View Thread', 'buddypress' ) ?>"><?php _e( 'View Thread', 'buddypress' ) ?></a>
</ins><span class="cx">                                         <?php endif; ?>
</span><ins>+
+                                        <?php if ( !bp_get_activity_is_favorite() ) : ?>
+                                                <a href="" class="fav" title="<?php _e( 'Mark Favorite', 'buddypress' ) ?>"><?php _e( 'Mark Favorite', 'buddypress' ) ?></a>
+                                        <?php else : ?>
+                                                <a href="" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a>
+                                        <?php endif; ?>
</ins><span class="cx">                                 </div>
</span><span class="cx">                         </div>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultactivityindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/activity/index.php (2211 => 2212)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/activity/index.php        2009-12-27 10:59:44 UTC (rev 2211)
+++ trunk/bp-themes/bp-default/activity/index.php        2009-12-27 13:04:36 UTC (rev 2212)
</span><span class="lines">@@ -27,13 +27,17 @@
</span><span class="cx">                                                                 <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-friends/' ?>"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?></a></li>
</span><span class="cx">                                                         <?php endif; ?>
</span><span class="cx">
</span><del>-                                                        <?php if ( bp_get_total_group_count( bp_loggedin_user_id() ) ) : ?>
</del><ins>+                                                        <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
</ins><span class="cx">                                                                 <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-groups/' ?>"><?php printf( __( 'My Groups (%s)', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
</span><span class="cx">                                                         <?php endif; ?>
</span><span class="cx">
</span><ins>+                                                        <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
+                                                                <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . BP_ACTIVITY_SLUG . '/my-favorites/' ?>"><?php printf( __( 'My Favorites (<span>%s</span>)', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) ?></a></li>
+                                                        <?php endif; ?>
+
</ins><span class="cx">                                                 <?php endif; ?>
</span><span class="cx">
</span><del>-                                                <?php do_action( 'bp_activity_types' ) ?>
</del><ins>+                                                <?php do_action( 'bp_activity_type_tabs' ) ?>
</ins><span class="cx">
</span><span class="cx">                                                 <li id="activity-filter-select" class="last">
</span><span class="cx">                                                         <select>
</span></span></pre>
</div>
</div>
</body>
</html>