<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="kirky_staffcensure" active="1">
	<title>Public Infraction Notice</title>
	<description />
	<version>1.01</version>
	<url />
	<versioncheckurl />
	<dependencies>
	</dependencies>
	<codes>
		<code version="1.0.0">
			<installcode><![CDATA[$db->hide_errors();
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "infraction ADD censurenote VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL");
$db->show_errors();]]></installcode>
			<uninstallcode><![CDATA[$db->hide_errors();
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "infraction DROP censurenote");
$db->show_errors();]]></uninstallcode>
		</code>
	</codes>
	<templates>
	</templates>
	<plugins>
		<plugin active="1" executionorder="5">
			<title>Set Censure Validfields</title>
			<hookname>infractiondata_start</hookname>
			<phpcode><![CDATA[$this->validfields['censurenote'] = array(TYPE_STR, REQ_NO);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Set Censure DM (Reversal)</title>
			<hookname>infraction_reverse_process</hookname>
			<phpcode><![CDATA[$infdata->set('censurenote', '');]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Clean Censure</title>
			<hookname>infraction_update_complete</hookname>
			<phpcode><![CDATA[$censurenote = htmlspecialchars_uni($vbulletin->GPC['censurenote']);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Set Censure DM</title>
			<hookname>infraction_update_process</hookname>
			<phpcode><![CDATA[$infdata->set('censurenote', fetch_censored_text($vbulletin->GPC['censurenote']));]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Clean Censure</title>
			<hookname>infraction_update_start</hookname>
			<phpcode><![CDATA[$vbulletin->input->clean_gpc('p', 'censurenote', TYPE_STR);]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Set Censure Conditional</title>
			<hookname>infraction_view_start</hookname>
			<phpcode><![CDATA[if ($infractioninfo['censurenote'] AND ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canreverseinfraction'] OR $vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['cangiveinfraction']))
{
	$show['censurenote'] = true;
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Template Replacement</title>
			<hookname>postbit_display_complete</hookname>
			<phpcode><![CDATA[global $vbulletin;

$pindate = vbdate($vbulletin->options['dateformat'], $post['infdateline']);
$pintime = vbdate($vbulletin->options['timeformat'], $post['infdateline']);
if ($post['censure'] AND $post['infraction'] == 2){
	$template_hook['postbit_end'] .= '
		<div style="padding:' . $stylevar[cellpadding] . 'px 0px 0px 0px">
		<table class="tborder" cellpadding="' . $stylevar[cellpadding] . '" cellspacing="0" border="0" width="100%" align="center">
			<tr>
				<td class="thead" style="font-weight:normal;border:' . $stylevar[cellspacing] . 'px solid ' . $stylevar[tborder_bgcolor] . ';">
				<div align="left" style="float:left;text-decoration:underline;font-weight:bold;">' . $vbphrase[sc_notice_censure] . '</div>
				<div align="right" style="float:right;">Issued: <strong>' . $pindate . '</strong> at <strong>' . $pintime . '</strong></div>
				</td>
			</tr>
			<tr>
				<td class="alt1"><span class="smallfont">' . $post[censure] . '</span></td>
			</tr>
		</table>
		</div>
	';
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Add to Post Query</title>
			<hookname>showthread_query</hookname>
			<phpcode><![CDATA[$hook_query_fields .= ", inf.censurenote AS censure, inf.dateline AS infdateline";
$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "infraction AS inf ON(post.postid = inf.postid AND inf.action != 2)";]]></phpcode>
		</plugin>
	</plugins>
	<phrases>
		<phrasetype name="User Infractions" fieldname="infraction">
			<phrase name="sc_notice_censure_infract" date="1206324758" username="admin" version="1.0.0"><![CDATA[Notice of Infraction]]></phrase>
		</phrasetype>
		<phrasetype name="Postbit" fieldname="postbit">
			<phrase name="sc_notice_censure" date="1206324729" username="admin" version="1.0.0"><![CDATA[Public Notice of Infraction for the Previous Post]]></phrase>
		</phrasetype>
	</phrases>
	<options>
	</options>
	<helptopics>
	</helptopics>
	<cronentries>
	</cronentries>
	<faqentries>
	</faqentries>
</product>
