<!-- #include file="Inc/Inc.asp" -->
<!-- #include file="Inc/Function.asp" -->

<%Call Head()
Call saycarda("图片DIY")
  Call Error("此功能暂未修复")
conn.close
set conn=nothing
dim id,zc,class1,pa,pic,url,cid
ID=request.querystring("id")
class1=request.querystring("class")
if id="" or IsNumeric(id)=False then
  Call Error("ID无效！")
  end if

if class1="" or IsNumeric(class1)=False then
  Call Error("ID无效！")
  end if

url=request.querystring("url")
pic=request.querystring("pic")
pa=request.querystring("pa")
if pa="" or IsNumeric(pa)=False then pa=1
if request.querystring("zc")<>"1" then

response.write("<img src='"&pic&"' alt="".""/><br/><a href='"&pic&"'>下载原图</a><br/>")
if saytk<>1 then
	Response.write "<form name=""form"" method=""post"" action=""diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1"">"
response.write "<input type=""hidden"" name=""h"" value=""128""/>"
response.write "<input type=""hidden"" name=""w"" value=""128""/>"
response.write "<input type=""hidden"" name=""pic"" value="""&pic&"""/>"
response.write "<input type=""submit"" name=""submit"" value=""128*128下载""/></form><br/>"

	Response.write "<form name=""form"" method=""post"" action=""diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1"">"
	response.write "<input type=""hidden"" name=""h"" value=""176""/>"
response.write "<input type=""hidden"" name=""w"" value=""220""/>"
response.write "<input type=""hidden"" name=""pic"" value="""&pic&"""/>"
response.write "<input type=""submit"" name=""submit"" value=""176*220下载""/></form><br/>"

	Response.write "<form name=""form"" method=""post"" action=""diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1"">"
response.write "<input type=""hidden"" name=""h"" value=""240""/>"
response.write "<input type=""hidden"" name=""w"" value=""320""/>"
response.write "<input type=""hidden"" name=""pic"" value="""&pic&"""/>"
response.write "<input type=""submit"" name=""submit"" value=""240*320下载""/></form><br/>"

	Response.write "<form name=""form"" method=""post"" action=""diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1"">"
response.write"高：<input name='h' maxlength='4' format='*N' value='128'/><br/>宽：<input name='w' maxlength='4' format='*N' value='128'/><br/>"
response.write "<input type=""hidden"" name=""h"" value=""$(h)""/>"
response.write "<input type=""hidden"" name=""w"" value=""$(w)""/>"
response.write "<input type=""hidden"" name=""pic"" value="""&pic&"""/>"
response.write "<input type=""submit"" name=""submit"" value=""自定义下载""/></form><br/>"


else
if saytk>1 then
call xlanlj("diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1")
call xltjlj("h","128")
call xltjlj("w","128")
call xltjlj("pic",""&pic&"")
call xlanlj("128*128下载")
else
response.write"<anchor>128*128下载<go href='diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1' accept-charset='utf-8' method='post'><postfield name='h' value='128'/><postfield name='w' value='128'/><postfield name='pic' value='"&pic&"'/></go></anchor><br/>"
end if
if saytk>1 then
call xlanlj("diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1")
call xltjlj("h","220")
call xltjlj("w","176")
call xltjlj("pic",""&pic&"")
call xlanlj("176*220下载")
else
response.write"<anchor>176*220下载<go href='diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1' accept-charset='utf-8' method='post'><postfield name='h' value='220'/><postfield name='w' value='176'/><postfield name='pic' value='"&pic&"'/></go></anchor><br/>"
end if
if saytk>1 then
call xlanlj("diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1")
call xltjlj("h","320")
call xltjlj("w","240")
call xltjlj("pic",""&pic&"")
call xlanlj("240*320下载")
else
response.write"<anchor>240*320下载<go href='diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&sid&"&amp;zc=1' accept-charset='utf-8' method='post'><postfield name='h' value='320'/><postfield name='w' value='240'/><postfield name='pic' value='"&pic&"'/></go></anchor><br/>"
end if
call xlanlj("diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&=sid&"&amp;zc=1")
response.write"高：<input name='h' maxlength='4' format='*N' value='128'/><br/>宽：<input name='w' maxlength='4' format='*N' value='128'/><br/>"
if saytk>1 then
call xltjlj("pic",""&pic&"")
call xlanlj1("自定义下载")
else
response.Write"<anchor>自定义下载<go href'diy.asp?id="&id&"&amp;cid="&cid&"&amp;class="&class1&"&amp;url="&url&"&amp;sid="&=sid&"&amp;zc=1' accept-charset='utf-8' method='post'><postfield name='h' value='$(h)'/><postfield name='w' value='$(w)'/><postfield name='pic' value='"&pic&"'/></go></anchor>"
end if
end if
else
	w=request.form("w")
	h=request.form("h")
	pic=request.form("pic")
        if len(pic)<5 then
  Call Error("图片地址无效！")
  end if
	tid=request.Querystring("tid")


	if w<>"" and h<>"" and isnumeric(w)=true and isnumeric(h)=true then
		set j=server.createobject("persits.jpeg")
		j.open server.mappath(""&pic&"")
		j.width=w
		j.height=h

dim filename,ranNum
randomize
ranNum=int(90000*rnd)+10000
filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum

'On Error Resume Next
		j.Save Server.MapPath("/img/diy/"&filename&".jpg")
					Set j = Nothing
If Err Then
		err.Clear
		Set Conn = Nothing
response.write"图片文件没有合成<br/>"
response.write"生成文件时出错<br/>"
response.write"/img/diy/"&filename&".jpg<br/>"
response.write"文件夹没有写入权限"

		Call headsay()
		Response.End
	End If

	response.write("<img src=""/Picview/"&filename&".jpg"" alt="".""/><br/><a href=""/Picview/"&filename&".jpg"">下载该图</a><br/>")
	
%><a href="diy.asp?id=<%=id%>&amp;class=<%=class1%>&amp;cid=<%=cid%>&amp;pa=<%=pa%>&amp;pic=<%=pic%>&amp;url=<%=url%>&amp;sid=<%=sid%>">返回继续DIY</a>
<%else
	response.write("请填写完整再进行DIY")
end if
end if
%>
<br/><a href="picview.asp?id=<%=id%>&amp;class=<%=class1%>&amp;cid=<%=cid%>&amp;pa=<%=pa%>&amp;sid=<%=sid%>">返回查看图片</a><br/>---------<br/>
<!-- #include file="fanhui.asp" -->
<%Call headsay()%>
