<?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.2.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		<title lang="en">Prime Age Group</title>
		<description lang="en">Allows users to be added and/or removed from groups automatically based on their age.</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 a donation, 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#age_group]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.0a</mod-version>
		<installation>
			<level>easy</level>
			<time>180</time>
			<target-version>3.0.4</target-version>
		</installation>
		<history>
			<entry>
				<date>2008-09-08</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>Initial release.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-11-14</date>
				<rev-version>1.0.0a</rev-version>
				<changelog lang="en">
					<change>Updated instructions for phpBB 3.0.3.</change>
				</changelog>
			</entry>
		</history>
	</header>
	<action-group>
		<copy>
			<file from="./root/includes/prime_age_group.php" to="./includes/prime_age_group.php" />
			<file from="./root/language/en/mods/prime_age_group.php" to="./language/en/mods/prime_age_group.php" />
		</copy>
		<sql><![CDATA[ALTER TABLE phpbb_groups ADD ( 
	prime_age_group_enable  tinyint(1)   UNSIGNED DEFAULT "0" NOT NULL,
	prime_age_group_min_age smallint(4)  UNSIGNED DEFAULT "0" NOT NULL,
	prime_age_group_max_age smallint(4)  UNSIGNED DEFAULT "0" NOT NULL,
	prime_age_group_default tinyint(1)   UNSIGNED DEFAULT "0" NOT NULL,
	prime_age_group_strict  tinyint(1)   UNSIGNED DEFAULT "0" NOT NULL,
	prime_age_group_remove  mediumint(8) UNSIGNED DEFAULT "0" NOT NULL)]]></sql>

		<open src="includes/functions.php">
			<edit>
				<find><![CDATA[			$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Age Group ---------------------------------------------------//
			if ($config['allow_birthdays'] && !$admin)
			{
				include($phpbb_root_path . 'includes/prime_age_group.' . $phpEx);
				$prime_age_group->execute($user->data);
			}
//-- end: Prime Age Group ---------------------------------------------------//]]></action>
			</edit>
		</open>
		<open src="includes/functions_user.php">
			<edit>
				<find><![CDATA[	// Check data. Limit group name length.]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Age Group ---------------------------------------------------//
	global $phpbb_root_path, $phpEx;
	include($phpbb_root_path . 'includes/prime_age_group.' . $phpEx);
	$prime_age_group->update_attribute_tables($attribute_ary, $group_only_ary);
//-- end: Prime Age Group ---------------------------------------------------//
]]></action>
			</edit>
		</open>
		<open src="adm/style/acp_groups.html">
			<edit>
				<find><![CDATA[	<fieldset class="submit-buttons">]]></find>
				<action type="before-add"><![CDATA[	{PRIME_AGE_GROUP_OPTIONS}]]></action>
			</edit>
		</open>
		<open src="includes/acp/acp_groups.php">
			<edit>
				<find><![CDATA[				// Did we submit?]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Age Group ---------------------------------------------------//
				include($phpbb_root_path . 'includes/prime_age_group.' . $phpEx);
				$prime_age_group->acp_display_options($group_row);
//-- end: Prime Age Group ---------------------------------------------------//]]></action>
			</edit>
			<edit>
				<find><![CDATA[						if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies)))]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Age Group ---------------------------------------------------//
						$prime_age_group->acp_set_options($group_row, $group_attributes, $action);
//-- end: Prime Age Group ---------------------------------------------------//]]></action>
			</edit>
		</open>
		<open src="includes/ucp/ucp_profile.php">
			<edit>
				<find><![CDATA[							$sql_ary['user_birthday'] = $data['user_birthday'];]]></find>
				<action type="after-add"><![CDATA[//-- mod: Prime Age Group ---------------------------------------------------//
							include($phpbb_root_path . 'includes/prime_age_group.' . $phpEx);
							$user->data['user_birthday'] = $sql_ary['user_birthday'];
							$prime_age_group->execute($user->data);
//-- end: Prime Age Group ---------------------------------------------------//]]></action>
			</edit>
		</open>
		<diy-instructions lang="en">As an alternative to manually executing the SQL statements, you can use the included 
"db_install.php" (located in the contrib directory). Simply copy the file to the root
directory of your phpbb3 install, and point your web browser to the address. Make 
sure you are logged in as an administrator before you do this, and make sure to
delete the file once you're done.</diy-instructions>
	</action-group>
</mod>