<?php
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*\
<< ******************************************************************** >>
<< * ---------------------------------------------------------------- * >>
<< * Copyright ©2011-2012 Ozzy47                                      * >>
<< * All Rights Reserved. 											  * >>
<< * This file may not be redistributed in whole or significant part. * >>
<< * ---------------------------------------------------------------- * >>
<< * You are not allowed to use this on your server unless the files  * >>
<< * you downloaded were done so with permission.					  * >>
<< * ---------------------------------------------------------------- * >>
<< ******************************************************************** >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

if (
	$page_templater->get_template_name() == 'pm_newpm' AND 
	$vbulletin->options['dbtech_vbsuper_pm_system_enabled'] AND 
	$vbulletin->options['dbtech_vbsuper_pm_pmattach_enabled'] AND 
	is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['dbtech_vbsuper_pm_attachments_allowed']))
)
{
	$vbulletin->input->clean_array_gpc('p', array(
		'poststarttime' =>  TYPE_UINT,
		'posthash'      =>  TYPE_STR,
	));

	$poststarttime = $vbulletin->GPC['poststarttime'] ? $vbulletin->GPC['poststarttime'] : TIMENOW;
	$posthash = $vbulletin->GPC['posthash'] ? $vbulletin->GPC['posthash'] : md5($poststarttime . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt']);

	$templater = vB_Template::create('dbtech_vbsuper_pm_newpm');		
		$templater->register('editorid', $editorid);
		$templater->register('posthash', $posthash);
		$templater->register('poststarttime', $poststarttime);
		$templater->register('contenttypeid', vB_Types::instance()->getContentTypeID('vBForum_PrivateMessage'));
	$posticons .= $templater->render();
	$page_templater->register('posticons', $posticons, true);
	
	require_once(DIR . '/packages/vbattach/attach.php');
 	$attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_PrivateMessage');
 	$disablesmiliesoption .= $attach->fetch_edit_attachments($posthash, $poststarttime, $postattach, 0, $values, $editorid, $attachcount);
 	$page_templater->register('disablesmiliesoption', $disablesmiliesoption, true);	
}

/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*\
<< ********************************************************************* >>
<< * Created: 09:30, Fri June 8th 2012                                 * >>
<< * VER: 1.0.0                                                        * >>
<< ********************************************************************* >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
?>