<!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->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->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">                         <div class="bp-widget">
</span><span class="cx">                                 <h4><?php _e( 'My Friends Activity', 'buddypress' ) ?> <a href="<?php bp_activities_member_rss_link() ?>" title="<?php _e( 'RSS Feed', 'buddypress' ) ?>"><?php _e( 'RSS Feed', 'buddypress' ) ?></a></h4>
</span><span class="cx">
</span><del>-                                <?php if ( bp_has_activities( 'user_id=' . bp_get_friend_ids() . '&per_page=25&max=500&display_comments=stream' ) ) : ?>
</del><ins>+                                <?php if ( $friend_ids = bp_get_friend_ids() ) : ?>
</ins><span class="cx">
</span><del>-                                        <div class="pagination">
</del><ins>+                                        <?php if ( bp_has_activities( 'user_id=' . $friend_ids . '&per_page=25&max=500&display_comments=stream' ) ) : ?>
</ins><span class="cx">
</span><del>-                                                <div class="pag-count" id="activity-count">
-                                                        <?php bp_activity_pagination_count() ?>
-                                                </div>
</del><ins>+                                                <div class="pagination">
</ins><span class="cx">
</span><del>-                                                <div class="pagination-links" id="activity-pag">
-                                                        &nbsp; <?php bp_activity_pagination_links() ?>
</del><ins>+                                                        <div class="pag-count" id="activity-count">
+                                                                <?php bp_activity_pagination_count() ?>
+                                                        </div>
+
+                                                        <div class="pagination-links" id="activity-pag">
+                                                                &nbsp; <?php bp_activity_pagination_links() ?>
+                                                        </div>
+
</ins><span class="cx">                                                 </div>
</span><span class="cx">
</span><del>-                                        </div>
</del><ins>+                                                <ul id="activity-list" class="item-list activity-list">
+                                                <?php while ( bp_activities() ) : bp_the_activity(); ?>
+                                                        <li class="<?php bp_activity_css_class() ?>">
+                                                                <div class="activity-avatar">
+                                                                        <?php bp_activity_avatar() ?>
+                                                                </div>
</ins><span class="cx">
</span><del>-                                        <ul id="activity-list" class="item-list activity-list">
-                                        <?php while ( bp_activities() ) : bp_the_activity(); ?>
-                                                <li class="<?php bp_activity_css_class() ?>">
-                                                        <div class="activity-avatar">
-                                                                <?php bp_activity_avatar() ?>
-                                                        </div>
</del><ins>+                                                                <?php bp_activity_content() ?>
</ins><span class="cx">
</span><del>-                                                        <?php bp_activity_content() ?>
</del><ins>+                                                                <?php do_action( 'bp_friends_activity_item' ) ?>
+                                                        </li>
+                                                <?php endwhile; ?>
+                                                </ul>
</ins><span class="cx">
</span><del>-                                                        <?php do_action( 'bp_friends_activity_item' ) ?>
-                                                </li>
-                                        <?php endwhile; ?>
-                                        </ul>
</del><ins>+                                                <?php do_action( 'bp_friends_activity_content' ) ?>
</ins><span class="cx">
</span><del>-                                        <?php do_action( 'bp_friends_activity_content' ) ?>
</del><ins>+                                        <?php endif; ?>
</ins><span class="cx">
</span><span class="cx">                                 <?php else: ?>
</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">                         <?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ) ?>
</span><span class="cx">                         <input type="hidden" id="aw-querystring" name="aw-querystring" value="" />
</span><span class="cx">                         <input type="hidden" id="aw-oldestpage" name="aw-oldestpage" value="1" />
</span><del>-                </div>
</del><ins>+                </form>
</ins><span class="cx">
</span><span class="cx">         <?php echo $after_widget; ?>
</span><span class="cx">         <?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->loggedin_user->id ) );
</del><ins>+                                if ( !$friend_ids = friends_get_friend_user_ids( $bp->loggedin_user->id ) ) {
+                                        echo "-1<div id='message' class='info'><p>" . __( 'No activity found', 'buddypress' ) . '</p></div>';
+                                        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">                                         <li<?php if ( bp_is_page( BP_GROUPS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_GROUPS_SLUG ?>" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a></li>
</span><span class="cx">                                 <?php endif; ?>
</span><span class="cx">
</span><del>-                                <?php if ( function_exists( 'groups_install' ) && ( function_exists( 'bp_forums_setup' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) ) : ?>
</del><ins>+                                <?php if ( function_exists( 'groups_install' ) && ( function_exists( 'bp_forums_is_installed_correctly' ) && !(int) get_site_option( 'bp-disable-forum-directory' ) ) && bp_forums_is_installed_correctly() ) : ?>
</ins><span class="cx">                                         <li<?php if ( bp_is_page( BP_FORUMS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_FORUMS_SLUG ?>" title="<?php _e( 'Forums', 'buddypress' ) ?>"><?php _e( 'Forums', 'buddypress' ) ?></a></li>
</span><span class="cx">                                 <?php endif; ?>
</span><span class="cx">
</span><del>-                                <?php if ( function_exists( 'bp_blogs_install' ) ) : ?>
</del><ins>+                                <?php if ( function_exists( 'bp_blogs_install' ) && bp_core_is_multisite() ) : ?>
</ins><span class="cx">                                         <li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) : ?> class="selected"<?php endif; ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
</span><span class="cx">                                 <?php endif; ?>
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>