fetch1("select qaddtran,qaddtransize,qaddtranimgtype,qaddtranfile,qaddtranfilesize,qaddtranfiletype from {$dbtbpre}enewspublic limit 1"); $r=DoTranFile($file,$file_name,$file_type,$file_size,$classid); if($small=='true'){ $path=substr($r[yname],0,strripos($r[yname],'/')); $filetype=GetFiletype($r[filename]); $insertfile=substr($r[filename],0,strlen($r[filename])-strlen($filetype)).time(); $name=$path."/small".$insertfile; GetMySmallImg($classid,$r[no].'small'.$insertfile,$insertfile,$r[filepath],$r[yname],$small_width,$small_height,$name,$filepass,$filepass,$userid,$username,0,1); echo '"small":"/'.substr($name,strripos($name,'\\')+1).$filetype.'",'; } //写入数据库 $filetime=date("Y-m-d H:i:s"); $r[filesize]=(int)$r[filesize]; $classid=(int)$classid; $sql=$empire->query("insert into {$dbtbpre}enewsfile_1(filename,filesize,adduser,path,filetime,classid,no,type,id,cjid,fpath) values('$r[filename]','$r[filesize]','$username','$r[filepath]','$filetime','$classid','$r[filename]','$type','$filepass','$filepass','$public_r[fpath]');"); //编辑器 if($ecms==1) { $groundImage='../../..'.$r[url]; global $public_r; if(!empty($groundImage)&&$water=='true') { imageWaterMark($groundImage,$public_r['markpos'],$public_r['markimg'],$public_r['marktext'],$public_r['markfontsize'],$public_r['markfontcolor'],$public_r['markfont'],$public_r['markpct'],$public_r['jpgquality']); } echo '"big":"'.$r[url].'",'; echo '"name":"'.$file_name.'",'; } else { //上传错误 echo '"error":1,'; } echo '"temp":0}'; db_close(); $empire=null; exit(); } ?>