SetVar($imgsrc,"file");if($width>$bw){$cm->BackFill($imgsrc,$bw,$bgv);} imageWaterMark($imgsrc,websypos,"../img/shuiyin.png","","","","",0,0); if($sw>$width){$sw=$width;}if($sh>$height){$sh=$height;} if(empty($rowcontrol[picys])){$cm->Cut("../".$targetFolder.$mbh."-1.jpg",$sw,$sh);}else{$cm->BackFill("../".$targetFolder.$mbh."-1.jpg",$sw,$sh);} if($zw>$width){$zw=$width;}if($zh>$height){$zh=$height;} if(empty($rowcontrol[picys])){$cm->Cut("../".$targetFolder.$mbh."-2.jpg",$zw,$zh);}else{$cm->BackFill("../".$targetFolder.$mbh."-2.jpg",$zw,$zh);} $wjv=$targetFolder.$mbh.".jpg"; $nxh=returnxh("yjcode_tp"," and bh='".$bh."'"); //OSSB if(check_in("a2a",$rowcontrol[aliosskg])){ if(!is_null($ossClient)){; $ossClient->setTimeout(3600); $ossClient->setConnectTimeout(3600); $ossClient->createObjectDir($bucket, $targetFolder); $ossClient->uploadFile($bucket,$targetFolder.$mbh.".jpg",$targetFile); $ossClient->uploadFile($bucket,$targetFolder.$mbh."-1.jpg","../".$targetFolder.$mbh."-1.jpg"); $ossClient->uploadFile($bucket,$targetFolder.$mbh."-2.jpg","../".$targetFolder.$mbh."-2.jpg"); delFile($targetFile); delFile("../".$targetFolder.$mbh."-1.jpg"); delFile("../".$targetFolder.$mbh."-2.jpg"); $alioss=preg_split("/,/",$rowcontrol[alioss]); $wjv="https://".$alioss[3].".".$alioss[2]."/".$targetFolder.$mbh.".jpg"; } } //OSSE intotable("yjcode_tp","bh,tp,type1,sj,userid,xh,upty","'".$bh."','".$wjv."','商品','".$sj."',".$userid.",".$nxh.",".intval($upty).""); } } } }elseif($admin==2){ //评价B while1("*","yjcode_order where orderbh='".$bh."' and userid=".$userid);if(!$row1=mysql_fetch_array($res1)){Audit_alert("登录超时","../reg/","parent.");} $targetFolder = "upload/".$userid."/".$bh."/"; createDir("../".$targetFolder); $total = count($_FILES['inp1']['tmp_name']); for($k=0; $k<$total; $k++) { if(returncount("yjcode_tp where bh='".$bh."'")<7){ if(is_uploaded_file($_FILES['inp1']['tmp_name'][$k])){ $sj=date("Y-m-d H:i:s"); $mbh=str_replace(" ","",microtime()."tp".$userid); $mbh=str_replace(".","",$mbh); $targetFile = "../".$targetFolder.$mbh.".jpg"; move_uploaded_file($_FILES['inp1']['tmp_name'][$k],$targetFile); $cm=new CreatMiniature(); $bw=800;$bg=0;$sw=350;$sh=350; $imgsrc="../".$targetFolder.$mbh.".jpg"; list($width, $height) = getimagesize(weburl.$targetFolder.$mbh.".jpg");$bgv=intval($height/($width/$bw)); $cm->SetVar($imgsrc,"file");if($width>$bw){$cm->BackFill($imgsrc,$bw,$bgv);} imageWaterMark($imgsrc,websypos,"../img/shuiyin.png","","","","",0,0); if($sw>$width){$sw=$width;}if($sh>$height){$sh=$height;} $cm->Cut("../".$targetFolder.$mbh."-1.jpg",$sw,$sh); $wjv=$targetFolder.$mbh.".jpg"; $nxh=returnxh("yjcode_tp"," and bh='".$bh."'"); intotable("yjcode_tp","bh,tp,type1,sj,userid,xh","'".$bh."','".$wjv."','评价','".$sj."',".$userid.",".$nxh.""); } } } }elseif($admin==6){ //资讯 while1("*","yjcode_news where bh='".$bh."' and userid=".$userid);if(!$row1=mysql_fetch_array($res1)){Audit_alert("登录超时","../reg/","parent.");} createDir("../upload/news/".dateYMDN($row1[sj])."/"); $targetFolder="upload/news/".dateYMDN($row1[sj])."/".$bh."/"; createDir("../".$targetFolder); $total = count($_FILES['inp1']['tmp_name']); for($k=0; $k<$total; $k++) { if(returncount("yjcode_tp where bh='".$bh."'")<7){ if(is_uploaded_file($_FILES['inp1']['tmp_name'][$k])){ $sj=date("Y-m-d H:i:s"); $mbh=str_replace(" ","",microtime()."tp".$userid); $mbh=str_replace(".","",$mbh); $targetFile = "../".$targetFolder.$mbh.".jpg"; move_uploaded_file($_FILES['inp1']['tmp_name'][$k],$targetFile); $cm=new CreatMiniature(); $bw=600;$bg=500;$sw=200;$sh=160; $imgsrc="../".$targetFolder.$mbh.".jpg"; list($width, $height) = getimagesize(weburl.$targetFolder.$mbh.".jpg");$bgv=intval($height/($width/$bw)); $cm->SetVar($imgsrc,"file");if($width>$bw){$cm->BackFill($imgsrc,$bw,$bgv);} imageWaterMark($imgsrc,websypos,"../img/shuiyin.png","","","","",0,0); if($sw>$width){$sw=$width;}if($sh>$height){$sh=$height;} $cm->Cut("../".$targetFolder.$mbh."-1.jpg",$sw,$sh); $wjv=$targetFolder.$mbh.".jpg"; $nxh=returnxh("yjcode_tp"," and bh='".$bh."'"); intotable("yjcode_tp","bh,tp,type1,sj,userid,xh","'".$bh."','".$wjv."','资讯','".$sj."',".$userid.",".$nxh.""); } } } }elseif($admin==7){ //服务 $targetFolder = "upload/".$userid."/".$bh."/"; createDir("../".$targetFolder); $total = count($_FILES['inp1']['tmp_name']); for($k=0; $k<$total; $k++) { if(returncount("yjcode_tp where bh='".$bh."'")<7){ if(is_uploaded_file($_FILES['inp1']['tmp_name'][$k])){ $sj=date("Y-m-d H:i:s"); $mbh=str_replace(" ","",microtime()."tp".$userid); $mbh=str_replace(".","",$mbh); $targetFile = "../".$targetFolder.$mbh.".jpg"; move_uploaded_file($_FILES['inp1']['tmp_name'][$k],$targetFile); $cm=new CreatMiniature(); $bw=800;$bg=0;$sw=300;$sh=200; $imgsrc="../".$targetFolder.$mbh.".jpg"; list($width, $height) = getimagesize(weburl.$targetFolder.$mbh.".jpg");$bgv=intval($height/($width/$bw)); $cm->SetVar($imgsrc,"file");if($width>$bw){$cm->BackFill($imgsrc,$bw,$bgv);} imageWaterMark($imgsrc,websypos,"../img/shuiyin.png","","","","",0,0); if($sw>$width){$sw=$width;}if($sh>$height){$sh=$height;} if(empty($rowcontrol[picys])){$cm->Cut("../".$targetFolder.$mbh."-1.jpg",$sw,$sh);}else{$cm->BackFill("../".$targetFolder.$mbh."-1.jpg",$sw,$sh);} $wjv=$targetFolder.$mbh.".jpg"; $nxh=returnxh("yjcode_tp"," and bh='".$bh."'"); intotable("yjcode_tp","bh,tp,type1,sj,userid,xh,upty","'".$bh."','".$wjv."','服务','".$sj."',".$userid.",".$nxh.",".intval($upty).""); } } } }elseif($admin==8){ //服务评价B while1("*","yjcode_serverorder where orderbh='".$bh."' and userid=".$userid);if(!$row1=mysql_fetch_array($res1)){Audit_alert("登录超时","../reg/","parent.");} $targetFolder = "upload/".$userid."/".$bh."/"; createDir("../".$targetFolder); $total = count($_FILES['inp1']['tmp_name']); for($k=0; $k<$total; $k++) { if(returncount("yjcode_tp where bh='".$bh."'")<7){ if(is_uploaded_file($_FILES['inp1']['tmp_name'][$k])){ $sj=date("Y-m-d H:i:s"); $mbh=str_replace(" ","",microtime()."tp".$userid); $mbh=str_replace(".","",$mbh); $targetFile = "../".$targetFolder.$mbh.".jpg"; move_uploaded_file($_FILES['inp1']['tmp_name'][$k],$targetFile); $cm=new CreatMiniature(); $bw=800;$bg=0;$sw=350;$sh=350; $imgsrc="../".$targetFolder.$mbh.".jpg"; list($width, $height) = getimagesize(weburl.$targetFolder.$mbh.".jpg");$bgv=intval($height/($width/$bw)); $cm->SetVar($imgsrc,"file");if($width>$bw){$cm->BackFill($imgsrc,$bw,$bgv);} imageWaterMark($imgsrc,websypos,"../img/shuiyin.png","","","","",0,0); if($sw>$width){$sw=$width;}if($sh>$height){$sh=$height;} $cm->Cut("../".$targetFolder.$mbh."-1.jpg",$sw,$sh); $wjv=$targetFolder.$mbh.".jpg"; $nxh=returnxh("yjcode_tp"," and bh='".$bh."'"); intotable("yjcode_tp","bh,tp,type1,sj,userid,xh","'".$bh."','".$wjv."','服务评价','".$sj."',".$userid.",".$nxh.""); } } } } php_toheader("tpupload.php?bh=".$bh."&admin=".$admin."&t=suc"); } ?> 图片上传
选择图片上传