<?php /* Smarty version 2.6.14, created on 2006-08-09 18:10:44
         compiled from I:%5Cdouya.cn/meta/module/module_update.php */ ?>
<?php echo '<?php'; ?>
 
//print_r( $_REQUEST );

include_once( ROOT . 'lib/vf.function.php'  );
include_once( ROOT . 'lib/biz.function.php'  );

check_user( 1 );

$id = <?php echo $this->_tpl_vars['module_id']; ?>
;

$fields = get_module_fields_by_id( $id );
check_form_input( get_meta_from_fields( $fields ) );

$cid = intval($_REQUEST['id']);

$_REQUEST['id'] = '__DY__where__' . $_REQUEST['id'];

if( is_admin() )
	$_REQUEST['dy_uid'] = $_SESSION['dy_uid'];
else
	$_REQUEST['dy_uid'] = '__DY__where__' . $_SESSION['dy_uid'];

$_REQUEST['dy_nickname'] = $_SESSION['dy_nickname'];

$_REQUEST['dy_tags']  = format_tags( $_REQUEST['dy_tags'] );

$pda = new pda( 'dy_content_' . $id );
if($pda->update())
{
	$tags = $_REQUEST['dy_tags'];
	if( !empty( $tags ) )
	{
		$cid = mysql_insert_id();
		update_related_tags( $id , $cid , $tags );

		if( mysql_affected_rows() > 0 )
		{
			if( is_admin() )
				delete_tag( $id , $cid );
			else
				delete_tag( $id , $cid , $_SESSION['dy_uid'] );

			add_tag( $id , $cid , $tags );
		}
		
	}
		

	//info_page( '<a href="?u=<?php echo $this->_tpl_vars['dy_module_en_name']; ?>
_list">数据已经成功保存,点击这里返回列表</a>' );
	forward( urldecode( $_REQUEST['forward'] ) );
	
	exit;
}

<?php echo '?>'; ?>