<?php
(!defined('IN_PowerBB')) ? die() : '';
include('common.php');

$CALL_SYSTEM			=	array();
$CALL_SYSTEM['SECTION'] 	= 	true;
$CALL_SYSTEM['GROUP'] 		= 	true;
$CALL_SYSTEM['SUBJECT'] 	= 	true;
$CALL_SYSTEM['REPLY'] 			= 	true;
$CALL_SYSTEM['CACHE'] 			= 	true;

include('common.php');

define('CLASS_NAME','PowerBBPluginMOD');

class PowerBBPluginMOD
{
	function run()
	{
		global $PowerBB;


           $PowerBB->functions->ShowHeader();
            if ($PowerBB->_GET['main'])
			{
				if ($PowerBB->_GET['control'])
				{
					$this->_ControlMain();
				}

			}
			if ($PowerBB->_GET['update'])
			{
				$this->StartUpdate();
			}

		$PowerBB->functions->GetFooter();
	}

	function _ControlMain()
	{
		global $PowerBB;
        $template = $PowerBB->_GET['template'];
		$PowerBB->template->display($template);

	}

	function StartUpdate()
	{
		global $PowerBB;

		$kv = array();
		foreach ($PowerBB->_POST as $var_name => $value) {
		$kv[] = "$var_name=$value";
		if ($value !='')
		{
		$update = $PowerBB->info->UpdateInfo(array('value'=>$value,'var_name'=>$var_name));
		}
		}
		if ($update)
		{
            $PowerBB->functions->redirect2($PowerBB->_SERVER['HTTP_REFERER']);

         }

	}


}



?>
