<?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.					  * >>
<< * ---------------------------------------------------------------- * >>
<< ******************************************************************** >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

// #################### DEFINE IMPORTANT PERMISSIONS #####################
$vbulletin->options['dbtech_vbsuper_pm_auto_responder_excluded'] = explode(',', $vbulletin->options['dbtech_vbsuper_pm_auto_responder_excluded']);
$vbulletin->options['dbtech_vbsuper_pm_auto_blocker_allowed'] = explode(',', $vbulletin->options['dbtech_vbsuper_pm_auto_blocker_allowed']);
$vbulletin->options['dbtech_vbsuper_pm_warning_msg_allowed'] = explode(',', $vbulletin->options['dbtech_vbsuper_pm_warning_msg_allowed']);
//$vbulletin->options['dbtech_vbsuper_pm_quote_pm_allowed'] = explode(',', $vbulletin->options['dbtech_vbsuper_pm_quote_pm_allowed']);

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
	if ($vbulletin->options['dbtech_vbsuper_pm_system_enabled'])
	//if ($vbulletin->options['dbtech_vbsuper_pm_enabled'])
	{
		// vbsuper_pm is active
		$show['dbtech_vbsuper_pm_menu'] = true;
	}	

	// Create our nav template
	$dbtech_vbsuper_pm_nav = vB_Template::create('dbtech_vbsuper_pm_usercp_nav_link');

	if (intval($vbulletin->versionnumber) == 3)
	{
		$cells[] = 'dbtech_vbsuper_pm_options';
		$cells[] = 'dbtech_vbsuper_pm_ignorelist';
		$cells[] = 'dbtech_vbsuper_pm_customcommands';
	}
	
	if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['dbtech_vbsuper_pm_quote_pm_allowed'])) AND ($vbulletin->options['dbtech_vbsuper_pm_quote_pm_active']))
	{
		$date = date('Y');
			//require_once(DIR . '/dbtech/vbdonate_pro/actions/widget.php');
			$templater = vB_Template::create('dbtech_vbsuper_pm_quote_pm_link');
			$templater->register('output', $output);
			$templater->register('date', $date);
			$show['dbtech_vbsuper_pm_quote_pm_link'] = $templater->render();
	}

	//Show post quote setttings if active and has perms
	if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['dbtech_vbsuper_pm_post_quote_allowed'])) AND ($vbulletin->options['dbtech_vbsuper_pm_post_quote_active']))
	{
		$date = date('Y');
			//require_once(DIR . '/dbtech/vbdonate_pro/actions/widget.php');
			$templater = vB_Template::create('dbtech_vbsuper_pm_post_quote_link');
			$templater->register('output', $output);
			$templater->register('date', $date);
			$show['dbtech_vbsuper_pm_post_quote_link'] = $templater->render();
	}	

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