<?php
include(dirname(__FILE__)."/../global.php");



include("fun.php");


$wn_action = 'modify';	
	
	
$aid  = $_POST['aid'];//网站栏目
$fid    = $_POST['fid'];//栏目模块
$mid    = $_POST['mid'];//栏目模块


//增加文章改栏目
$parentId = $_POST['postdb']['parentId'];//新改的栏目id

if( $parentId != $fid ){
	$fid = $parentId;

//echo $parentId;

//exit ( "UPDATE `w6_module_content_index` SET `fid`='".$fid."' WHERE `id`=".$aid );

mysql_query( "UPDATE `w6_module_content_index` SET `fid`='".$fid."' WHERE `id`=".$aid );

mysql_query( "UPDATE `w6_module_content_$mid` SET `fid`='".$fid."' WHERE `aid`=".$aid );

}

  /*$query="UPDATE `w6_module_content_$mid` 
          SET `title`='".$postdb['title']."' , `titlecolor`='".$postdb['titlecolor']."' , `fonttype`='".$postdb['fonttype']."'
		  WHERE `aid`=".$postdb['aid']; 
		  */
		  
$result = get_modify_sql( $aid , $mid );


  
  if ($result)
     {
       $showmsg = "文章修改成功！";
	   $formurl = "../article_modify.php?aid=".$aid."&fid=".$fid."&mid=".$mid;
	   	 if($webdb['NewsMakeHtml']=='1'){
	  	 echo "<IFRAME marginWidth=0 marginHeight=0 src='$webdb[www_url]/show.php?job=makeHtml&aid=$aid&updatapage=1' frameBorder=0 width=200 scrolling=no height=50></IFRAME>";//updatapage要生成的静态页数
		 }
     }
  else
     {
       $showmsg = "文章修改失败！";
	   $formurl = "../article_modify.php?aid=".$aid."&fid=".$fid."&mid=".$mid;
     }
	 
  include('../showmsg.php');
  exit;



