<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
		>
	<channel>
		<title>bbPress Plugin Browser &#187; User Favorites: yoyo</title>
		<link>http://bbpress.org/plugins/profile/</link>
		<description>bbPress Plugin Browser &#187; User Favorites: yoyo</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 03:21:10 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="http://bbpress.org/plugins/rss/profile/" rel="self" type="application/rss+xml" />

		<item>
			<title>holger_gamua on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/3/#post-6590</link>
			<pubDate>Thu, 29 Sep 2011 08:55:17 +0000</pubDate>
			<dc:creator>holger_gamua</dc:creator>
			<guid isPermaLink="false">6590@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Hello there,</p>
<p>I seem to have a problem with Post Notification being installed on multiple bbPress installations that use the same user table (from one WordPress site to enable single sign-on). According to WP/bbP this should work as expected, but now:</p>
<p>My forum users get notification e-mails for topics from the wrong bbPress installation.</p>
<p>I had a quick look at the PN code and I think the problem that's causing this behavior is that PN checks if the ID of an updated topic is in the user's favorite topics list. Unfortunately with two bbPress installations topicIDs are not unique any more and therefore the wrong users get notification e-mails.</p>
<p>Has anyone experienced this before? Is my assumption correct? Is there a way to fix this?</p>
<p>Thank you very much in advance!<br />
Holger</p>
<p>----</p>
<p>Edit: Everyone, I'm sorry. This was probably the wrong place to post my problem. I found out that bbPress stores its favorite topics in the "user meta" table of the associated wp database under the key "bb_favorites". Well, if several bbPress installs do this there are obviously going to be uniqueness problems.
</p>]]></description>
					</item>
		<item>
			<title>bfrantz on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/3/#post-6404</link>
			<pubDate>Tue, 08 Mar 2011 11:27:57 +0000</pubDate>
			<dc:creator>bfrantz</dc:creator>
			<guid isPermaLink="false">6404@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Hi Laust!</p>
<p>A big thanks for your modified notification code, it's exactly what I needed...
</p>]]></description>
					</item>
		<item>
			<title>DKB on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/3/#post-6215</link>
			<pubDate>Tue, 09 Nov 2010 01:19:32 +0000</pubDate>
			<dc:creator>DKB</dc:creator>
			<guid isPermaLink="false">6215@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Laust, that did the trick. Thank you very much!
</p>]]></description>
					</item>
		<item>
			<title>Laust on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/3/#post-6214</link>
			<pubDate>Tue, 09 Nov 2010 00:24:27 +0000</pubDate>
			<dc:creator>Laust</dc:creator>
			<guid isPermaLink="false">6214@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>I haven't used Auto Add Favorites, but assuming the problem is the same, changing the original function with this one should do the trick:<br />
(other functions not pasted here, just replace auto_add_favorit_profile with this one.)</p>
<p><code><br />
function auto_add_favorit_profile() {<br />
	global $user_id;</p>
<p>	if (bb_is_user_logged_in()) {<br />
		$checked = '';<br />
		$unchecked = ' checked="checked"';<br />
		$user = bb_get_user($user_id);<br />
		if (!empty($user-&#62;auto_add_favorit)) {<br />
			$checked = ' checked="checked"';<br />
		  $unchecked = '';<br />
		}<br />
		echo '<br />
			&#60;fieldset&#62;<br />
				&#60;legend&#62;Add my threads automatically to my favorites&#60;/legend&#62;<br />
				&#60;p&#62;Check this option to add all your threads or threads where you have posted something to your favorite list.&#60;/p&#62;<br />
				&#60;table width="100%"&#62;<br />
					&#60;tr&#62;<br />
						&#60;th width="21%" scope="row"&#62;Activate:&#60;/th&#62;<br />
						&#60;td width="79%"&#62;<br />
							&#60;input name="edit_auto_add_favorit" id="edit_auto_add_favorit" type="radio" value="1"'.$checked.' /&#62;<br />
						&#60;/td&#62;<br />
					&#60;/tr&#62;<br />
					&#60;tr&#62;<br />
						&#60;th width="21%" scope="row"&#62;Deactivate:&#60;/th&#62;<br />
						&#60;td width="79%"&#62;<br />
							&#60;input name="edit_auto_add_favorit" id="edit_auto_add_favorit" type="radio" value="0"'.$unchecked.' /&#62;<br />
						&#60;/td&#62;<br />
					&#60;/tr&#62;<br />
				&#60;/table&#62;<br />
			&#60;/fieldset&#62;';<br />
	}<br />
}</code>
</p>]]></description>
					</item>
		<item>
			<title>DKB on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/3/#post-6213</link>
			<pubDate>Mon, 08 Nov 2010 21:22:11 +0000</pubDate>
			<dc:creator>DKB</dc:creator>
			<guid isPermaLink="false">6213@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Thanks! worked great. The Auto Add Favorites has the same problem. The option cant unchecked.</p>
<p><a href="http://bbpress.org/plugins/topic/auto-add-favorites/" rel="nofollow">http://bbpress.org/plugins/topic/auto-add-favorites/</a></p>
<p>Can you look please at that. Thanks in advance.
</p>]]></description>
					</item>
		<item>
			<title>Laust on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-6212</link>
			<pubDate>Mon, 08 Nov 2010 18:59:46 +0000</pubDate>
			<dc:creator>Laust</dc:creator>
			<guid isPermaLink="false">6212@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>For some reason the uncheck didn't register in the database when I used a checkbox. I've made a version that uses radio-buttons instead.</p>
<p>(I can't edit my old post, so sorry for the inconvenience with the extra code...)</p>
<p><code>&#60;?php<br />
/**<br />
 * Plugin Name: Post Notification<br />
 * Plugin Description: Sends a Notification email if there's a new post to a favorite topic.<br />
 (Modified Version 1.4 with Post Content included in E-Mail)<br />
 (And modified to send mail in utf8 format so danish, swedish, russian etc. characters display correctly).<br />
 Also modified so user can select whether to get a mail on favorite topics or all topics.<br />
 Changed subject of email to show which topic is updated - and from: is now set to the username of the poster instead of the forum name.<br />
 * Author: Thomas Klaiber<br />
 * Author URI: <a href="http://thomasklaiber.com/" rel="nofollow">http://thomasklaiber.com/</a><br />
 * Plugin URI: <a href="http://thomasklaiber.com/bbpress/post-notification/" rel="nofollow">http://thomasklaiber.com/bbpress/post-notification/</a><br />
 * Version: 1.4.x<br />
 */</p>
<p>function notification_new_post($post_id=0) {<br />
  global $bbdb, $bb_table_prefix, $topic_id, $bb_current_user;</p>
<p>  $all_users = notification_select_all_users();<br />
  foreach ($all_users as $userdata) :<br />
    if ( notification_is_activated( $userdata-&#62;ID ) &#38;&#38; $userdata-&#62;ID != $bb_current_user-&#62;ID) :<br />
      if (notification_all_is_activated( $userdata-&#62;ID ) &#124;&#124; is_user_favorite( $userdata-&#62;ID, $topic_id ) ) :<br />
        $message = __("There is a new post on:\n %1\$s \n\nReply by:\n %2\$s \n\nText:\n %3\$s \n\n%4\$s ");<br />
          mail_utf8( $userdata-&#62;user_email, bb_get_option('name') . ': ' . get_topic_title($topic_id), sprintf( $message, get_topic_title($topic_id), get_user_name($bb_current_user-&#62;ID), strip_tags(get_post_text($post_id)), get_topic_link($topic_id) ), 'From: '.get_user_name($bb_current_user-&#62;ID).' &#60;'.bb_get_option('from_email').'&#62;'<br />
          );<br />
      endif;<br />
    endif;<br />
  endforeach;<br />
}<br />
add_action('bb_new_post', 'notification_new_post');</p>
<p>function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {<br />
  $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";<br />
  mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header);<br />
} </p>
<p>function notification_select_all_users() {<br />
  global $bbdb;</p>
<p>  $all_users = $bbdb-&#62;get_results("SELECT ID, user_email FROM $bbdb-&#62;users WHERE user_status=0");</p>
<p>  return $all_users;<br />
}</p>
<p>function notification_profile() {<br />
  global $user_id, $bb_current_user;</p>
<p>  if ( bb_is_user_logged_in() ) :</p>
<p>    $checked_on = "checked='checked'";<br />
    $checked_off = "";<br />
    if (!notification_is_activated($user_id)) :<br />
      $checked_on = "";<br />
      $checked_off = "checked='checked'";<br />
    endif;</p>
<p>    $checked_all_on = "";<br />
    $checked_all_off = "checked='checked'";<br />
    if (notification_all_is_activated($user_id)) :<br />
      $checked_all_on = "checked='checked'";<br />
      $checked_all_off = "";<br />
    endif;</p>
<p>    echo "&#60;fieldset&#62;<br />
&#60;legend&#62;Favorite Notification&#60;/legend&#62;<br />
&#60;p&#62; " . __('Email me when there'."'".'s a new post in a topic.') . "&#60;/p&#62;<br />
&#60;table width=\"100%\"&#62;<br />
&#60;tr&#62;<br />
&#60;th width=\"21%\" scope=\"row\"&#62;" . __("Activate") . ":&#60;/th&#62;<br />
&#60;td width=\"79%\" &#62;&#60;input name=\"favorite_notification\" id=\"favorite_notification\" type=\"radio\" value=\"1\"" . $checked_on . " /&#62;&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;th width=\"21%\" scope=\"row\"&#62;" . __("Deactivate") . ":&#60;/th&#62;<br />
&#60;td width=\"79%\" &#62;&#60;input name=\"favorite_notification\" id=\"favorite_notification\" type=\"radio\" value=\"0\"" . $checked_off . " /&#62;&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;/table&#62;<br />
&#60;p&#62; " . __('When should the system send an email?') . "&#60;/p&#62;<br />
&#60;table width=\"100%\"&#62;<br />
&#60;tr&#62;<br />
&#60;th width=\"21%\" scope=\"row\"&#62;" . __("Only favorites") . ":&#60;/th&#62;<br />
&#60;td width=\"79%\" &#62;<br />
&#60;input name=\"favorite_notification_all\" id=\"favorite_notification_all\" type=\"radio\" value=\"0\"" . $checked_all_off . " /&#62;&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;th width=\"21%\" scope=\"row\"&#62;" . __("All topics") . ":&#60;/th&#62;<br />
&#60;td width=\"79%\" &#62;<br />
&#60;input name=\"favorite_notification_all\" id=\"favorite_notification_all\" type=\"radio\" value=\"1\"" . $checked_all_on . " /&#62;&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;/table&#62;<br />
&#60;/fieldset&#62;\n\n";<br />
  endif;<br />
}<br />
add_action('extra_profile_info', 'notification_profile');</p>
<p>function notification_profile_edit() {<br />
  global $user_id;<br />
  bb_update_usermeta($user_id, "favorite_notification", $_POST['favorite_notification']);<br />
  bb_update_usermeta($user_id, "favorite_notification_all", $_POST['favorite_notification_all']);<br />
}<br />
add_action('profile_edited', 'notification_profile_edit');</p>
<p>function notification_is_activated($user_id) {<br />
  $user = bb_get_user( $user_id );<br />
  if ($user-&#62;favorite_notification) : return true; else : return false; endif;<br />
}</p>
<p>function notification_all_is_activated($user_id) {<br />
  $user = bb_get_user( $user_id );<br />
  if ($user-&#62;favorite_notification_all) : return true; else : return false; endif;<br />
}<br />
?&#62;</code>
</p>]]></description>
					</item>
		<item>
			<title>DKB on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-6211</link>
			<pubDate>Mon, 08 Nov 2010 17:38:00 +0000</pubDate>
			<dc:creator>DKB</dc:creator>
			<guid isPermaLink="false">6211@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>I have problem with this plugin and the auto add favorites plugin:</p>
<p>If i uncheck the boxes and save then it again shows as checked.</p>
<p>Any clue?
</p>]]></description>
					</item>
		<item>
			<title>Laust on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-6210</link>
			<pubDate>Mon, 08 Nov 2010 17:24:05 +0000</pubDate>
			<dc:creator>Laust</dc:creator>
			<guid isPermaLink="false">6210@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>I have also made some changes to this plugin. I contacted Thomas Klaiber who said that he liked my additions, but that he no longer supported the plugin and said I should just post my version here.</p>
<p>These are the modifications I've made:</p>
<p>- Send mail in UTF-8 format so Danish, Swedish, Russian etc. characters display correctly.<br />
- User can select whether to get a mail on favorite topics or all topics.<br />
- Changed subject of mail to show which topic is updated (forum-name:topic). Also 'from:' is now set to the username of the poster instead of the forum name, which makes your inbox so much more tidy.</p>
<pre><code>&#60;?php
/**
 * Plugin Name: Post Notification
 * Plugin Description: Sends a Notification email if there&#039;s a new post to a favorite topic.&#60;br&#62;(Modified Version 1.4 with Post Content included in E-Mail)&#60;br&#62;(And modified to send mail in utf8 format so danish, swedish, russian etc. characters display correctly).&#60;br&#62;Also modified so user can select whether to get a mail on favorite topics or all topics.&#60;br&#62;Changed subject of email to show which topic is updated - and from: is now set to the username of the poster instead of the forum name.
 * Author: Thomas Klaiber
 * Author URI: <a href="http://thomasklaiber.com/" rel="nofollow">http://thomasklaiber.com/</a>
 * Plugin URI: <a href="http://thomasklaiber.com/bbpress/post-notification/" rel="nofollow">http://thomasklaiber.com/bbpress/post-notification/</a>
 * Version: 1.4.x
 */

function notification_new_post($post_id=0) {
  global $bbdb, $bb_table_prefix, $topic_id, $bb_current_user;

  $all_users = notification_select_all_users();
  foreach ($all_users as $userdata) :
    if ( notification_is_activated( $userdata-&#62;ID ) &#38;&#38; $userdata-&#62;ID != $bb_current_user-&#62;ID) :
      if (notification_all_is_activated( $userdata-&#62;ID ) &#124;&#124; is_user_favorite( $userdata-&#62;ID, $topic_id ) ) :
        $message = __(&#34;There is a new post on:\n %1\$s \n\nReply by:\n %2\$s \n\nText:\n %3\$s \n\n%4\$s &#34;);
          mail_utf8( $userdata-&#62;user_email, bb_get_option(&#039;name&#039;) . &#039;: &#039; . get_topic_title($topic_id), sprintf( $message, get_topic_title($topic_id), get_user_name($bb_current_user-&#62;ID), strip_tags(get_post_text($post_id)), get_topic_link($topic_id) ), &#039;From: &#039;.get_user_name($bb_current_user-&#62;ID).&#039; &#60;&#039;.bb_get_option(&#039;from_email&#039;).&#039;&#62;&#039;
          );
      endif;
    endif;
  endforeach;
}
add_action(&#039;bb_new_post&#039;, &#039;notification_new_post&#039;);

function mail_utf8($to, $subject = &#039;(No subject)&#039;, $message = &#039;&#039;, $header = &#039;&#039;) {
  $header_ = &#039;MIME-Version: 1.0&#039; . &#34;\r\n&#34; . &#039;Content-type: text/plain; charset=UTF-8&#039; . &#34;\r\n&#34;;
  mail($to, &#039;=?UTF-8?B?&#039;.base64_encode($subject).&#039;?=&#039;, $message, $header_ . $header);
} 

function notification_select_all_users() {
  global $bbdb;

  $all_users = $bbdb-&#62;get_results(&#34;SELECT ID, user_email FROM $bbdb-&#62;users WHERE user_status=0&#34;);

  return $all_users;
}

function notification_profile() {
  global $user_id, $bb_current_user;

  if ( bb_is_user_logged_in() ) :

    $checked = &#34;&#34;;
    if (notification_is_activated($user_id)) :
      $checked = &#34;checked=&#039;checked&#039;&#34;;
    endif;

    $checked_all_on = &#34;&#34;;
    $checked_all_off = &#34;checked=&#039;checked&#039;&#34;;
    if (notification_all_is_activated($user_id)) :
      $checked_all_on = &#34;checked=&#039;checked&#039;&#34;;
      $checked_all_off = &#34;&#34;;
    endif;

    echo &#34;&#60;fieldset&#62;
&#60;legend&#62;Favorite Notification&#60;/legend&#62;
&#60;p&#62; &#34; . __(&#039;Email me when there&#039;.&#34;&#039;&#34;.&#039;s a new post in a topic.&#039;) . &#34;&#60;/p&#62;
&#60;table width=\&#34;100%\&#34;&#62;
&#60;tr&#62;
&#60;th width=\&#34;21%\&#34; scope=\&#34;row\&#34;&#62;&#34; . __(&#34;Activate Notification&#34;) . &#34;:&#60;/th&#62;
&#60;td width=\&#34;79%\&#34; &#62;&#60;input name=\&#34;favorite_notification\&#34; id=\&#34;favorite_notification\&#34; type=\&#34;checkbox\&#34; value=\&#34;1\&#34;&#34; . $checked . &#34; /&#62;&#60;/td&#62;
&#60;/tr&#62;
&#60;/table&#62;
&#60;p&#62; &#34; . __(&#039;When should the system send an email?&#039;) . &#34;&#60;/p&#62;
&#60;table width=\&#34;100%\&#34;&#62;
&#60;tr&#62;
&#60;th width=\&#34;21%\&#34; scope=\&#34;row\&#34;&#62;&#34; . __(&#34;Only favorites&#34;) . &#34;:&#60;/th&#62;
&#60;td width=\&#34;79%\&#34; &#62;
&#60;input name=\&#34;favorite_notification_all\&#34; id=\&#34;favorite_notification_all\&#34; type=\&#34;radio\&#34; value=\&#34;0\&#34;&#34; . $checked_all_off . &#34; /&#62;&#60;/td&#62;
&#60;/tr&#62;
&#60;tr&#62;
&#60;th width=\&#34;21%\&#34; scope=\&#34;row\&#34;&#62;&#34; . __(&#34;All topics&#34;) . &#34;:&#60;/th&#62;
&#60;td width=\&#34;79%\&#34; &#62;
&#60;input name=\&#34;favorite_notification_all\&#34; id=\&#34;favorite_notification_all\&#34; type=\&#34;radio\&#34; value=\&#34;1\&#34;&#34; . $checked_all_on . &#34; /&#62;&#60;/td&#62;
&#60;/tr&#62;
&#60;/table&#62;
&#60;/fieldset&#62;\n\n&#34;;
  endif;
}
add_action(&#039;extra_profile_info&#039;, &#039;notification_profile&#039;);

function notification_profile_edit() {
  global $user_id;

  bb_update_usermeta($user_id, &#34;favorite_notification&#34;, $_POST[&#039;favorite_notification&#039;]);
  bb_update_usermeta($user_id, &#34;favorite_notification_all&#34;, $_POST[&#039;favorite_notification_all&#039;]);
}
add_action(&#039;profile_edited&#039;, &#039;notification_profile_edit&#039;);

function notification_is_activated($user_id) {
  $user = bb_get_user( $user_id );
  if ($user-&#62;favorite_notification) :
    return true;
  else :
    return false;
  endif;
}

function notification_all_is_activated($user_id) {
  $user = bb_get_user( $user_id );
  if ($user-&#62;favorite_notification_all) :
    return true;
  else :
    return false;
  endif;
}
?&#62;</code></pre>]]></description>
					</item>
		<item>
			<title>copperblade on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5635</link>
			<pubDate>Fri, 02 Apr 2010 20:59:38 +0000</pubDate>
			<dc:creator>copperblade</dc:creator>
			<guid isPermaLink="false">5635@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>This version says 1.4.  I guess this is more up to date than the plugin website?</p>
<p>EDIT:  other comments were about the wrong plugin
</p>]]></description>
					</item>
		<item>
			<title>topspeed on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5621</link>
			<pubDate>Tue, 30 Mar 2010 21:22:25 +0000</pubDate>
			<dc:creator>topspeed</dc:creator>
			<guid isPermaLink="false">5621@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Hmm I can't help you! I tried it with the newest version of bbpress and it works without any problems ...</p>
<p>Have you installed any other plugins? </p>
<p><a href="http://methoo.com" rel="nofollow">http://methoo.com</a>
</p>]]></description>
					</item>
		<item>
			<title>bbn on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5601</link>
			<pubDate>Wed, 24 Mar 2010 23:10:24 +0000</pubDate>
			<dc:creator>bbn</dc:creator>
			<guid isPermaLink="false">5601@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Hi,</p>
<p>We re-architected part of this plugin. The bbpress forum for Cycling '74 (<a href="http://cycling74.com/forums" rel="nofollow">http://cycling74.com/forums</a>) has more than 15,000 users. After a new post this plugin was loading every single user record, then iterating through them to check the metadata for each user and see if the user had flagged the topic as a favorite.  Tens of thousands of database queries.</p>
<p>Instead of using the stored list of favorite topic_ids in the user meta-dataspace, we solved the problem by adding functions that manage the storing of user_ids in the topic meta-space.  So the number of database queries is 1.  Below is the code. Feel free to incorporate it into the next version of the plugin.</p>
<p><code><br />
function add_user_to_topic_favorites( $user_id, $topic_id ) {<br />
	$user_id = (int) $user_id;<br />
	$topic_id = (int) $topic_id;</p>
<p>  $topic = get_topic( $topic_id );<br />
	if ( !$topic )<br />
		return false;</p>
<p>	$fav =  $topic-&#62;user_id_favorites ? explode(',',  $topic-&#62;user_id_favorites) : array();<br />
	if ( ! in_array( $user_id, $fav ) ) {<br />
		$fav[] = $user_id;<br />
		$fav = implode(',', $fav);<br />
		bb_update_topicmeta( $topic_id, 'user_id_favorites', $fav);<br />
	}<br />
}<br />
add_action('bb_add_user_favorite', 'add_user_to_topic_favorites',10,2);</p>
<p>function remove_user_from_topic_favorites( $user_id, $topic_id ) {<br />
	$user_id = (int) $user_id;<br />
	$topic_id = (int) $topic_id;<br />
	$topic = get_topic( $topic_id );<br />
	if ( !$topic )<br />
		return false;<br />
  if ( !$topic-&#62;user_id_favorites )<br />
    return false;</p>
<p>	$fav = explode(',', $topic-&#62;user_id_favorites);<br />
	if ( is_int( $pos = array_search($user_id, $fav) ) ) {<br />
		array_splice($fav, $pos, 1);<br />
		$fav = implode(',', $fav);<br />
		bb_update_topicmeta( $topic_id, 'user_id_favorites', $fav);<br />
	}</p>
<p>}<br />
add_action('bb_remove_user_favorite', 'remove_user_from_topic_favorites',10,2);</p>
<p>function notification_new_post($post_id=0) {<br />
	global $bbdb, $bb_table_prefix, $topic_id, $bb_current_user;</p>
<p>	$topic = get_topic( $topic_id );<br />
	if ( !$topic )<br />
	  return false;<br />
	if ( !$topic-&#62;user_id_favorites )<br />
	  return false;<br />
	$users = $bbdb-&#62;get_results("SELECT ID, user_email FROM $bbdb-&#62;users WHERE id IN (".$topic-&#62;user_id_favorites.")");</p>
<p>	foreach ($users as $userdata) :<br />
		$message = __("There is a new post on: %1\$s \nReply by: %2\$s \nText: %3\$s \n\n%4\$s ");<br />
			mail( $userdata-&#62;user_email, bb_get_option('name') . ': ' . __('Notification'),<br />
				sprintf( $message, get_topic_title($topic_id), get_user_name($bb_current_user-&#62;ID), strip_tags(get_post_text($post_id)), get_topic_link($topic_id) ),<br />
				'From: '.bb_get_option('name').' &#60;'.bb_get_option('from_email').'&#62;'<br />
			);<br />
	endforeach; </p>
<p>}<br />
add_action('bb_new_post', 'notification_new_post');<br />
</code>
</p>]]></description>
					</item>
		<item>
			<title>chengdu living on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5577</link>
			<pubDate>Sun, 21 Mar 2010 17:25:22 +0000</pubDate>
			<dc:creator>chengdu living</dc:creator>
			<guid isPermaLink="false">5577@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Is there any way to automatically subscribe users to any thread they post in, and notify them by e-mail of updates to that thread? I haven't found a plugin like that, but that's what I really need!
</p>]]></description>
					</item>
		<item>
			<title>Etchbee on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5177</link>
			<pubDate>Thu, 07 Jan 2010 20:24:33 +0000</pubDate>
			<dc:creator>Etchbee</dc:creator>
			<guid isPermaLink="false">5177@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Hi,</p>
<p>I just commented following line 17, it worked for me. So all users who activate favorite post will receive email notification whenever new post/topic/forum created. </p>
<p>//if ( is_user_favorite( $userdata-&#62;ID, $topic_id ) ) :</p>
<p>Thanks me and Thomas. Ha ha.</p>
<p>Etchbee
</p>]]></description>
					</item>
		<item>
			<title>Etchbee on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5176</link>
			<pubDate>Thu, 07 Jan 2010 17:31:39 +0000</pubDate>
			<dc:creator>Etchbee</dc:creator>
			<guid isPermaLink="false">5176@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Hi,<br />
Is it possible to send notification of any post, topic or forum created in the forum? I need only one global level 'tick', so the user receive email notification of forum activities.<br />
Thanks.<br />
Etchbee
</p>]]></description>
					</item>
		<item>
			<title>Skip Savage on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5045</link>
			<pubDate>Fri, 11 Dec 2009 16:27:07 +0000</pubDate>
			<dc:creator>Skip Savage</dc:creator>
			<guid isPermaLink="false">5045@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>I found the checkbox. My mistake thinking it would be on the Favorites pages. Found it on the Edit Profile form. Perhaps others will learn from my false assumption.
</p>]]></description>
					</item>
		<item>
			<title>Skip Savage on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-5041</link>
			<pubDate>Fri, 11 Dec 2009 04:04:49 +0000</pubDate>
			<dc:creator>Skip Savage</dc:creator>
			<guid isPermaLink="false">5041@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>For some unknown reason I cannot get anything to appear on my Favorites page. I activate. Refresh. Try stock theme. Revert to custom theme. Choose favorite topics. Uncheck favorite topics. Deactivate. Reactivate.</p>
<p>I would like this to work for me. Seems essential.
</p>]]></description>
					</item>
		<item>
			<title>Lemonade Joe on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-3764</link>
			<pubDate>Thu, 25 Jun 2009 15:13:40 +0000</pubDate>
			<dc:creator>Lemonade Joe</dc:creator>
			<guid isPermaLink="false">3764@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Hi, I am trying to use this plugin on a site running in Slovak language, that means, I need to use special characters.  I am not good with php, so forgive me, if am not technical enough :)</p>
<p>The system e-mails (like registration) are working fine. However, when sending mail through Post Notification, the special characters are messed up. </p>
<p>When I was checking the source code of the mails, I have discovered, that the registration mails  contain the line "Content-Transfer-Encoding: 8bit   Content-Type: text/plain; charset="UTF-8"".<br />
The Post Notification mails (also the Report Post plugin mails) do not contain any charset specification (the source code contains this: X-Amavis-Alert: BAD HEADER SECTION, Non-encoded 8-bit data (char C3 hex).<br />
Can that be the source of my problem, if yes, how can I solve it?
</p>]]></description>
					</item>
		<item>
			<title>danbbpress on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-2141</link>
			<pubDate>Thu, 30 Oct 2008 09:14:51 +0000</pubDate>
			<dc:creator>danbbpress</dc:creator>
			<guid isPermaLink="false">2141@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Even if you manage to make all posts favorites for their posters, they still need to check the Notification radio button to get notifications. And this radio button is difficult to locate in my opinion.  I think this notification button should be turned on by default because most people expect to get notified when a new reply was added to a thread they initiated/participated in.
</p>]]></description>
					</item>
		<item>
			<title>beernews on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-2088</link>
			<pubDate>Wed, 22 Oct 2008 00:14:04 +0000</pubDate>
			<dc:creator>beernews</dc:creator>
			<guid isPermaLink="false">2088@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>Works perfectly. Only mod I could think of is to have it go to the permalink generating the email instead of the post (and thats preference more than anything) but A+!
</p>]]></description>
					</item>
		<item>
			<title>jennygold on "Post Notification"</title>
			<link>http://bbpress.org/plugins/topic/post-notification/page/2/#post-2045</link>
			<pubDate>Wed, 08 Oct 2008 03:27:39 +0000</pubDate>
			<dc:creator>jennygold</dc:creator>
			<guid isPermaLink="false">2045@http://bbpress.org/plugins/</guid>
			<description><![CDATA[<p>I've adapted this plugin to work when a new topic is submitted by using add_action('bb_new_topic', 'notification_new_topic') instead of bb_new_post with a function I've named notification_new_topic.  The problem is I tried to use the existing variables to get the title, link and author passed into the email, but they don't seem to be available when I use bb_new_topic.  What variables are available and how would I get these fields to be automatically filled in on the email?  </p>
<p>Thanks!
</p>]]></description>
					</item>

	</channel>
</rss>

