<!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] [1952] trunk: &quot;Mark message as read&quot; fixes.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd>1952</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2009-09-25 21:07:19 +0000 (Fri, 25 Sep 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>&quot;Mark message as read&quot; fixes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoresignupphp">trunk/bp-core/bp-core-signup.php</a></li>
<li><a href="#trunkbpmessagesbpmessagestemplatetagsphp">trunk/bp-messages/bp-messages-templatetags.php</a></li>
<li><a href="#trunkbpmessagesphp">trunk/bp-messages.php</a></li>
<li><a href="#trunkbpthemesbpsnparentsearchphp">trunk/bp-themes/bp-sn-parent/search.php</a></li>
<li><a href="#trunkbpthemesdeprecatedbphomearchivesphp">trunk/bp-themes/deprecated/bphome/archives.php</a></li>
<li><a href="#trunkbpthemesdeprecatedbphomeindexphp">trunk/bp-themes/deprecated/bphome/index.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoresignupphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-signup.php (1951 => 1952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-signup.php        2009-09-25 20:58:02 UTC (rev 1951)
+++ trunk/bp-core/bp-core-signup.php        2009-09-25 21:07:19 UTC (rev 1952)
</span><span class="lines">@@ -217,4 +217,5 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbpmessagesbpmessagestemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages/bp-messages-templatetags.php (1951 => 1952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages/bp-messages-templatetags.php        2009-09-25 20:58:02 UTC (rev 1951)
+++ trunk/bp-messages/bp-messages-templatetags.php        2009-09-25 21:07:19 UTC (rev 1952)
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx"> }
</span><span class="cx">         function bp_get_message_thread_subject() {
</span><span class="cx">                 global $messages_template;
</span><del>-                return apply_filters( 'bp_message_thread_subject', stripslashes_deep( $messages_template-&gt;thread-&gt;last_message_subject ) );
</del><ins>+                return apply_filters( 'bp_get_message_thread_subject', stripslashes_deep( $messages_template-&gt;thread-&gt;last_message_subject ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx"> function bp_message_thread_excerpt() {
</span><span class="lines">@@ -732,7 +732,7 @@
</span><span class="cx">                                                 
</span><span class="cx">                                                 &lt;?php do_action( 'messages_custom_fields_output_before' ) ?&gt;
</span><span class="cx">                                                 
</span><del>-                                                &lt;?php echo apply_filters( 'bp_get_message_content', stripslashes($message-&gt;message) ); ?&gt;
</del><ins>+                                                &lt;?php echo apply_filters( 'bp_get_the_message_thread_content', stripslashes($message-&gt;message) ); ?&gt;
</ins><span class="cx">                                                 
</span><span class="cx">                                                 &lt;?php do_action( 'messages_custom_fields_output_after' ) ?&gt;
</span><span class="cx">                 
</span></span></pre></div>
<a id="trunkbpmessagesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages.php (1951 => 1952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages.php        2009-09-25 20:58:02 UTC (rev 1951)
+++ trunk/bp-messages.php        2009-09-25 21:07:19 UTC (rev 1952)
</span><span class="lines">@@ -301,6 +301,11 @@
</span><span class="cx">                 bp_core_redirect( $bp-&gt;displayed_user-&gt;domain . $bp-&gt;current_component . '/view/' . $thread_id . '/' );                
</span><span class="cx">         }
</span><span class="cx">         
</span><ins>+        /* Mark message read */
+        messages_mark_thread_read( $thread_id );
+        
+        do_action( 'messages_action_view_message' );
+        
</ins><span class="cx">         bp_core_new_subnav_item( array( 'name' =&gt; sprintf( __( 'From: %s', 'buddypress'), BP_Messages_Thread::get_last_sender($thread_id) ), 'slug' =&gt; 'view', 'parent_url' =&gt; $bp-&gt;loggedin_user-&gt;domain . $bp-&gt;messages-&gt;slug . '/', 'parent_slug' =&gt; $bp-&gt;messages-&gt;slug, 'screen_function' =&gt; true, 'position' =&gt; 40, 'user_has_access' =&gt; bp_is_home() ) );
</span><span class="cx">         bp_core_load_template( apply_filters( 'messages_template_view_message', 'messages/view' ) );
</span><span class="cx"> }
</span><span class="lines">@@ -509,6 +514,14 @@
</span><span class="cx">         return BP_Messages_Thread::check_access( $thread_id, $user_id );
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+function messages_mark_thread_read( $thread_id ) {
+        return BP_Messages_Thread::mark_as_read( $thread_id );
+}
+
+function messages_mark_thread_unread( $thread_id ) {
+        return BP_Messages_Thread::mark_as_unread( $thread_id );        
+}
+
</ins><span class="cx"> function messages_add_callback_values( $recipients, $subject, $content ) {
</span><span class="cx">         setcookie( 'bp_messages_send_to', $recipients, time()+60*60*24, COOKIEPATH );
</span><span class="cx">         setcookie( 'bp_messages_subject', $subject, time()+60*60*24, COOKIEPATH );
</span></span></pre></div>
<a id="trunkbpthemesbpsnparentsearchphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-sn-parent/search.php (1951 => 1952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-sn-parent/search.php        2009-09-25 20:58:02 UTC (rev 1951)
+++ trunk/bp-themes/bp-sn-parent/search.php        2009-09-25 21:07:19 UTC (rev 1952)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">                         &lt;?php else : ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;h2 class=&quot;center&quot;&gt;&lt;?php _e( 'No posts found. Try a different search?', 'buddypress' ) ?&gt;&lt;/h2&gt;
</span><del>-                                &lt;?php include (TEMPLATEPATH . '/searchform.php'); ?&gt;
</del><ins>+                                &lt;?php locate_template( array( '/searchform.php'), true ) ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                         &lt;?php endif; ?&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkbpthemesdeprecatedbphomearchivesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/deprecated/bphome/archives.php (1951 => 1952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/deprecated/bphome/archives.php        2009-09-25 20:58:02 UTC (rev 1951)
+++ trunk/bp-themes/deprecated/bphome/archives.php        2009-09-25 21:07:19 UTC (rev 1952)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;content&quot; class=&quot;widecolumn&quot;&gt;
</span><span class="cx"> 
</span><del>-&lt;?php include (TEMPLATEPATH . '/searchform.php'); ?&gt;
</del><ins>+&lt;?php locate_template( array( '/searchform.php'), true ) ?&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;h2&gt;&lt;?php _e( 'Archives by Month:', 'buddypress' ) ?&gt;&lt;/h2&gt;
</span><span class="cx">         &lt;ul&gt;
</span></span></pre></div>
<a id="trunkbpthemesdeprecatedbphomeindexphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/deprecated/bphome/index.php (1951 => 1952)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/deprecated/bphome/index.php        2009-09-25 20:58:02 UTC (rev 1951)
+++ trunk/bp-themes/deprecated/bphome/index.php        2009-09-25 21:07:19 UTC (rev 1952)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx">                         &lt;h2 class=&quot;center&quot;&gt;&lt;?php _e( 'Not Found', 'buddypress' ) ?&gt;&lt;/h2&gt;
</span><span class="cx">                         &lt;p class=&quot;center&quot;&gt;&lt;?php _e( 'Sorry, but you are looking for something that isn\'t here.', 'buddypress' ) ?&gt;&lt;/p&gt;
</span><del>-                        &lt;?php include (TEMPLATEPATH . &quot;/searchform.php&quot;); ?&gt;
</del><ins>+                        &lt;?php include (TEMPLATEPATH . &quot;/searchform.php&quot;); ?&gt;         
</ins><span class="cx"> 
</span><span class="cx">                 &lt;?php endif; ?&gt;
</span><span class="cx">         &lt;/div&gt;
</span></span></pre>
</div>
</div>

</body>
</html>