<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="./modx/1.2.5.xsl" ?>
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
    <!-- plugin metadata -->
    <header>
        <title lang="en">VigLink</title>
        <description lang="en">
		This MOD allows forum owners to easily integrate VigLink's automated affiliate link monetization technology. VigLink automatically affiliates all of your outbound links so you get paid when visitors click through and buy something. VigLink's technology is used by tens of thousands of forums, blogs and websites. Not only does VigLink enable effortless monetization of outbound links, we also provide powerful analytics by tracking where users are going when they leave your site, which pages produce the most revenue and much much more! 
        </description>
        <author-group>
            <author>
                <!-- phpbb.com username -->
                <username>viglink</username>
                <email>info@viglink.com</email>
                <homepage>http://www.viglink.com?vgref=phpBB</homepage>
            </author>
        </author-group>
        <mod-version>1.0.1</mod-version>
        <installation>
            <level>easy</level>
            <time>180</time>
            <target-version>3.0.8</target-version>
        </installation>
        <license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
    </header>
    <!-- install description -->
    <action-group>
        <diy-instructions lang="en">
            After finishing the installation, please go to the Admin Control Panel's Board Settings and enter your VigLink API key. If you don't already have a VigLink account you will need to go to http://www.viglink.com/users/signup?vgref=phpBB and sign up. Once you've signed up, go to the Viglink account page and copy your API Key for use in the Admin Control Panel Board Settings.
        </diy-instructions>
        <!-- copy files into the phpBB installation -->
        <copy>
			<file from="root/*.*" to="*.*" />
		</copy>
		<php-installer><![CDATA[viglink_install.php]]></php-installer>
        <!-- include the VigLink class -->
        <open src="includes/functions.php">
            <edit>
                <find><![CDATA['S_USER_NEW'					=> $user->data['user_new'], ]]></find>
                <action type="after-add"><![CDATA[
        'S_VIGLINK_KEY'                 => !empty($config['viglink_key']) ? $config['viglink_key'] : '',
                ]]></action>
            </edit>
        </open>
        <!-- add some strings to the localization file -->
        <open src="language/en/acp/board.php">
            <edit>
                <find><![CDATA[?>]]></find>
                <action type="before-add"><![CDATA[// VigLink
$lang = array_merge($lang, array(
	'VIGLINK' => 'VigLink',
	'VIGLINK_KEY' => 'Your VigLink API Key',
	'VIGLINK_KEY_EXPLAIN' => 'Copy your API key from the <a href="http://www.viglink.com/account?vgref=phpBB">viglink.com account page</a> and paste it here.',
	'ACP_VIGLINK_SETTINGS' => 'VigLink Settings',
));]]></action>
            </edit>
        </open>
        <!-- display the settings page -->
        <open src="includes/acp/acp_board.php">
            <edit>
                <find><![CDATA['legend2'				=> 'WARNINGS',
				'warnings_expire_days'	=> array('lang' => 'WARNINGS_EXPIRE',		'validate' => 'int',	'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),]]></find>
                <action type="after-add"><![CDATA[
                    'legend_viglink' => 'VIGLINK',
                    'viglink_key' => array('lang' => 'VIGLINK_KEY', 'validate' => 'string', 'type' => 'text:44:32', 'explain' => true),
                ]]></action>
            </edit>
        </open>
        <!-- include the embed in the footer of each page -->
        <open src="styles/prosilver/template/overall_footer.html">
            <edit>
                <find><![CDATA[</body>]]></find>
                <action type="before-add"><![CDATA[<!-- INCLUDE viglink_embed.html -->]]></action>
            </edit>
        </open>
    </action-group>
</mod>
