<!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][5822] trunk: Add ajax search to Private Messages inbox and sentbox.</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><a href="http://buddypress.trac.wordpress.org/changeset/5822">5822</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-02-21 20:50:41 +0000 (Tue, 21 Feb 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add ajax search to Private Messages inbox and sentbox. Fixes <a href="http://buddypress.trac.wordpress.org/ticket/3993">#3993</a>. Props sbrajesh.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoretemplatephp">trunk/bp-core/bp-core-template.php</a></li>
<li><a href="#trunkbpmessagesbpmessagesclassesphp">trunk/bp-messages/bp-messages-classes.php</a></li>
<li><a href="#trunkbpmessagesbpmessagestemplatephp">trunk/bp-messages/bp-messages-template.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpdefault_inccssdefaultrtlcss">trunk/bp-themes/bp-default/_inc/css/default-rtl.css</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="#trunkbpthemesbpdefaultmemberssinglemessagesmessagesloopphp">trunk/bp-themes/bp-default/members/single/messages/messages-loop.php</a></li>
<li><a href="#trunkbpthemesbpdefaultmemberssinglemessagesphp">trunk/bp-themes/bp-default/members/single/messages.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoretemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-template.php (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-template.php        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-core/bp-core-template.php        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -1452,7 +1452,13 @@
</span><span class="cx">         return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function bp_is_messages_conversation() {
+        if ( bp_is_user_messages() &amp;&amp; ( bp_is_current_action( 'view' ) ) )
+                return true;
</ins><span class="cx"> 
</span><ins>+        return false;
+}
+
</ins><span class="cx"> function bp_is_single( $component, $callback ) {
</span><span class="cx">         if ( bp_is_current_component( $component ) &amp;&amp; ( true === call_user_func( $callback ) ) )
</span><span class="cx">                 return true;
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagesclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-classes.php (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-classes.php        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-messages/bp-messages-classes.php        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -88,10 +88,10 @@
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function get_current_threads_for_user( $user_id, $box = 'inbox', $type = 'all', $limit = null, $page = null ) {
</del><ins>+        function get_current_threads_for_user( $user_id, $box = 'inbox', $type = 'all', $limit = null, $page = null, $search_terms = '' ) {
</ins><span class="cx">                 global $wpdb, $bp;
</span><span class="cx"> 
</span><del>-                $pag_sql = $type_sql = '';
</del><ins>+                $pag_sql = $type_sql = $search_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 class="lines">@@ -100,12 +100,17 @@
</span><span class="cx">                 elseif ( $type == 'read' )
</span><span class="cx">                         $type_sql = $wpdb-&gt;prepare( &quot; AND r.unread_count = 0 &quot; );
</span><span class="cx"> 
</span><ins>+                if ( !empty( $search_terms ) ) {
+                        $search_terms = like_escape( $wpdb-&gt;escape( $search_terms ) );
+                        $search_sql   = &quot;AND ( subject LIKE '%%$search_terms%%' OR message LIKE '%%$search_terms%%' )&quot;;
+                }
+                
</ins><span class="cx">                 if ( 'sentbox' == $box ) {
</span><del>-                        $thread_ids = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}&quot;, $user_id ) );
-                        $total_threads = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 &quot;, $user_id ) );
</del><ins>+                        $thread_ids    = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 {$search_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}&quot;, $user_id ) );
+                        $total_threads = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 {$search_sql} &quot;, $user_id ) );
</ins><span class="cx">                 } else {
</span><del>-                        $thread_ids = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}&quot;, $user_id ) );
-                        $total_threads = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql}&quot;, $user_id ) );
</del><ins>+                        $thread_ids = $wpdb-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql} {$search_sql} GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}&quot;, $user_id ) );
+                        $total_threads = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp-&gt;messages-&gt;table_name_recipients} r, {$bp-&gt;messages-&gt;table_name_messages} m WHERE m.thread_id = r.thread_id AND r.is_deleted = 0 AND r.user_id = %d AND r.sender_only = 0 {$type_sql} {$search_sql} &quot;, $user_id ) );
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if ( empty( $thread_ids ) )
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-template.php (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-template.php        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-messages/bp-messages-template.php        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -27,23 +27,25 @@
</span><span class="cx">         var $pag_page;
</span><span class="cx">         var $pag_num;
</span><span class="cx">         var $pag_links;
</span><ins>+        var $search_terms;
</ins><span class="cx"> 
</span><span class="cx">         function bp_messages_box_template( $user_id, $box, $per_page, $max, $type ) {
</span><span class="cx">                 $this-&gt;__construct( $user_id, $box, $per_page, $max, $type );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        function __construct( $user_id, $box, $per_page, $max, $type ) {
</del><ins>+        function __construct( $user_id, $box, $per_page, $max, $type, $search_terms ) {
</ins><span class="cx">                 $this-&gt;pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1;
</span><del>-                $this-&gt;pag_num  = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
</del><ins>+                $this-&gt;pag_num  = isset( $_GET['num'] )   ? intval( $_GET['num'] )   : $per_page;
</ins><span class="cx"> 
</span><del>-                $this-&gt;user_id  = $user_id;
-                $this-&gt;box      = $box;
-                $this-&gt;type     = $type;
-
</del><ins>+                $this-&gt;user_id      = $user_id;
+                $this-&gt;box          = $box;
+                $this-&gt;type         = $type;
+                $this-&gt;search_terms = $search_terms;
+                
</ins><span class="cx">                 if ( 'notices' == $this-&gt;box ) {
</span><span class="cx">                         $this-&gt;threads = BP_Messages_Notice::get_notices();
</span><span class="cx">                 } else {
</span><del>-                        $threads = BP_Messages_Thread::get_current_threads_for_user( $this-&gt;user_id, $this-&gt;box, $this-&gt;type, $this-&gt;pag_num, $this-&gt;pag_page );
</del><ins>+                        $threads = BP_Messages_Thread::get_current_threads_for_user( $this-&gt;user_id, $this-&gt;box, $this-&gt;type, $this-&gt;pag_num, $this-&gt;pag_page, $this-&gt;search_terms );
</ins><span class="cx"> 
</span><span class="cx">                         $this-&gt;threads            = $threads['threads'];
</span><span class="cx">                         $this-&gt;total_thread_count = $threads['total'];
</span><span class="lines">@@ -168,11 +170,12 @@
</span><span class="cx">         global $bp, $messages_template;
</span><span class="cx"> 
</span><span class="cx">         $defaults = array(
</span><del>-                'user_id'  =&gt; bp_loggedin_user_id(),
-                'box'      =&gt; 'inbox',
-                'per_page' =&gt; 10,
-                'max'      =&gt; false,
-                'type'     =&gt; 'all'
</del><ins>+                'user_id'      =&gt; bp_loggedin_user_id(),
+                'box'          =&gt; 'inbox',
+                'per_page'     =&gt; 10,
+                'max'          =&gt; false,
+                'type'         =&gt; 'all',
+                'search_terms' =&gt; isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''
</ins><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         $r = wp_parse_args( $args, $defaults );
</span><span class="lines">@@ -193,7 +196,7 @@
</span><span class="cx">                         $box = 'notices';
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type );
</del><ins>+                $messages_template = new BP_Messages_Box_Template( $user_id, $box, $per_page, $max, $type, $search_terms );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return apply_filters( 'bp_has_message_threads', $messages_template-&gt;has_threads(), $messages_template );
</span><span class="lines">@@ -356,6 +359,24 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Output the Private Message search form
+ *
+ * @since BuddyPress (1.6)
+ */
+function bp_message_search_form() {
+
+        $default_search_value = bp_get_search_default_text( 'messages' );
+        $search_value         = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; ?&gt;
+
+        &lt;form action=&quot;&quot; method=&quot;get&quot; id=&quot;search-message-form&quot;&gt;
+                &lt;label&gt;&lt;input type=&quot;text&quot; name=&quot;s&quot; id=&quot;messages_search&quot; &lt;?php if ( $search_value === $default_search_value ) : ?&gt;placeholder=&quot;&lt;?php echo esc_html( $search_value ); ?&gt;&quot;&lt;?php endif; ?&gt; &lt;?php if ( $search_value !== $default_search_value ) : ?&gt;value=&quot;&lt;?php echo esc_html( $search_value ); ?&gt;&quot;&lt;?php endif; ?&gt; /&gt;&lt;/label&gt;
+                &lt;input type=&quot;submit&quot; id=&quot;messages_search_submit&quot; name=&quot;messages_search_submit&quot; value=&quot;&lt;?php _e( 'Search', 'buddypress' ) ?&gt;&quot; /&gt;
+        &lt;/form&gt;
+
+&lt;?php
+}
+
+/**
</ins><span class="cx">  * Echoes the form action for Messages HTML forms
</span><span class="cx">  *
</span><span class="cx">  * @package BuddyPress
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -100,11 +100,20 @@
</span><span class="cx">         // Locate the object template
</span><span class="cx">         locate_template( array( &quot;$object/$object-loop.php&quot; ), true );
</span><span class="cx"> }
</span><del>-add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_template_loader' );
-add_action( 'wp_ajax_groups_filter',  'bp_dtheme_object_template_loader' );
-add_action( 'wp_ajax_blogs_filter',   'bp_dtheme_object_template_loader' );
-add_action( 'wp_ajax_forums_filter',  'bp_dtheme_object_template_loader' );
</del><ins>+add_action( 'wp_ajax_members_filter',  'bp_dtheme_object_template_loader'   );
+add_action( 'wp_ajax_groups_filter',   'bp_dtheme_object_template_loader'   );
+add_action( 'wp_ajax_blogs_filter',    'bp_dtheme_object_template_loader'   );
+add_action( 'wp_ajax_forums_filter',   'bp_dtheme_object_template_loader'   );
+add_action( 'wp_ajax_messages_filter', 'bp_dtheme_messages_template_loader' );
</ins><span class="cx"> 
</span><ins>+/*
+ * Load messages when searched on the private message page
+ */
+
+function bp_dtheme_messages_template_loader(){
+    locate_template( array( 'members/single/messages/messages-loop.php' ), true );
+}
+
</ins><span class="cx"> // This function will load the activity loop template when activity is requested via AJAX
</span><span class="cx"> function bp_dtheme_activity_template_loader() {
</span><span class="cx"> 
</span><span class="lines">@@ -710,4 +719,4 @@
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_messages_autocomplete_results', 'bp_dtheme_ajax_messages_autocomplete_results' );
</span><span class="cx"> 
</span><del>-?&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+?&gt;
</ins></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssdefaultrtlcss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/default-rtl.css (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/default-rtl.css        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-themes/bp-default/_inc/css/default-rtl.css        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -760,4 +760,7 @@
</span><span class="cx"> }
</span><span class="cx"> div#message-thread div.message-options {
</span><span class="cx">         text-align: left;
</span><del>-}
</del><span class="cx">\ No newline at end of file
</span><ins>+}
+div.message-search {
+        float: left;
+}
</ins></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssdefaultcss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/default.css (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/default.css        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-themes/bp-default/_inc/css/default.css        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -2360,6 +2360,11 @@
</span><span class="cx">         text-align: right;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+div.message-search {
+        float: right;
+        margin: 0 20px;
+}
+
</ins><span class="cx"> /*--------------------------------------------------------------
</span><span class="cx"> 6.9 - Extended Profiles
</span><span class="cx"> --------------------------------------------------------------*/
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-themes/bp-default/_inc/global.js        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -981,6 +981,23 @@
</span><span class="cx"> 
</span><span class="cx">         /** Private Messaging ******************************************/
</span><span class="cx"> 
</span><ins>+        /** Message search*/
+        jq('.message-search').click( function(event) {
+                if ( jq(this).hasClass('no-ajax') )
+                        return;
+
+                var target = jq(event.target);
+
+                if ( target.attr('type') == 'submit' ) {
+                        //var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
+                        var object = 'messages';
+
+                        bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') );
+
+                        return false;
+                }
+        });
+
</ins><span class="cx">         /* AJAX send reply functionality */
</span><span class="cx">         jq(&quot;input#send_reply_button&quot;).click(
</span><span class="cx">                 function() {
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultmemberssinglemessagesmessagesloopphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/members/single/messages/messages-loop.php (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/members/single/messages/messages-loop.php        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-themes/bp-default/members/single/messages/messages-loop.php        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> &lt;?php do_action( 'bp_before_member_messages_loop' ); ?&gt;
</span><span class="cx"> 
</span><del>-&lt;?php if ( bp_has_message_threads() ) : ?&gt;
</del><ins>+&lt;?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) : ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;pagination no-ajax&quot; id=&quot;user-pag&quot;&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -15,8 +15,9 @@
</span><span class="cx">         &lt;/div&gt;&lt;!-- .pagination --&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;?php do_action( 'bp_after_member_messages_pagination' ); ?&gt;
</span><del>-        &lt;?php do_action( 'bp_before_member_messages_threads' ); ?&gt;
</del><span class="cx"> 
</span><ins>+        &lt;?php do_action( 'bp_before_member_messages_threads'   ); ?&gt;
+
</ins><span class="cx">         &lt;table id=&quot;message-threads&quot; class=&quot;messages-notices&quot;&gt;
</span><span class="cx">                 &lt;?php while ( bp_message_threads() ) : bp_message_thread(); ?&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -70,4 +71,4 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php endif;?&gt;
</span><span class="cx"> 
</span><del>-&lt;?php do_action( 'bp_after_member_messages_loop' ); ?&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;?php do_action( 'bp_after_member_messages_loop' ); ?&gt;
</ins></span></pre></div>
<a id="trunkbpthemesbpdefaultmemberssinglemessagesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/members/single/messages.php (5821 => 5822)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/members/single/messages.php        2012-02-21 02:36:35 UTC (rev 5821)
+++ trunk/bp-themes/bp-default/members/single/messages.php        2012-02-21 20:50:41 UTC (rev 5822)
</span><span class="lines">@@ -15,6 +15,13 @@
</span><span class="cx">                 &lt;?php bp_get_options_nav(); ?&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;/ul&gt;
</span><ins>+        
+        &lt;?php if ( bp_is_messages_inbox() || bp_is_messages_sentbox() ) : ?&gt;
+
+                &lt;div class=&quot;message-search&quot;&gt;&lt;?php bp_message_search_form(); ?&gt;&lt;/div&gt;
+
+        &lt;?php endif; ?&gt;
+
</ins><span class="cx"> &lt;/div&gt;&lt;!-- .item-list-tabs --&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span></span></pre>
</div>
</div>

</body>
</html>