<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="./contrib/xsl/modx.prosilver.en.xsl"?>
<!--
	NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.
-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD. Although MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD. No support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		<title lang="en">Prime Notify</title>
		<description lang="en">Inserts the content of a post or private messages into the notification e-mail.</description>
	    <author-notes lang="en">By default, the BBCode tags will be kept intact so the intended formatting can be seen, but this can be changed by opening "includes/prime_notify.php" and setting PRIME_NOTIFY_BBCODES to false (note that [quote] and [code] BBCodes will always be kept).  To send out notifications regardless of whether the user has visited the topic since a previous notification, set PRIME_NOTIFY_ALWAYS to true.

Creating, maintaining, and updating MODs requires a lot of time and effort, so if you like this MOD and have the desire to express your thanks through donations, that would be greatly appreciated. My Paypal ID is primehalo@gmail.com, or contact me for my mailing address. The suggested donation amount for this MOD is $5.00 (but any amount will help).</author-notes>
		<author-group>
			<author>
				<realname>Ken F. Innes IV</realname>
				<email>primehalo@gmail.com</email>
				<username>primehalo</username>
				<homepage><![CDATA[http://www.absoluteanime.com/admin/mods.htm#notify]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.10</mod-version>
		<installation>
			<level>easy</level>
			<time>180</time>
			<target-version>3.0.10</target-version>
		</installation>
		<history>
			<entry>
				<date>2008-07-27</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>Initial release</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-07-29</date>
				<rev-version>1.0.1</rev-version>
				<changelog lang="en">
					<change>Added the ability to individually enable or disable the MOD for post notifications and private messages notifications.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-08-02</date>
				<rev-version>1.0.2</rev-version>
				<changelog lang="en">
					<change>Change smiley image links to plain text smiley codes.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-08-16</date>
				<rev-version>1.0.3</rev-version>
				<changelog lang="en">
					<change>Change auto-linked HTML links to plain text links.</change>
					<change>Automatically remove the "No more messages will be sent..." line from the email templates if the option is set to send out notifications for each post.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-08-16</date>
				<rev-version>1.0.3a</rev-version>
				<changelog lang="en">
					<change>Added a Russian translation.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-08-16</date>
				<rev-version>1.0.4</rev-version>
				<changelog lang="en">
					<change>Attempted fix for the rare and elusive situation where the notification emails contains a blank author name and message body.</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-05-10</date>
				<rev-version>1.0.4a</rev-version>
				<changelog lang="en">
					<change>Added a German translation.</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-05-12</date>
				<rev-version>1.0.4b</rev-version>
				<changelog lang="en">
					<change>Added a French translation.</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-05-16</date>
				<rev-version>1.0.5</rev-version>
				<changelog lang="en">
					<change>Fixed a bug where posts that had to go through the approval process would send out the default notification emails.</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-10-15</date>
				<rev-version>1.0.6</rev-version>
				<changelog lang="en">
					<change>Fixed a bug that could display an error message when a post contained a list BBCode.</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-12-01</date>
				<rev-version>1.0.7</rev-version>
				<changelog lang="en">
					<change>Updated to work with phpBB 3.0.6.</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-02-06</date>
				<rev-version>1.0.7a</rev-version>
				<changelog lang="en">
					<change>Updated the German translation.</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-08-08</date>
				<rev-version>1.0.8</rev-version>
				<changelog lang="en">
					<change>Fixed: Posts that required approval were sending out the default emails instead of the new ones</change>
					<change>Fixed: Some URLs in between bbcodes would not get a space inserted between the end of the url and the bbcode</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-09-17</date>
				<rev-version>1.0.8a</rev-version>
				<changelog lang="en">
					<change>Added a Dutch translation.</change>
				</changelog>
			</entry>
			<entry>
				<date>2010-10-01</date>
				<rev-version>1.0.9</rev-version>
				<changelog lang="en">
					<change>Fixed a minor bug that would not properly clean up links in the message if the link had any extra attributes after the HREF attribute.</change>
				</changelog>
			</entry>
			<entry>
				<date>2012-01-31</date>
				<rev-version>1.0.10</rev-version>
				<changelog lang="en">
					<change>Updated for phpBB 3.0.10 (changed U_INBOX to U_VIEW_MESSAGE in prime_notify_privmsg.txt).</change>
				</changelog>
			</entry>
		</history>
		<link-group>
			<link type="contrib" href="contrib/install user choice.xml" lang="en">Install User's Choice</link>
			<link type="language" href="contrib/language - da.xml" realname="da" lang="en">Danish</link>
			<link type="language" href="contrib/language - fr.xml" realname="fr" lang="en">French</link>
			<link type="language" href="contrib/language - de.xml" realname="de" lang="en">German</link>
			<link type="language" href="contrib/language - pt.xml" realname="pt" lang="en">Portuguese</link>
			<link type="language" href="contrib/language - ru.xml" realname="ru" lang="en">Russian</link>
		</link-group>
	</header>
	<action-group>
		<copy>
			<file from="root/includes/prime_notify.php" to="includes/prime_notify.php" />
			<file from="root/language/en/email/prime_notify_forum.txt" to="language/en/email/prime_notify_forum.txt" />
			<file from="root/language/en/email/prime_notify_newtopic.txt" to="language/en/email/prime_notify_newtopic.txt" />
			<file from="root/language/en/email/prime_notify_topic.txt" to="language/en/email/prime_notify_topic.txt" />
			<file from="root/language/en/email/prime_notify_privmsg.txt" to="language/en/email/prime_notify_privmsg.txt" />
		</copy>

		<open src="includes/functions_posting.php">
			<edit>
				<find><![CDATA[			AND u.user_id = w.user_id';]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
	global $prime_notify;
	$prime_notify->alter_post_sql($sql);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[			'template'		=> ($topic_notification) ? 'topic_notify' : 'newtopic_notify',
			'method'		=> $row['user_notify_type'],
			'allowed'		=> false
		);]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
		$prime_notify->setup_post_template($notify_rows[$row['user_id']], $row);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[				AND u.user_id = fw.user_id';]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
		$prime_notify->alter_post_sql($sql);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[				'template'		=> 'forum_notify',
				'method'		=> $row['user_notify_type'],
				'allowed'		=> false
			);]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
			$prime_notify->setup_post_template($notify_rows[$row['user_id']], $row);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[				$messenger->send($addr['method']);]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
				$prime_notify->setup_post_vars($messenger, $addr['lang'], $email_template);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[		user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']);]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
		include ($phpbb_root_path . 'includes/prime_notify.' . $phpEx);
		$prime_notify->setup_post($data);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/functions_privmsgs.php">
			<edit>
				<find><![CDATA[		pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message'], $data['msg_id']);]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
		include ($phpbb_root_path . 'includes/prime_notify.' . $phpEx);
		$prime_notify->setup_pm($data);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[		$messenger->im($addr['jabber'], $addr['name']);]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
		global $prime_notify;
		$prime_notify->setup_pm_vars($messenger, $addr);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
		</open>

		<open src="includes/mcp/mcp_queue.php">
			<edit>
				<find><![CDATA[			if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Notify ------------------------------------------------------//
			include ($phpbb_root_path . 'includes/prime_notify.' . $phpEx);
			$prime_notify->setup_post($post_data);
//-- end: Prime Notify ------------------------------------------------------//]]></action>
			</edit>
		</open>
	</action-group>
</mod>
