".$cat." and (".$subQue.")"); } } setrawcookie('result_menu', rawurlencode('메뉴 등록정보가 변경 되었습니다.|success')); // 처리여부 cookie 저장 getLink('reload','parent.','',''); } else { $MAXC = getDbCnt($table['s_menu'],'max(gid)','depth='.($depth+1).' and parent='.$parent); $sarr = explode(',' , trim($name)); $slen = count($sarr); for ($i = 0 ; $i < $slen; $i++) { if (!$sarr[$i]) continue; $gid = $MAXC+1+$i; $xdepth = $depth+1; $xname = trim($sarr[$i]); $xnarr = explode('=',$xname); $QKEY = "gid,site,is_child,parent,depth,id,menutype,mobile,hidden,reject,name,target,redirect,joint,perm_g,perm_l,layout,m_layout,imghead,imgfoot,addattr,num,d_last,addinfo,upload,imgicon"; $QVAL = "'$gid','".$_HS['uid']."','0','$parent','$xdepth','$xnarr[1]','$menutype','$mobile','$hidden','$reject','$xnarr[0]','$target','$redirect','$joint','$perm_g','$perm_l','$layout','$m_layout','','','$addattr','0','','$addinfo','$upload','$imgicon'"; getDbInsert($table['s_menu'],$QKEY,$QVAL); $lastmenu = getDbCnt($table['s_menu'],'max(uid)',''); getDbInsert($table['s_seo'],'rel,parent,title,keywords,description,classification,image_src',"'1','$lastmenu','$title','$keywords','$description','$classification','$image_src'"); if(!$redirect&&$menutype==1&&strstr($joint,'cync=Y')) { $ctarr = getMenuCodeToPath($table['s_menu'],$lastmenu,0); $catcode = ''; $ctnum = count($ctarr); for ($j = 0; $j < $ctnum; $j++) $catcode .= $ctarr[$j]['id'].'/'; $c = substr($catcode,0,strlen($catcode)-1); $joint = str_replace('cync=Y','cync=['.$m.'][c'.$lastmenu.'][,,,][][][c:'.$c.']',$joint); } if (!$xnarr[1]) { $_newId = $lastmenu; getDbUpdate($table['s_menu'],"id='".$lastmenu."',joint='".$joint."'",'uid='.$lastmenu); } else { $_newId = $xnarr[1]; $ISMCODE = getDbData($table['s_menu'],"uid<> ".$lastmenu." and id='".$xnarr[1]."' and site=".$s,'*'); if ($ISMCODE['uid']) { $_newId = $lastmenu; getDbUpdate($table['s_menu'],"id='".$lastmenu."',joint='".$joint."'",'uid='.$lastmenu); } } $mfile = $g['path_page'].$r.'-menus/'.$_newId; $fp = fopen($mfile.'.php','w'); fwrite($fp,''); fclose($fp); @chmod($mfile.'.php',0707); if (trim($codhead)) { $fp = fopen($mfile.'.header.php','w'); fwrite($fp, trim(stripslashes($codhead))); fclose($fp); @chmod($mfile.'.header.php',0707); } if (trim($codfoot)) { $fp = fopen($mfile.'.footer.php','w'); fwrite($fp, trim(stripslashes($codfoot))); fclose($fp); @chmod($mfile.'.footer.php',0707); } if ($cachetime) { $fp = fopen($mfile.'.txt','w'); fwrite($fp, $cachetime); fclose($fp); @chmod($mfile.'.txt',0707); } } if ($parent) { getDbUpdate($table['s_menu'],'is_child=1','uid='.$parent); } db_query("OPTIMIZE TABLE ".$table['s_menu'],$DB_CONNECT); if ($i > 1) { setrawcookie('result_menu', rawurlencode('복수의 메뉴가 등록 되었습니다.|success')); // 처리여부 cookie 저장 getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=menu&cat='.$parent.'&code='.$code.'&vtype='.$vtype,'parent.','',''); } else { setrawcookie('result_menu', rawurlencode('메뉴가 등록 되었습니다.|success')); // 처리여부 cookie 저장 getLink($g['s'].'/?r='.$r.'&m=admin&module='.$m.'&front=menu&cat='.$lastmenu.'&code='.($code?$code.'/'.$lastmenu:$lastmenu).'#site-menu-info','parent.','',''); } } ?>