<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tortoise IT &#187; bbPress</title>
	<atom:link href="http://www.sean-barton.co.uk/tag/bbpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sean-barton.co.uk</link>
	<description>Homepage of Sean Barton, a freelance website developer from Cheshire</description>
	<lastBuildDate>Sat, 19 Jun 2010 12:24:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>bbPress Email notification on post</title>
		<link>http://www.sean-barton.co.uk/2008/09/bbpress-email-notification-on-post/</link>
		<comments>http://www.sean-barton.co.uk/2008/09/bbpress-email-notification-on-post/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 12:14:38 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Time Savers]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[Email Notification]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Sprintf]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.sean-barton.co.uk/?p=56</guid>
		<description><![CDATA[At Newmedias, we use bbPress and have been using the email notification plugin written by thomasklaiber. It sends an email to those registered for forum notifications every time a post is left on a thread that they had registered for.
http://bbpress.org/plugins/topic/post-notification/
I often look at my emails when im away from home on my pda/phone and find [...]]]></description>
			<content:encoded><![CDATA[<p>At <a title="Newmedias, home of Your Members" href="http://www.newmedias.co.uk" target="_blank">Newmedias</a>, we use bbPress and have been using the email notification plugin written by thomasklaiber. It sends an email to those registered for forum notifications every time a post is left on a thread that they had registered for.</p>
<p><a href="http://bbpress.org/plugins/topic/post-notification/">http://bbpress.org/plugins/topic/post-notification/</a></p>
<p>I often look at my emails when im away from home on my pda/phone and find it a real pain to have to open the web link in each email to read it. This also means that I can&#8217;t download them in my email client for reading later.</p>
<p>My solution to this was blindingly simple,</p>
<p><em>Put the body of the most recent post into the email itself! </em></p>
<p>This feature was not available at the time of writing and works very well. The mod is very simple, here&#8217;s how i did it.</p>
<p><em>note: Before doing this to your version of the plugin, make sure that the original author hasn&#8217;t added his own version of the same thing!</em></p>
<p>1) Open notification.php and find the notification_new_post function<br />
2) Paste the following code after the get_topic() call but before the $message=&#8230; call</p>
<pre>$posts = get_thread($topic_id, 1, 1);
$posts = array_reverse($posts);
$last = array_pop($posts);
$last_text = strip_tags($last-&gt;post_text);</pre>
<p>3) Overwrite the $message variable to include the new string at the end as follows:</p>
<pre>$message = __("There is a new post on: %1\$s \nReply by: %2\$s \n\n%3\$s \n\n%4\$s");</pre>
<p>4) Overwrite the sprintf call to the following:</p>
<pre>sprintf($message, $topic-&gt;topic_title, get_user_name($bb_current_user-&gt;ID), get_topic_link($topic_id), $last_text)</pre>
<p><em>(if you are more familiar with php and sprintf then just add the $last_text variable to the end of the list of variables within the existing call)</em></p>
<p>5) Save, Backup, Upload and test! It should now send the post body with the email</p>
<p>Optionally you can improve the code within this function somewhat&#8230;</p>
<p>1) The get_topic call doesn&#8217;t need to be in the foreach loop because the topic_id doesn&#8217;t change anywhere in the function. Although bbPress uses cacheing, it would still be best practise to move that line and the lines from my step 2 to the line before the foreach loop.</p>
<p>2) Convert the email to HTML by adding the content-type header and setting it to text/html. If you do this then the \n&#8217;s will also need to be changed to &lt;br /&gt; and you can optionally remove the strip_tags() from the last line in my step 2</p>
<p>Good luck and let me know about any problems you may have.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sean-barton.co.uk/2008/09/bbpress-email-notification-on-post/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
