<!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] [2445] trunk: Fixes for the activity widget in bp-sn-parent.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>2445</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-25 12:42:20 +0000 (Mon, 25 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixes for the activity widget in bp-sn-parent.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpfriendsbpfriendstemplatetagsphp">trunk/bp-friends/bp-friends-templatetags.php</a></li>
<li><a href="#trunkbpthemesbpsnparentactivitymyfriendsphp">trunk/bp-themes/bp-sn-parent/activity/my-friends.php</a></li>
<li><a href="#trunkbpthemesbpsnparentfunctionsphp">trunk/bp-themes/bp-sn-parent/functions.php</a></li>
<li><a href="#trunkbpthemesbpsnparentheaderphp">trunk/bp-themes/bp-sn-parent/header.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpfriendsbpfriendstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends/bp-friends-templatetags.php (2444 => 2445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends/bp-friends-templatetags.php        2010-01-25 12:32:11 UTC (rev 2444)
+++ trunk/bp-friends/bp-friends-templatetags.php        2010-01-25 12:42:20 UTC (rev 2445)
</span><span class="lines">@@ -152,6 +152,11 @@
</span><span class="cx">         if ( !$user_id )
</span><span class="cx">                 $user_id = ( $bp-&gt;displayed_user-&gt;id ) ? $bp-&gt;displayed_user-&gt;id : $bp-&gt;loggedin_user-&gt;id;
</span><span class="cx"> 
</span><ins>+        $friend_ids = friends_get_friend_user_ids( $user_id );
+
+        if ( empty( $friend_ids ) )
+                return false;
+
</ins><span class="cx">         return implode( ',', friends_get_friend_user_ids( $user_id ) );
</span><span class="cx"> }
</span><span class="cx"> function bp_get_friendship_requests() {
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentactivitymyfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/activity/my-friends.php (2444 => 2445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/activity/my-friends.php        2010-01-25 12:32:11 UTC (rev 2444)
+++ trunk/bp-themes/bp-sn-parent/activity/my-friends.php        2010-01-25 12:42:20 UTC (rev 2445)
</span><span class="lines">@@ -21,35 +21,39 @@
</span><span class="cx">                         &lt;div class=&quot;bp-widget&quot;&gt;
</span><span class="cx">                                 &lt;h4&gt;&lt;?php _e( 'My Friends Activity', 'buddypress' ) ?&gt; &lt;a href=&quot;&lt;?php bp_activities_member_rss_link() ?&gt;&quot; title=&quot;&lt;?php _e( 'RSS Feed', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'RSS Feed', 'buddypress' ) ?&gt;&lt;/a&gt;&lt;/h4&gt;
</span><span class="cx"> 
</span><del>-                                &lt;?php if ( bp_has_activities( 'user_id=' . bp_get_friend_ids() . '&amp;per_page=25&amp;max=500&amp;display_comments=stream' ) ) : ?&gt;
</del><ins>+                                &lt;?php if ( $friend_ids = bp_get_friend_ids() ) : ?&gt;
</ins><span class="cx"> 
</span><del>-                                        &lt;div class=&quot;pagination&quot;&gt;
</del><ins>+                                        &lt;?php if ( bp_has_activities( 'user_id=' . $friend_ids . '&amp;per_page=25&amp;max=500&amp;display_comments=stream' ) ) : ?&gt;
</ins><span class="cx"> 
</span><del>-                                                &lt;div class=&quot;pag-count&quot; id=&quot;activity-count&quot;&gt;
-                                                        &lt;?php bp_activity_pagination_count() ?&gt;
-                                                &lt;/div&gt;
</del><ins>+                                                &lt;div class=&quot;pagination&quot;&gt;
</ins><span class="cx"> 
</span><del>-                                                &lt;div class=&quot;pagination-links&quot; id=&quot;activity-pag&quot;&gt;
-                                                        &amp;nbsp; &lt;?php bp_activity_pagination_links() ?&gt;
</del><ins>+                                                        &lt;div class=&quot;pag-count&quot; id=&quot;activity-count&quot;&gt;
+                                                                &lt;?php bp_activity_pagination_count() ?&gt;
+                                                        &lt;/div&gt;
+
+                                                        &lt;div class=&quot;pagination-links&quot; id=&quot;activity-pag&quot;&gt;
+                                                                &amp;nbsp; &lt;?php bp_activity_pagination_links() ?&gt;
+                                                        &lt;/div&gt;
+
</ins><span class="cx">                                                 &lt;/div&gt;
</span><span class="cx"> 
</span><del>-                                        &lt;/div&gt;
</del><ins>+                                                &lt;ul id=&quot;activity-list&quot; class=&quot;item-list activity-list&quot;&gt;
+                                                &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
+                                                        &lt;li class=&quot;&lt;?php bp_activity_css_class() ?&gt;&quot;&gt;
+                                                                &lt;div class=&quot;activity-avatar&quot;&gt;
+                                                                        &lt;?php bp_activity_avatar() ?&gt;
+                                                                &lt;/div&gt;
</ins><span class="cx"> 
</span><del>-                                        &lt;ul id=&quot;activity-list&quot; class=&quot;item-list activity-list&quot;&gt;
-                                        &lt;?php while ( bp_activities() ) : bp_the_activity(); ?&gt;
-                                                &lt;li class=&quot;&lt;?php bp_activity_css_class() ?&gt;&quot;&gt;
-                                                        &lt;div class=&quot;activity-avatar&quot;&gt;
-                                                                &lt;?php bp_activity_avatar() ?&gt;
-                                                        &lt;/div&gt;
</del><ins>+                                                                &lt;?php bp_activity_content() ?&gt;
</ins><span class="cx"> 
</span><del>-                                                        &lt;?php bp_activity_content() ?&gt;
</del><ins>+                                                                &lt;?php do_action( 'bp_friends_activity_item' ) ?&gt;
+                                                        &lt;/li&gt;
+                                                &lt;?php endwhile; ?&gt;
+                                                &lt;/ul&gt;
</ins><span class="cx"> 
</span><del>-                                                        &lt;?php do_action( 'bp_friends_activity_item' ) ?&gt;
-                                                &lt;/li&gt;
-                                        &lt;?php endwhile; ?&gt;
-                                        &lt;/ul&gt;
</del><ins>+                                                &lt;?php do_action( 'bp_friends_activity_content' ) ?&gt;
</ins><span class="cx"> 
</span><del>-                                        &lt;?php do_action( 'bp_friends_activity_content' ) ?&gt;
</del><ins>+                                        &lt;?php endif; ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                                 &lt;?php else: ?&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/functions.php (2444 => 2445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/functions.php        2010-01-25 12:32:11 UTC (rev 2444)
+++ trunk/bp-themes/bp-sn-parent/functions.php        2010-01-25 12:42:20 UTC (rev 2445)
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx">                         &lt;?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ) ?&gt;
</span><span class="cx">                         &lt;input type=&quot;hidden&quot; id=&quot;aw-querystring&quot; name=&quot;aw-querystring&quot; value=&quot;&quot; /&gt;
</span><span class="cx">                         &lt;input type=&quot;hidden&quot; id=&quot;aw-oldestpage&quot; name=&quot;aw-oldestpage&quot; value=&quot;1&quot; /&gt;
</span><del>-                &lt;/div&gt;
</del><ins>+                &lt;/form&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;?php echo $after_widget; ?&gt;
</span><span class="cx">         &lt;?php
</span><span class="lines">@@ -220,7 +220,12 @@
</span><span class="cx"> 
</span><span class="cx">                 switch( $type ) {
</span><span class="cx">                         case 'friends':
</span><del>-                                $friend_ids = implode( ',', friends_get_friend_user_ids( $bp-&gt;loggedin_user-&gt;id ) );
</del><ins>+                                if ( !$friend_ids = friends_get_friend_user_ids( $bp-&gt;loggedin_user-&gt;id ) ) {
+                                        echo &quot;-1&lt;div id='message' class='info'&gt;&lt;p&gt;&quot; . __( 'No activity found', 'buddypress' ) . '&lt;/p&gt;&lt;/div&gt;';
+                                        return false;
+                                }
+
+                                $friend_ids = implode( ',', $friend_ids );
</ins><span class="cx">                                 $query_string = 'user_id=' . $friend_ids;
</span><span class="cx">                                 break;
</span><span class="cx">                         case 'groups':
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/header.php (2444 => 2445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/header.php        2010-01-25 12:32:11 UTC (rev 2444)
+++ trunk/bp-themes/bp-sn-parent/header.php        2010-01-25 12:42:20 UTC (rev 2445)
</span><span class="lines">@@ -91,11 +91,11 @@
</span><span class="cx">                                         &lt;li&lt;?php if ( bp_is_page( BP_GROUPS_SLUG ) ) : ?&gt; class=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;&lt;a href=&quot;&lt;?php echo get_option('home') ?&gt;/&lt;?php echo BP_GROUPS_SLUG ?&gt;&quot; title=&quot;&lt;?php _e( 'Groups', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Groups', 'buddypress' ) ?&gt;&lt;/a&gt;&lt;/li&gt;
</span><span class="cx">                                 &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><del>-                                &lt;?php if ( function_exists( 'groups_install' ) &amp;&amp; ( function_exists( 'bp_forums_setup' ) &amp;&amp; !(int) get_site_option( 'bp-disable-forum-directory' ) ) ) : ?&gt;
</del><ins>+                                &lt;?php if ( function_exists( 'groups_install' ) &amp;&amp; ( function_exists( 'bp_forums_is_installed_correctly' ) &amp;&amp; !(int) get_site_option( 'bp-disable-forum-directory' ) ) &amp;&amp; bp_forums_is_installed_correctly() ) : ?&gt;
</ins><span class="cx">                                         &lt;li&lt;?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?&gt; class=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;&lt;a href=&quot;&lt;?php echo get_option('home') ?&gt;/&lt;?php echo BP_FORUMS_SLUG ?&gt;&quot; title=&quot;&lt;?php _e( 'Forums', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Forums', 'buddypress' ) ?&gt;&lt;/a&gt;&lt;/li&gt;
</span><span class="cx">                                 &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span><del>-                                &lt;?php if ( function_exists( 'bp_blogs_install' ) ) : ?&gt;
</del><ins>+                                &lt;?php if ( function_exists( 'bp_blogs_install' ) &amp;&amp; bp_core_is_multisite() ) : ?&gt;
</ins><span class="cx">                                         &lt;li&lt;?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?&gt; class=&quot;selected&quot;&lt;?php endif; ?&gt;&gt;&lt;a href=&quot;&lt;?php echo get_option('home') ?&gt;/&lt;?php echo BP_BLOGS_SLUG ?&gt;&quot; title=&quot;&lt;?php _e( 'Blogs', 'buddypress' ) ?&gt;&quot;&gt;&lt;?php _e( 'Blogs', 'buddypress' ) ?&gt;&lt;/a&gt;&lt;/li&gt;
</span><span class="cx">                                 &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>