<?php
/**
 *	Generated by miceCMS
 *	http://www.miceCMS.com/
 */
class userAction extends security_normal {
	function action(){
		global $conn;
		$miceSession = new session();
		if(!$miceSession->get('mu__userid')){
			$jsstring='Dialog.alert(\'您尚未登录\',function(){window.location.href="'.MICE_URL.'";window.event.returnValue = false;},300,100,"提示信息");';
			MessageBox($jsstring);
			exit;
		}

		$user=new model_User();
		$user->setSubsection('WHERE user_id='.$miceSession->get('mu__userid'));
		$results=$user->doSelectOne();

		if($results->getStopdate()){
			$stopdate=Num2Date('micefun',$results->getStopdate());
		}else{
			$stopdate='永不到期';
		}
		
		$editor='';
		//调用插件
		$plugin=new model_Plugin();
		$plugin->setSubsection('WHERE isopen=1 AND hook=\'editor_fast\' ORDER BY orderid ASC,plugin_id DESC');
		$plugins=$plugin->doSelectOne();
		include_once MICE_DIR.'includes/plugin.php';
		if($plugins){
			if(file_exists(MICE_DIR.'plugins/'.$plugins->getName().'/index.php')){
				include_once MICE_DIR.'plugins/'.$plugins->getName().'/index.php';
				add_filter('editor_fast', $plugins->getName());
				$editor=apply_filters('editor_fast',0);
				remove_filter('editor_fast', $plugins->getName());
			}
		}

		if($editor==''){
			$editor='<textarea id="MCEname" name="MCEname" rows="15" cols="80" style="width: 100%">MCEcontent</textarea>';
		}

		$editor=str_replace('MCEname','explam',$editor);
		$editor=str_replace('MCEcontent',str_replace("\r\n","",$results->getExplam()),$editor);

		$smarty = new Smarty();
		$smarty->load_filter('pre','micePreCompileIndex');
		$smarty->assign('results',$results);
		$smarty->assign('stopdate',$stopdate);
		$smarty->assign('editor',$editor);
		$smarty->assign('formaction',MICE_URL.'index.php/userupdate');

		$filename = new getTPLFileName(__CLASS__);
		$tpl=$filename->TPLFileName;
		$smarty->display($tpl);
	}
}
?>