/source/gl/user/i.phpbak
http://prosporous.googlecode.com/ · Unknown · 701 lines · 688 code · 13 blank · 0 comment · 0 complexity · 6d4e6acd180072b336d3025204de9eca MD5 · raw file
- <?php
- /**??????UTF-8???.
- * Created on 2010-6-29
- *
- * @author EXT <isrn@qq.com>
- *
- */
- include ('../../includes/global.php');
- include ('../global.php');
- include ("../power.php");
- $dbcfg=Sys::Gp(array('dbcfg','sevenel'));
- $donotrender = array('htmleditor','fckeditor','password','hidden');
- function grv($type,$blm,$dvalue=false){
- //print_r($type);
- if($dvalue){
- return $dvalue;
- }else{
- switch($type){
- case 'function':{
- $a=explode('#',$blm);
- return $a[0]($a[1]);
- break;
- }
- case '$_GET':{
- return $_GET[$blm];
- break;
- }
- case '$_SESSION':{
- return $_SESSION[$blm];
- break;
- }
- case '$_POST':{
- return $_POST[$blm];
- break;
- }
- case '$_COOKIE':{
- return $_COOKIE[$blm];
- break;
- }
- case '$_SERVER':{
- return $_SERVER[$blm];
- break;
- }
- case '$_ENV':{
- return $_ENV[$blm];
- break;
- }
- case '$_FILES':{
- return $_FILES[$blm];
- break;
- }
- case '0':{
- return $blm;
- break;
- }
- case '1':{
- break;
- }
- default:{
- return $blm;
- break;
- }
-
- }
- }
- }
- switch($_REQUEST['op']){
- case 'add':{
- $tree_id = $_GET['tid'];
- Tr($_GET['tid'],'tid');
- Tr($_GET['bdtid'],'bdtid');
- Tr($_GET['bdid'],'bdid');
- $field=Dgd(array(
- 'db'=>'d_sevenel',
- 'cd'=>"tid = $tree_id order by px asc",
- 'tn'=>"fld"
- ));
- $tree=Dgd(array(
- 'db'=>'d_sevenel',
- 'cd'=>"id = $tree_id",
- 'tn'=>"tree",
- 'limit'=>1
- ));
- $tname=gettabname($tree['table'],$dbcfg['prefix'],true);
- Tr($tname,'tname');
- if($_GET['id']){
- Tr($_GET['id'],'id');
- $fdada=Dgd(array(
- 'db'=>'d_sevenel',
- 'cd'=>" id = '".$_GET['id']."' and del != '1' ",
- 'tn'=>"$tname",
- 'limit'=>1
- ));
- Tr($fdada['gid'],'gid');
- Tr(preg_replace("/[\s]{2,}/","",$fdada['lg']),'lg');
- }
- foreach($field as $arrow=>$value){
- $back = is_odd($arrow+1)?"itemCls:'hang',":"";
- if($value['cfg']!=''){
- $config =json_decode($value['cfg'],true);
- }else{$config =''; }
- /* if($config!=''){foreach($config as $key=>$v){
- $config[$key]=adxx($v);
- }}
- */ $config['STR']=str_replace("\r","",$config['STR']);
- $config['STR']=str_replace("\n","",$config['STR']);
- $config['STR']=str_replace("\t","",$config['STR']);
- switch($value['type']){
- case 'hidden':{
- $js[] ="{
- xtype: 'hidden',
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- name: '".$value['fname']."'
- }";
- break;}
- case 'textfield':{
- $js[] ="{
- xtype: 'textfield',
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- fieldLabel:'".$value['name']."',
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- ".(($value['width'])?("width:'".$value['width']."px',"):("grow:true,growMin:68,growMax:300,"))."
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- ".(($config['readonly'])?("readOnly:'true',"):(""))."
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- ".$back."
- name: '".$value['fname']."'
- }";
- break;}
- case 'password':{
- if($_GET['id']==''){
- $js[] ="{
- xtype: 'textfield',
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- fieldLabel:'".$value['name']."',
- inputType: 'password',
- id: '".$value['fname']."',
- width:'150',
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- ".$back."name: '".$value['fname']."'
- }";
- if($value['yxwk']){
- $js[] ="{
- xtype: 'textfield',
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- fieldLabel:'??".$value['name']."',
- inputType: 'password',
- vtype: 'password',
- width:'150',
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- initialPassField: '".$value['fname']."',
- ".$back."name: '".$value['fname']."-cfrm'
- }";
- $plugurl[] = '/Plug-in/ext/adv-vtypes.js';
- }}else{
- $js[] ="{
- xtype: 'button',
- fieldLabel:'????'
- }";
- }
- break;}
- case 'fileup':{
- if($fdada[$value['fname']]==''){
- $fdada[$value['fname']]='zwtp.jpg';
- }
- $dvalue=array( 0=>array('rar','zip','tar','.tz'),
- 1=>array('jpg','gif','png','bmp'),
- 2=>array('mp3','mp4','avi','wmv','mid','.rm','mvb','mov','wma','wav'),
- 3=>array('doc','xls','txt','ocx','lsx','ppt','pdf','chm'),
- 4=>array('doc','xls','txt','ocx','lsx','ppt','pdf','chm','mp3','mp4','avi','wmv','mid','.rm','mvb','mov','wma','wav','jpg','gif','png','bmp','rar','zip','tar','.tz')
- );
- $otype=substr(strtolower($fdada[$value['fname']]),-3);
- if(in_array($otype,$dvalue[0])){
- $zs="<a href=\"/uplods/pic/".$fdada[$value['fname']]."\" target=\'_blank\'><img src=\"../img/archive.png\">??[Download]</a>";
- }
- if(in_array($otype,$dvalue[1])){
- if($config['sypic']==1||$config['sytxt']==1){
- $zs="<img src=\"/uplods/sytp/".$fdada[$value['fname']]."\" >";
- }else{
- $zs="<img src=\"/uplods/pic/".$fdada[$value['fname']]."\" >";
- }
- }
- if(in_array($otype,$dvalue[2])){
- $zs="<a href=\"/uplods/pic/".$fdada[$value['fname']]."\" target=\'_blank\'><img src=\"../img/film_link.png\">??[Download]</a>";
- }
- if(in_array($otype,$dvalue[3])){
- $zs="<a href=\"/uplods/pic/".$fdada[$value['fname']]."\" target=\'_blank\'><img src=\"../img/report_word.png\">??[Download]</a>";
- }
- $qk=" <a href=\"#\" onclick=qkzd(\"".$fdada['id']."\",\"".$value['fname']."\") ><img src=\"../img/001_02.gif\">?????</a>";
- $js[] ="{
- xtype: 'textfield',
- fieldLabel:'".$value['name']."',
- inputType: 'file',
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- width:'150',
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- ".$back."name: '".$value['fname']."'
- },{".$back."html:'<div style=\"float:left;width:300px;\" align=center>".$zs."".$qk."</div>'}";
- break;}
- case 'textarea':{
- $js[] =preg_replace("/[\s]{2,}/","","{
- xtype: 'textarea',
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- fieldLabel:'".$value['name']."',
- grow:true,
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- ".(($value['width'])?("width:'".$value['width']."px',"):("width:'400px',"))."
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- ".(($config['readonly'])?("readOnly:'true',"):(""))."
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- ".$back."
- name: '".$value['fname']."'
- }");
- break;}
- case 'htmleditor':{
- $js[] =preg_replace("/[\s]{2,}/","","{
- xtype: 'htmleditor',
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- fieldLabel:'".$value['name']."',
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- ".(($value['width'])?("width:".$value['width'].","):("anchor:'98%',"))."
- ".(($config['height'])?("height:".$config['height'].","):(""))."
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- ".$back."
- name: '".$value['fname']."'
- }");
- break;}
- case 'fckeditor':{
- $js[] =preg_replace("/[\s]{2,}/","","{
- xtype:\"textarea\",
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- ".(($value['width'])?("width:".$value['width'].","):("anchor:'98%',"))."
- ".(($config['height'])?("height:".$config['height'].","):("height:300,"))."
- fieldLabel:'".$value['name']."',
- ".$back."
- listeners:{
- focus:function(f){
- var myMask = new Ext.LoadMask(Ext.getBody(), {msg:'???'});
- myMask.show();
- var w=f.getSize();
- fckEditor = new FCKeditor('".$value['fname']."') ;
- fckEditor.Height=".(($config['height'])?($config['height']):(300)).";
- fckEditor.Width=".(($value['width'])?($value['width']):(800)).";
- fckEditor.SkinPath = '/Plug-in/fck/editor/skins/silver/' ;
- fckEditor.BasePath = '/Plug-in/fck/' ;
- fckEditor.Config['ToolbarStartExpanded'] = ".(($config['zhed'])?("false"):('true')).";
- ".(($config['STR'])?($config['STR']):(""))."
- fckEditor.ReplaceTextarea() ;
- myMask.hide();
- }
- },
- name: '".$value['fname']."'
- }");
- $fckplugin.="try{var fckobj_temp = FCKeditorAPI.GetInstance('".$value['fname']."');
- fckobj_temp.UpdateLinkedField();}catch(err){
- };";
- $plugurl[] = '/Plug-in/fck/fckeditor.js'; // fckEditor.ReplaceTextarea() ;
- break;}
- case 'kindeditor':{
- $yuan = array("</script>", "vegetables", "fiber");
- $tyuan = array("<\/script>", "beer", "ice cream");
-
- $js[] =preg_replace("/[\s]{2,}/","","{
- xtype:\"textarea\",
- id:'".$value['fname']."',
- ".$back."
- value:\"".(grv($value['qzfs'],$value['blm'],str_replace($yuan, $tyuan,adxx(preg_replace("'([\r\n])[\s]+'", "", $fdada[$value['fname']])))))."\",
- ".(($value['width'])?("width:".$value['width'].","):("anchor:'98%',"))."
- ".(($config['height'])?("height:".$config['height'].","):("height:300,"))."
- fieldLabel:'".$value['name']."',
- listeners:{
- render:function(f){
- try{KE.show({id : '".$value['fname']."',
- width :".(($value['width'])?("'".$value['width']."px'"):('70%')).",
- height : ".(($config['height'])?("'".$config['height']."px'"):('300px')).",
- ".(($config['STR'])?($config['STR']):(""))."
- ".(($config['jd'])?("resizeMode : 1,
- allowPreviewEmoticons : false,
- allowUpload : false,
- items : [
- 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
- 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
- 'insertunorderedlist', '|', 'emoticons', 'image', 'link'],"):(""))."
- filterMode : false});}catch(err){
- };
- }
- },
-
- name: '".$value['fname']."'
- }");
- $fckplugin.="KE.util.setData('".$value['fname']."');";
- $plugurl[] = '/Plug-in/kind/kindeditor.js'; // fckEditor.ReplaceTextarea() ;
- break;}
- case 'datefield':{
- if(is_numeric($fdada[$value['fname']])){
- $fdada[$value['fname']]=date($config['zqgs'],$fdada[$value['fname']]);
- }
- $js[] ="{
- xtype: 'datefield',
- ".$back."
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- fieldLabel:'".$value['name']."',
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- ".(($value['width'])?("width:".$value['width'].","):(""))."
- disabledDays :[".@implode(',',$config['pbxq'])."],
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- ".(($config['zwxs'])?("readOnly:'true',"):(""))."
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- ".(($config['zqgs'])?("format:'".$config['zqgs']."',"):(""))."
- name: '".$value['fname']."'
- }";
- if($config['zwxs']==1){$plugjs[] ='Date.dayNames = ["?", "?", "?", "?", "?", "?", "?"];
- if (Ext.DatePicker) {
- Ext.apply(Ext.DatePicker.prototype, {
- todayText: "??",
- minText: "?????????",
- maxText: "?????????",
- disabledDaysText: "",
- disabledDatesText: "",
- monthNames: Date.monthNames,
- dayNames: Date.dayNames,
- nextText: "?? (Control+Right)",
- prevText: "?? (Control+Left)",
- monthYearText: "????? (Control+Up/Down ????)",
- todayTip: "{0} (Spacebar)",
- okText: "??",
- cancelText: "??",
- format: "y?m?d?"
- });
- }';}
- break;}
- case 'swfupload':{
- $js[] ="{
- xtype: '{$value['type']}',
- ".$back."
- name: '{$value['fname']}',
- id: '{$value['fname']}',
- fieldLabel: '{$value['name']}',
- anchor:'99%',
- height: {$config['height']}
- }";
- break;}
- case 'combo':{
- $tempxx = json_decode($value['zyz'],true);
- $config_num = count($tempxx);
- $items='';
- if($config_num != 0){
- foreach($tempxx as $key => $data){
- if($data['ck']=='1'){
- $fdada[$value['fname']]?$fdada[$value['fname']]:$fdada[$value['fname']]=$data['xv'];}
- $items.= "['".$data['xv']."','".$data['yv']."']";
- if($key < $config_num-1){
- $items.= ",";
- }
- }
- }
- $js[] ="{
- ".$back."
- value:\"".(grv($value['qzfs'],$value['blm'],adxx($fdada[$value['fname']])))."\",
- fieldLabel:'".$value['name']."',
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- ".(($value['width'])?("width:".$value['width'].","):(""))."
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- ".(($config['readonly'])?("readOnly:'true',"):(""))."
- typeAhead: true,
- name: '".$value['fname']."_',
- hiddenName : '".$value['fname']."',
- editable: false,xtype: 'combo',
- store:new Ext.data.SimpleStore({
- fields:['name','value'],
- data:[".$items."]}),
- mode:'local',
- displayField:'name',
- selectOnFocus:true,
- valueField :'value',
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- triggerAction:'all'
-
- }";
- break;}
- case 'combo1':{
-
- $js[] ="{
- ".$back."
- value:\"".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['dy'])."\",
- fieldLabel:'".$value['name']."',
- ".(($value['id'])?("id:'".$value['id']."',"):(""))."
- ".(($value['width'])?("width:".$value['width'].","):(""))."
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- ".(($config['readonly'])?("readOnly:'true',"):(""))."
- typeAhead: true,
- emptyText:'".$config['dx']."',
- name: '".$value['fname']."_',
- id: '".$value['fname']."_',
- hiddenName : '".$value['fname']."',
- editable: false,xtype: 'combo',
- store:new Ext.data.Store({
- proxy: new Ext.data.HttpProxy({
- url: '../cascade/getcascade.php?id=".$value['id']."'
- }),
- listeners : {
- load : function(){
-
- if(typeof(chuzai)=='undefined'){
- Ext.getCmp('".$value['fname']."_"."').setValue('".(adxx($fdada[$value['fname']])?adxx($fdada[$value['fname']]):$config['dy'])."');
- chuzai=1;
- }
- }
- } ,
- autoLoad:true,
- reader: new Ext.data.ArrayReader({
- }, [
- {name: '".$config['y']."', mapping: '".$config['y']."'},
- {name: '".$config['x']."', mapping: '".$config['x']."'}
- ])
- }),
- mode:'local',
- displayField:'".$config['x']."',
- selectOnFocus:true,
- valueField :'".$config['y']."',
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- triggerAction:'all'
-
- }";
- break;}
- case 'radiogroup':{
- $tempxx = json_decode($value['zyz'],true);
- $config_num = count($tempxx);
- if($config_num != 0){
- $items='';
- if($_GET['id']!=''){
- foreach($tempxx as $key => $data){
- if($data['yv']==$fdada[$value['fname']]){
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."',checked: true}";}else{
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."'}";}
- if($key < $config_num-1){
- $items.= ",";
- }
- }
- }else{
- foreach($tempxx as $key => $data){
- if($data['ck']=='1'){
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."',checked: true}";}else{
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."',inputValue:'".$data['yv']."'}";}
- if($key < $config_num-1){
- $items.= ",";
- }
- }
- }
- }
- $js[] ="{
- xtype: 'radiogroup',
- ".$back."
- ".(($value['width']&&$value['width']<=$config_num)?("columns:".$value['width'].","):(""))."
- ".(($config['vertical'])?("vertical: true,"):(""))."
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- anchor: '95%',
- items: [".$items."],
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- fieldLabel:'".$value['name']."'
- }";
- break;}
- case 'recommend':{
- $items='';
- if(1==$fdada[$value['fname']]){
- $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'1',checked: true},";
- $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'0'}";
- }else{
- $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'1'},";
- $items.= "{boxLabel:'???',name:'".$value['fname']."',inputValue:'0',checked: true}";
- }
-
- $js[] ="{
- xtype: 'radiogroup',
- ".$back."
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- anchor: '95%',
- items: [".$items."],
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- fieldLabel:'".$value['name']."'
- }";
- break;}
- case 'checkboxgroup':{
- $tempxx = json_decode($value['zyz'],true);
- $config_num = count($tempxx);
- if($config_num != 0){
- $items='';
- if($_GET['id']!=''){
- $xsarray=explode("#_#",$fdada[$value['fname']]);
- foreach($tempxx as $key => $data){
- if(in_array($data['yv'],$xsarray)){
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."',checked: true}";}else{
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."'}";}
- if($key < $config_num-1){
- $items.= ",";
- }
- }
- }else{
- foreach($tempxx as $key => $data){
- if($data['ck']=='1'){
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."',checked: true}";}else{
- $items.= "{boxLabel:'".$data['xv']."',name:'".$value['fname']."[".$key."]',inputValue:'".$data['yv']."'}";}
- if($key < $config_num-1){
- $items.= ",";
- }
- }
- }
- }
- $js[] ="{
- xtype:'checkboxgroup',
- ".$back."
- ".(($value['width']&&$value['width']<=$config_num)?("columns:".$value['width'].","):(""))."
- ".(($config['vertical'])?("vertical: true,"):(""))."
- ".((!$value['yxwk'])?("allowBlank:false,blankText:'".adxx($value['ts'])."',"):(""))."
- anchor: '95%',
- items: [".$items."],
- ".(($config['STR'])?("".$config['STR'].""):(""))."
- fieldLabel:'".$value['name']."'
- }";
- break;}
- default:{
- $js[] ="{
- xtype: 'textfield',
- fieldLabel: '{$value['name']}',
- name: '{$value['fname']}',
- ".$back."
- anchor:'60%'
- }";
- }
- }
- }
- Tr($plugurl,'plugurl');
- Tr($plugjs,'plugjs');
- Tr($fckplugin,'fckplugin');
- Tr($js,'js');
- if($_GET['id']==0){
- Tr('??','action');
- }else{
- Tr('??','action');
- }
- Ts('show1/add.html');
- break;
- }
- case 'save':{
-
- $id = $_POST['id'];
- $tree_id = $_POST['tid'];
- $tree=Dgd(array(
- 'db'=>'d_sevenel',
- 'cd'=>"id = $tree_id",
- 'tn'=>"tree",
- 'limit'=>'1'
- ));
- $tabname = gettabname($tree['table'],'',true);
- $fld=Dgd(array(
- 'db'=>'d_sevenel',
- 'cd'=>"tid = $tree_id",
- 'tn'=>"fld"
- ));
- if(!$id){
- $wyyz='user';
- $wztemp=Dgd(array(
- 'db'=>'d_sevenel',
- 'cd'=>"$wyyz like '".$_POST[$wyyz]."'",
- 'tn'=>$tabname,
- 'limit'=>'1'
- ));
- if($wztemp!=''){
- ext_request_failure('??????');
- exit();
- }
- }
- foreach($fld as $key => $value){
- switch($value['type']){
- case 'datefield':{
- if($value['zy']!=1){
- if(strtotime($_POST[$value['fname']])){
- $save[$value['fname']] = strtotime($_POST[$value['fname']]);
- }else{
- $save[$value['fname']]=$_POST[$value['fname']];
- }
- }else{
- $save[$value['fname']]=$_POST[$value['fname']];
- }
- break;}
- case 'checkboxgroup':{
- $save[$value['fname']]=implode("#_#",$_POST[$value['fname']]);
- break;}
- case 'password';{
- if($value['yxwk']=='1'){
- if($_POST[$value['fname']]==$_POST[$value['fname'].'-cfrm']){
- $save [$value['fname']] = md5($_POST[$value['fname']]);
- }else{
- ext_request_failure('???????');
- exit();
- }
- }else{
- $save [$value['fname']] = md5($_POST[$value['fname']]);
- }
- break;}
- case 'fileup':{
- //print_r($_FILES);exit;
- if($_FILES[$value['fname']]['name']!=''){
- $cp=1;
- //????
- $config=json_decode($value['cfg'],true);
-
-
- $dvalue=array( 0=>array('rar','zip','tar','.tz'),
- 1=>array('jpg','gif','png','bmp'),
- 2=>array('mp3','mp4','avi','wmv','mid','.rm','mvb','mov','wma','wav'),
- 3=>array('doc','xls','txt','ocx','lsx','ppt','pdf','chm'),
- 4=>array('doc','xls','txt','ocx','lsx','ppt','pdf','chm','mp3','mp4','avi','wmv','mid','.rm','mvb','mov','wma','wav','jpg','gif','png','bmp','rar','zip','tar','.tz')
- );
- if(!$_FILES[$value['fname']]['name']){
- $cp=0;
- }
- $otype=substr(strtolower($_FILES[$value['fname']]['name']),-3);
- if(!in_array($otype,$dvalue[$config['type']])){
- $cp=0;
- header("Content-type: text/html; charset: UTF-8");
- echo "{success:true,msg:'%u4E0A%u4F20%u683C%u5F0F%u4E0D%u5141%u8BB8%21%u8BF7%u8054%u7CFB%u7BA1%u5458%21<BR> Upload format is not allowed! Please contact the administrator!'}";
- exit;
- }
- if($_FILES[$value['fname']]['size']/1000>$config['size']){
- $cp=0;
- header("Content-type: text/html; charset: UTF-8");
- echo "{success:true,msg:'%u6587%u4EF6%u5927%u5C0F%u8D85%u8FC7%u9650%u5236%21<br> The file size limit expired!'}";
- exit;
- }
- if($cp){
- $bsname=time();
- $bcname=$bsname.".".$otype;
- $filename="../../uplods/pic/".$bcname;
- $copymes=copy($_FILES[$value['fname']]['tmp_name'],$filename);
- $save[$value['fname']]=$bcname;
- }
- if(in_array($otype,$dvalue[1])){
- if($config['sl1']==1){
- @createthumb($_FILES[$value['fname']]['tmp_name'],".".$otype,$bsname,$config['sl1x'],$config['sl1y'],'1');
- }
- if($config['sl2']==1){
- @createthumb($_FILES[$value['fname']]['tmp_name'],".".$otype,$bsname,$config['sl2x'],$config['sl2y'],'2');
- }
- if($config['sypic']==1){
- $sypicname="../../uplods/sypic/".$bcname;
- $sypicwz="../../uplods/".$config['sytp']."";
- //echo $sypicwz ,$config['sytp'],$config['sywz'];
- @imageWaterMark($filename,$sypicname,$config['sypicwz'],$sypicwz,"",20,'wqy-microhei-lite.ttc',"#00FF00");
- }
- if($config['sytxt']==1){
- $sypicname="../../uplods/sytxt/".$bcname;
- $sypicwz="";
- @imageWaterMark($filename,$sypicname,$config['sytxtwz'],"",$config['sywz'],$config['sywzdx'],$config['syzt'],"#".$config['syys']);
- }
- if($config['sytxt']==1&&$config['sypic']==1){
- $filename="../../uplods/sypic/".$bcname;
- $sypicname="../../uplods/sytp/".$bcname;
- $sypicwz="";
- @imageWaterMark($filename,$sypicname,$config['sytxtwz'],"",$config['sywz'],$config['sywzdx'],$config['syzt'],"#".$config['syys']);
- }
-
- }
- }
- break;}
- default:{
- $save[$value['fname']]=$_POST[$value['fname']];
- }
- }
- }
- $save['tid'] = $tree_id;
- !$_POST['lg']&&$save['lg']='zh';
- $_POST['bdid']&&$save['bdid']=$_POST['bdid'];
- $_POST['bdtid']&&$save['bdtid']=$_POST['bdtid'];
- !$_POST['gid']&&$save['gid']=Mct();
- $save['at']=time();
- //???
- if($id!=0){
- unset($save['psw']);
- if(Du('sevenel',$tabname,$save,'id',$id,1))
-
- ext_request('ok');
- }else{
- if(Di('sevenel',$tabname,$save));
- ext_request('ok');
- }
- break;}
- case 'qkzd':{
- $save[$_POST['zd']]='';
- if(Du('sevenel',$_POST['tname'],$save,'id',$_POST['id'],1))
- ext_request('ok'); break;
- }
- case 'gxzd':{
- $save[$_POST['zd']]=$_POST['xz'];
- if(Du('sevenel',$_POST['tname'],$save,'id',$_POST['id'],1))
- ext_request('ok'); break;
- }
- }
- ?>