<?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.0.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		<title lang="en">Prime Quote Remover</title>
		<description lang="en">Automatically removes any quote blocks that exceed the specified quote depth so the poster isn't presented with an error message and forced to do it manually.</description>
	    <author-notes lang="en">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 $2.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#quote_remover]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.0</mod-version>
		<installation>
			<level>easy</level>
			<time>120</time>
			<target-version>3.0.2</target-version>
		</installation>
		<history>
			<entry>
				<date>2008-01-14</date>
				<rev-version>0.0.0</rev-version>
				<changelog lang="en">
					<change>Initial release.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-07-03</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>Recoded to reduce the number of installation steps from 4 to 2.</change>
					<change>Repackaged for MODX 1.2.0.</change>
				</changelog>
			</entry>
		</history>
	</header>
	<action-group>
		<open src="includes/message_parser.php">
			<edit>
				<find><![CDATA[					/* Add space at the end of the closing tag if not happened before to allow following urls/smilies to be parsed correctly]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Quote Remover -----------------------------------------------//
					if (!empty($ignoring_quotes))
					{
						$ignoring_quotes -= 1;
						if (!$ignoring_quotes)
						{
							$out = substr($out, 0, $ignoring_quote_start - 1);
						}
					}
//-- end: Prime Quote Remover -----------------------------------------------//
]]></action>
			</edit>
			<edit>
				<find><![CDATA[					if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth'])]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Quote Remover -----------------------------------------------//
					{
						if (empty($ignoring_quotes))
						{
							$ignoring_quote_start = strlen($out);
							$ignoring_quotes = 0;
						}
						$ignoring_quotes += 1;
					}
					else if (false) // never execute the following block
//-- end: Prime Quote Remover -----------------------------------------------//
]]></action>
			</edit>
		</open>
	</action-group>
</mod>