<?php
if (!defined('IN_HANFOX')) exit('Access Denied');

$pagename = '作家认证';
$pageurl = '?mod=author';
$tplfile = 'author.html';
$table = $DB->table('users');

if (!$smarty->isCached($tplfile)) {
	$smarty->assign('pagename', $pagename);
	$smarty->assign('site_title', $pagename.' - '.$options['site_name']);
	$smarty->assign('site_path', get_sitepath().' &raquo; '.$pagename);
	
	if ($_POST['do'] == 'save') {
		
		$user_qq = trim($_POST['user_qq']);
		$user_name = trim($_POST['user_name']);
		$user_author = trim($_POST['user_author']);
		$user_pic = trim($_POST['user_pic']);
		$user_intro = trim($_POST['user_intro']);
		$user_tel = trim($_POST['user_tel']);
		$user_wang = trim($_POST['user_wang']);
		$user_city = trim($_POST['user_city']);
		
		$data = array(
			
			'user_qq' => $user_qq,
			'user_name' => $user_name,
			'user_author' => $user_author,
			'user_pic' => $user_pic,
			'user_intro' => $user_intro,
			'user_tel' => $user_tel,
			'user_wang' => $user_wang,
			'user_city' => $user_city,
				
		);
		
		$where = array(
			'user_id' => $myself['user_id'],
			
		);
		
		$DB->update($table, $data, $where);
		msgbox('个人资料修改成功！', $pageurl);
	}
}

smarty_output($tplfile);
?>