<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="./contrib/modx.prosilver.en.xsl"?>
<!-- 
	NOTICE: Please open this file in your web browser. If Internet Explorer presents a security bar, 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 Links</title>
		<description lang="en">Modifies links within posts so that local links are correctly classified as such. It can also apply a target to external links (e.g. to open in a new window) and prepend links (e.g. to apply an anonymizer).</description>
		<author-notes lang="en">If you want to disable the external link target, open "includes/prime_links.php" and change the value of EXTERNAL_LINK_TARGET to an empty string.

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#links]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.8</mod-version>
		<installation>
			<level>easy</level>
			<time>120</time>
			<target-version>3.0.1</target-version>
		</installation>
		<history>
			<entry>
				<date>2007-09-24</date>
				<rev-version>0.0.0</rev-version>
				<changelog lang="en">
					<change>Initial test release</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-09-24</date>
				<rev-version>0.0.1</rev-version>
				<changelog lang="en">
					<change>Fixed an error that would occur on some PHP configurations.</change>
					<change>Added an option to allow all subdomains to be considered internal.</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-09-25</date>
				<rev-version>0.0.2</rev-version>
				<changelog lang="en">
					<change>Fixed an issue that didn't handle multiple subdomains properly.</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-09-25</date>
				<rev-version>0.0.3</rev-version>
				<changelog lang="en">
					<change>Fixed a bug where numerical HTML entities in the URL were not being decoded.</change>
					<change>Fixed a bug where internal links without a protocol were being detected as external links.</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-09-26</date>
				<rev-version>0.0.4</rev-version>
				<changelog lang="en">
					<change>Added support for adding an anonymizer to external links.</change>
					<change>Added support for the REL attribute (link relationships, primarily used for "nofollow").</change>
					<change>Improved efficiency a bit.</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-09-28</date>
				<rev-version>0.0.5</rev-version>
				<changelog lang="en">
					<change>Append class names to links instead of overwriting them in order to protect classes applied via custom BBCodes.</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-10-22</date>
				<rev-version>0.0.5a</rev-version>
				<changelog lang="en">
					<change>Updated for compatibility with phpBB3.0.RC7.</change>
					<change>Fixed: In subsilver, appending class names would cause local links to have the same styling as external links.</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-12-10</date>
				<rev-version>1.0.0
				</rev-version>
				<changelog lang="en">
					<change>Changed the description slightly.</change>
					<change>Fixed a minor typo in the Do-It-Yourself instructions.</change>
				</changelog>
			</entry>
			<entry>
				<date>2007-12-12</date>
				<rev-version>1.0.1</rev-version>
				<changelog lang="en">
					<change>Fixed a bug that would cause links without an HREF attribute to become messed up.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-01-11</date>
				<rev-version>1.0.2</rev-version>
				<changelog lang="en">
					<change>Made the domain check (along with any un-removed subdomains) case-insensitive.</change>
					<change>Only modify links that use the http or https scheme.</change>
					<change>Allow for specific subdomains to be ignored.</change>
					<change>Fixed the algorithm so that multiple top-level domains, such as .co.jp and .ca.us, should now be handled correctly.</change>
					<change>Put functions inside of a class to prevent potential conflicts with other MODs.</change>
					<change>The target attribute can now be enabled by changing the value of a define rather than by un-commenting several lines of code.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-01-13</date>
				<rev-version>1.0.3</rev-version>
				<changelog lang="en">
					<change>Fixed a PHP 4 incompatibility.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-01-18</date>
				<rev-version>1.0.4</rev-version>
				<changelog lang="en">
					<change>Fixed the possibility of getting debug notices when an email address exists in a post.</change>
					<change>Fixed the possibility of getting debug notices when no links existed in a post.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-03-08</date>
				<rev-version>1.0.5</rev-version>
				<changelog lang="en">
					<change>Treat http:// and https:// as the same scheme.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-04-06</date>
				<rev-version>1.0.5a</rev-version>
				<changelog lang="en">
					<change>Renamed the define ANONYMIZE_EXTERNAL_LINKS to EXTERNAL_LINK_PREFIX.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-04-11</date>
				<rev-version>1.0.6</rev-version>
				<changelog lang="en">
					<change>When a URL cannot be properly parsed, the error message will be silenced and script will continue execution.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-06-08</date>
				<rev-version>1.0.7</rev-version>
				<changelog lang="en">
					<change>Fixed a mistake with ignoring multiple subdomains.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-07-01</date>
				<rev-version>1.0.8</rev-version>
				<changelog lang="en">
					<change>Repackaged for MODX 1.2.0.</change>
					<change>Added the ability to skip the parsing of image links.</change>
					<change>Created supplementary installation instructions for opening user website links in a new window.</change>
				</changelog>
			</entry>
		</history>
		<link-group>
			<link type="contrib" href="contrib/user website links/installation instructions.xml" lang="en">Open user websites in a new window.</link>
		</link-group>
	</header>
	<action-group>
		<copy>
			<file from="root/includes/prime_links.php" to="includes/prime_links.php" />
		</copy>

		<open src="includes/functions_content.php">
			<edit>
				<find><![CDATA[	if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Links -------------------------------------------------------//
	if (!function_exists('prime_links'))
	{
		global $phpEx;
		include($phpbb_root_path . 'includes/prime_links.' . $phpEx);
	}
	$text = prime_links($text);
//-- end: Prime Links -------------------------------------------------------//
]]></action>
			</edit>
		</open>

		<diy-instructions lang="en"><![CDATA[If you want to disable the external link target, open "includes/prime_links.php"
and change the value of EXTERNAL_LINK_TARGET to an empty string.

Other settings can be adjusted from within the "includes/prime_links.php" file as well.]]></diy-instructions>
	</action-group>
</mod>
