<?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 Warnings</title>
		<description lang="en">Displays the number of warnings a user has received. Uses little yellow warning card images for immediate visual identification that the user has been warned.</description>
	    <author-notes lang="en">The PRIME_WARNING_CAP define can be changed to any positive integer. If there are more than that number of warnings, then they will be displayed as a single card graphic with the number of warnings the card represents displayed inside.

Support is given for both prosilver and subsilver2 templates. If you are using other templates then you will need to modify the template instructions to fit your templates.

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 $1.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#warnings]]></homepage>
			</author>
		</author-group>
		<mod-version>1.0.3</mod-version>
		<installation>
			<level>easy</level>
			<time>120</time>
			<target-version>3.0.6</target-version>
		</installation>
		<history>
			<entry>
				<date>2008-01-04</date>
				<rev-version>1.0.0</rev-version>
				<changelog lang="en">
					<change>Initial release.</change>
				</changelog>
			</entry>

			<entry>
				<date>2008-01-05</date>
				<rev-version>1.0.1</rev-version>
				<changelog lang="en">
					<change>Once the number of warnings exceeds the cap limit defined by PRIME_WARNING_CAP, it now switches to displaying only a single card graphic with the total number of warnings put inside it.</change>
				</changelog>
			</entry>

			<entry>
				<date>2008-01-05</date>
				<rev-version>1.0.2</rev-version>
				<changelog lang="en">
					<change>Added the option to hide warnings from the general public, so only administrators, moderators, and the actual user will see the number of warnings.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-07-02</date>
				<rev-version>1.0.2a</rev-version>
				<changelog lang="en">
					<change>Repackaged for MODX 1.2.0.</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-08-04</date>
				<rev-version>1.0.3</rev-version>
				<changelog lang="en">
					<change>Fixed a bug that caused the number of warnings to be publicly displayed even when their display was set to private.</change>
					<change>Repackaged to fix the Firefox 3 restricted parent directory issue.</change>
				</changelog>
			</entry>
			<entry>
				<date>2009-08-28</date>
				<rev-version>1.0.4</rev-version>
				<changelog lang="en">
					<change>Align the warning graphic to the right on the subsilver2 style.</change>
				</changelog>
			</entry>
		</history>
		<link-group>
			<link type="template" href="contrib/template subsilver2.xml" realname="subsilver2" lang="en">subsilver2</link>
		</link-group>
	</header>
	<action-group>
		<copy>
 			<file from="root/includes/prime_warnings.php" to="includes/prime_warnings.php" />
 			<file from="root/styles/prosilver/theme/images/warning_card.gif" to="styles/prosilver/theme/images/warning_card.gif" />
		</copy>
		<open src="memberlist.php">
			<edit>
				<find><![CDATA[		if (!empty($profile_fields['blockrow']))]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Warnings ----------------------------------------------------//
		if ($member['user_warnings'])
		{
			include($phpbb_root_path . 'includes/prime_warnings.' . $phpEx);
			prime_warnings($member['user_warnings'], 'warnings', $member['user_id']);
		}
//-- end: Prime Warnings ----------------------------------------------------//
]]></action>
			</edit>
		</open>

		<open src="viewtopic.php">
			<edit>
				<find><![CDATA[	if (!empty($cp_row['blockrow']))]]></find>
				<action type="before-add"><![CDATA[//-- mod: Prime Warnings ----------------------------------------------------//
	if ($user_cache[$poster_id]['warnings'])
	{
		include($phpbb_root_path . 'includes/prime_warnings.' . $phpEx);
		prime_warnings($user_cache[$poster_id]['warnings'], 'postrow.warnings', $poster_id);
	}
//-- end: Prime Warnings ----------------------------------------------------//
]]></action>
			</edit>
		</open>

		<open src="styles/prosilver/template/memberlist_view.html">
			<edit>
				<find><![CDATA[	<dl class="left-box details" style="width: 80%;">]]></find>
				<action type="before-add"><![CDATA[	<!-- BEGIN warnings --><div title="{L_WARNINGS}" style="float:right;margin-left:2px;width:20px;height:20px;line-height:20px;text-align:center;background:url('{T_THEME_PATH}/images/warning_card.gif') no-repeat 50%;cursor:default;">{warnings.COUNT}</div><!-- END warnings -->]]></action>
			</edit>
		</open>

		<open src="styles/prosilver/template/viewtopic_body.html">
			<edit>
				<find><![CDATA[		<!-- IF postrow.U_PM or postrow.U_EMAIL or postrow.U_WWW or postrow.U_MSN or postrow.U_ICQ or postrow.U_YIM or postrow.U_AIM]]></find>
				<action type="before-add"><![CDATA[		<!-- IF postrow.POSTER_WARNINGS and .postrow.warnings --><dd><strong>{L_WARNINGS}:</strong> {postrow.POSTER_WARNINGS}</dd><!-- ENDIF -->]]></action>
			</edit>

			<edit>
				<find><![CDATA[				</ul>
			</dd>
		<!-- ENDIF -->]]></find>
				<action type="after-add"><![CDATA[			<!-- IF .postrow.warnings --><dd><!-- BEGIN warnings --><div title="{L_WARNINGS}" style="float:right;margin-left:2px;width:20px;height:20px;line-height:20px;text-align:center;background:url('{T_THEME_PATH}/images/warning_card.gif') no-repeat 50%;cursor:default;">{postrow.warnings.COUNT}</div><!-- END warnings --></dd><!-- ENDIF -->]]></action>
			</edit>
		</open>
	</action-group>
</mod>
