<!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" />
<title>[BuddyPress][3542] trunk: Fixes some more PHP notices</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>3542</dd>
<dt>Author</dt> <dd>djpaul</dd>
<dt>Date</dt> <dd>2010-12-19 14:00:55 +0000 (Sun, 19 Dec 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fixes some more PHP notices</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoreclassesphp">trunk/bp-core/bp-core-classes.php</a></li>
<li><a href="#trunkbpforumsbpforumsfiltersphp">trunk/bp-forums/bp-forums-filters.php</a></li>
<li><a href="#trunkbpfriendsphp">trunk/bp-friends.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatetagsphp">trunk/bp-groups/bp-groups-templatetags.php</a></li>
<li><a href="#trunkbpmessagesbpmessagesclassesphp">trunk/bp-messages/bp-messages-classes.php</a></li>
<li><a href="#trunkbpxprofilebpxprofileclassesphp">trunk/bp-xprofile/bp-xprofile-classes.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoreclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-classes.php (3541 => 3542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-classes.php        2010-12-19 12:29:04 UTC (rev 3541)
+++ trunk/bp-core/bp-core-classes.php        2010-12-19 14:00:55 UTC (rev 3542)
</span><span class="lines">@@ -283,6 +283,7 @@
</span><span class="cx">         function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
</span><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span><ins>+                $pag_sql = '';
</ins><span class="cx">                 if ( $limit &amp;&amp; $page )
</span><span class="cx">                         $pag_sql = $wpdb-&gt;prepare( &quot; LIMIT %d, %d&quot;, intval( ( $page - 1 ) * $limit), intval( $limit ) );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpforumsbpforumsfiltersphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums/bp-forums-filters.php (3541 => 3542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums/bp-forums-filters.php        2010-12-19 12:29:04 UTC (rev 3541)
+++ trunk/bp-forums/bp-forums-filters.php        2010-12-19 14:00:55 UTC (rev 3542)
</span><span class="lines">@@ -100,11 +100,9 @@
</span><span class="cx"> function bp_forums_add_forum_topic_to_page_title( $title ) {
</span><span class="cx">         global $bp;
</span><span class="cx"> 
</span><del>-        if ( $bp-&gt;current_action == 'forum' &amp;&amp; $bp-&gt;action_variables[0] == 'topic' ) {
-                if ( bp_has_forum_topic_posts() ) {
</del><ins>+        if ( $bp-&gt;current_action == 'forum' &amp;&amp; !empty( $bp-&gt;action_variables[0] ) &amp;&amp; 'topic' == $bp-&gt;action_variables[0] )
+                if ( bp_has_forum_topic_posts() )
</ins><span class="cx">                         $title .= ' &amp;#124; ' . bp_get_the_topic_title();
</span><del>-                }
-        }
</del><span class="cx"> 
</span><span class="cx">         return $title;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkbpfriendsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-friends.php (3541 => 3542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-friends.php        2010-12-19 12:29:04 UTC (rev 3541)
+++ trunk/bp-friends.php        2010-12-19 14:00:55 UTC (rev 3542)
</span><span class="lines">@@ -258,6 +258,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function friends_delete_activity( $args ) {
</span><ins>+        global $bp;
+
</ins><span class="cx">         if ( function_exists('bp_activity_delete_by_item_id') ) {
</span><span class="cx">                 extract( (array)$args );
</span><span class="cx">                 bp_activity_delete_by_item_id( array( 'item_id' =&gt; $item_id, 'component' =&gt; $bp-&gt;friends-&gt;id, 'type' =&gt; $type, 'user_id' =&gt; $user_id, 'secondary_item_id' =&gt; $secondary_item_id ) );
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (3541 => 3542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2010-12-19 12:29:04 UTC (rev 3541)
+++ trunk/bp-groups/bp-groups-classes.php        2010-12-19 14:00:55 UTC (rev 3542)
</span><span class="lines">@@ -1005,15 +1005,19 @@
</span><span class="cx">         function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
</span><span class="cx">                 global $bp, $wpdb;
</span><span class="cx"> 
</span><ins>+                $pag_sql = '';
</ins><span class="cx">                 if ( $limit &amp;&amp; $page )
</span><span class="cx">                         $pag_sql = $wpdb-&gt;prepare( &quot;LIMIT %d, %d&quot;, intval( ( $page - 1 ) * $limit), intval( $limit ) );
</span><span class="cx"> 
</span><ins>+                $exclude_admins_sql = '';
</ins><span class="cx">                 if ( $exclude_admins_mods )
</span><span class="cx">                         $exclude_admins_sql = $wpdb-&gt;prepare( &quot;AND is_admin = 0 AND is_mod = 0&quot; );
</span><span class="cx"> 
</span><ins>+                $banned_sql = '';
</ins><span class="cx">                 if ( $exclude_banned )
</span><span class="cx">                         $banned_sql = $wpdb-&gt;prepare( &quot; AND is_banned = 0&quot; );
</span><span class="cx"> 
</span><ins>+                $exclude_sql = '';
</ins><span class="cx">                 if ( $exclude )
</span><span class="cx">                         $exclude_sql = $wpdb-&gt;prepare( &quot; AND m.user_id NOT IN ({$exclude})&quot; );
</span><span class="cx"> 
</span><span class="lines">@@ -1025,8 +1029,8 @@
</span><span class="cx">                 if ( !$members )
</span><span class="cx">                         return false;
</span><span class="cx"> 
</span><del>-                if ( !isset($pag_sql) )
-                        $total_member_count = count($members);
</del><ins>+                if ( empty( $pag_sql ) )
+                        $total_member_count = count( $members );
</ins><span class="cx">                 else
</span><span class="cx">                         $total_member_count = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT(user_id) FROM {$bp-&gt;groups-&gt;table_name_members} WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}&quot;, $group_id ) );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-templatetags.php (3541 => 3542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-templatetags.php        2010-12-19 12:29:04 UTC (rev 3541)
+++ trunk/bp-groups/bp-groups-templatetags.php        2010-12-19 14:00:55 UTC (rev 3542)
</span><span class="lines">@@ -1503,7 +1503,7 @@
</span><span class="cx">         function bp_get_group_member_is_friend() {
</span><span class="cx">                 global $members_template;
</span><span class="cx"> 
</span><del>-                if ( null === $members_template-&gt;member-&gt;is_friend )
</del><ins>+                if ( !isset( $members_template-&gt;member-&gt;is_friend ) )
</ins><span class="cx">                         $friend_status = 'not_friends';
</span><span class="cx">                 else
</span><span class="cx">                         $friend_status = ( 0 == $members_template-&gt;member-&gt;is_friend ) ? 'pending' : 'is_friend';
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagesclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-classes.php (3541 => 3542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-classes.php        2010-12-19 12:29:04 UTC (rev 3541)
+++ trunk/bp-messages/bp-messages-classes.php        2010-12-19 14:00:55 UTC (rev 3542)
</span><span class="lines">@@ -80,12 +80,14 @@
</span><span class="cx">         function get_current_threads_for_user( $user_id, $box = 'inbox', $type = 'all', $limit = null, $page = null ) {
</span><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span><ins>+                $pag_sql = '';
</ins><span class="cx">                 if ( $limit &amp;&amp; $page )
</span><span class="cx">                         $pag_sql = $wpdb-&gt;prepare( &quot; LIMIT %d, %d&quot;, intval( ( $page - 1 ) * $limit), intval( $limit ) );
</span><span class="cx"> 
</span><ins>+                $type_sql = '';
</ins><span class="cx">                 if ( $type == 'unread' )
</span><span class="cx">                         $type_sql = $wpdb-&gt;prepare( &quot; AND r.unread_count != 0 &quot; );
</span><del>-                else if ( $type == 'read' )
</del><ins>+                elseif ( $type == 'read' )
</ins><span class="cx">                         $type_sql = $wpdb-&gt;prepare( &quot; AND r.unread_count = 0 &quot; );
</span><span class="cx"> 
</span><span class="cx">                 if ( 'sentbox' == $box ) {
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofileclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-classes.php (3541 => 3542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-classes.php        2010-12-19 12:29:04 UTC (rev 3541)
+++ trunk/bp-xprofile/bp-xprofile-classes.php        2010-12-19 14:00:55 UTC (rev 3542)
</span><span class="lines">@@ -115,11 +115,11 @@
</span><span class="cx"> 
</span><span class="cx">                 $r = wp_parse_args( $args, $defaults );
</span><span class="cx">                 extract( $r, EXTR_SKIP );
</span><ins>+                $where_sql = '';
</ins><span class="cx"> 
</span><del>-                $group_id_sql = '';
</del><span class="cx">                 if ( $profile_group_id )
</span><span class="cx">                         $where_sql = $wpdb-&gt;prepare( 'WHERE g.id = %d', $profile_group_id );
</span><del>-                else if ( $exclude_groups )
</del><ins>+                elseif ( $exclude_groups )
</ins><span class="cx">                         $where_sql = $wpdb-&gt;prepare( &quot;WHERE g.id NOT IN ({$exclude_groups})&quot;);
</span><span class="cx"> 
</span><span class="cx">                 if ( $hide_empty_groups )
</span><span class="lines">@@ -140,6 +140,7 @@
</span><span class="cx">                 if ( empty( $group_ids ) )
</span><span class="cx">                         return $groups;
</span><span class="cx"> 
</span><ins>+                $exclude_fields_sql = '';
</ins><span class="cx">                 if ( $exclude_fields )
</span><span class="cx">                         $exclude_fields_sql = $wpdb-&gt;prepare( &quot;AND id NOT IN ({$exclude_fields})&quot; );
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>