<!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() && ( 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 ) && ( 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 && $page )
</span><span class="cx">                         $pag_sql = $wpdb->prepare( " LIMIT %d, %d", 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->prepare( " AND r.unread_count = 0 " );
</span><span class="cx">
</span><ins>+                if ( !empty( $search_terms ) ) {
+                        $search_terms = like_escape( $wpdb->escape( $search_terms ) );
+                        $search_sql = "AND ( subject LIKE '%%$search_terms%%' OR message LIKE '%%$search_terms%%' )";
+                }
+
</ins><span class="cx">                 if ( 'sentbox' == $box ) {
</span><del>-                        $thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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}", $user_id ) );
-                        $total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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 ", $user_id ) );
</del><ins>+                        $thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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}", $user_id ) );
+                        $total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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} ", $user_id ) );
</ins><span class="cx">                 } else {
</span><del>-                        $thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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}", $user_id ) );
-                        $total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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}", $user_id ) );
</del><ins>+                        $thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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}", $user_id ) );
+                        $total_threads = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( DISTINCT m.thread_id ) FROM {$bp->messages->table_name_recipients} r, {$bp->messages->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} ", $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->__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->pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1;
</span><del>-                $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
</del><ins>+                $this->pag_num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
</ins><span class="cx">
</span><del>-                $this->user_id = $user_id;
-                $this->box = $box;
-                $this->type = $type;
-
</del><ins>+                $this->user_id = $user_id;
+                $this->box = $box;
+                $this->type = $type;
+                $this->search_terms = $search_terms;
+                
</ins><span class="cx">                 if ( 'notices' == $this->box ) {
</span><span class="cx">                         $this->threads = BP_Messages_Notice::get_notices();
</span><span class="cx">                 } else {
</span><del>-                        $threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page );
</del><ins>+                        $threads = BP_Messages_Thread::get_current_threads_for_user( $this->user_id, $this->box, $this->type, $this->pag_num, $this->pag_page, $this->search_terms );
</ins><span class="cx">
</span><span class="cx">                         $this->threads = $threads['threads'];
</span><span class="cx">                         $this->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' => bp_loggedin_user_id(),
-                'box' => 'inbox',
-                'per_page' => 10,
-                'max' => false,
-                'type' => 'all'
</del><ins>+                'user_id' => bp_loggedin_user_id(),
+                'box' => 'inbox',
+                'per_page' => 10,
+                'max' => false,
+                'type' => 'all',
+                'search_terms' => 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->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; ?>
+
+        <form action="" method="get" id="search-message-form">
+                <label><input type="text" name="s" id="messages_search" <?php if ( $search_value === $default_search_value ) : ?>placeholder="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> <?php if ( $search_value !== $default_search_value ) : ?>value="<?php echo esc_html( $search_value ); ?>"<?php endif; ?> /></label>
+                <input type="submit" id="messages_search_submit" name="messages_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
+        </form>
+
+<?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( "$object/$object-loop.php" ), 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>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</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("input#send_reply_button").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"> <?php do_action( 'bp_before_member_messages_loop' ); ?>
</span><span class="cx">
</span><del>-<?php if ( bp_has_message_threads() ) : ?>
</del><ins>+<?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) : ?>
</ins><span class="cx">
</span><span class="cx">         <div class="pagination no-ajax" id="user-pag">
</span><span class="cx">
</span><span class="lines">@@ -15,8 +15,9 @@
</span><span class="cx">         </div><!-- .pagination -->
</span><span class="cx">
</span><span class="cx">         <?php do_action( 'bp_after_member_messages_pagination' ); ?>
</span><del>-        <?php do_action( 'bp_before_member_messages_threads' ); ?>
</del><span class="cx">
</span><ins>+        <?php do_action( 'bp_before_member_messages_threads' ); ?>
+
</ins><span class="cx">         <table id="message-threads" class="messages-notices">
</span><span class="cx">                 <?php while ( bp_message_threads() ) : bp_message_thread(); ?>
</span><span class="cx">
</span><span class="lines">@@ -70,4 +71,4 @@
</span><span class="cx">
</span><span class="cx"> <?php endif;?>
</span><span class="cx">
</span><del>-<?php do_action( 'bp_after_member_messages_loop' ); ?>
</del><span class="cx">\ No newline at end of file
</span><ins>+<?php do_action( 'bp_after_member_messages_loop' ); ?>
</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">                 <?php bp_get_options_nav(); ?>
</span><span class="cx">
</span><span class="cx">         </ul>
</span><ins>+        
+        <?php if ( bp_is_messages_inbox() || bp_is_messages_sentbox() ) : ?>
+
+                <div class="message-search"><?php bp_message_search_form(); ?></div>
+
+        <?php endif; ?>
+
</ins><span class="cx"> </div><!-- .item-list-tabs -->
</span><span class="cx">
</span><span class="cx"> <?php
</span></span></pre>
</div>
</div>
</body>
</html>