<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%
call head()
Call saycarda("图片DIY")

dim tid,id,zc,TP,ids
ID=request.querystring("id")
TP=request.querystring("TP")
ids=request.querystring("ids")
tid=request.querystring("tid")
if TP="" then
if tid="" or IsNumeric(tid)=False then
  Call Error("ID无效！")
  end if
end if
if request.querystring("zc")<>"1" then
path=request.querystring("path")

response.write("<img src='"&path&"' alt="".""/><br/><a href='"&path&"'>下载原图</a><br/>")
dim pic
pic=path
if saytk<>1 then
Response.write "<form name=""form"" method=""post"" action=""diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&""">"
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=""128X128下载""></form><br/>"
else
response.write"<anchor>128X128下载<go href='diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&"' 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
Response.write "<form name=""form"" method=""post"" action=""diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&""">"
response.write "<input type=""hidden"" name=""h"" value=""220""/>"
response.write "<input type=""hidden"" name=""w"" value=""176""/>"
response.write "<input type=""hidden"" name=""pic"" value="""&pic&"""/>"
response.write "<input type=""submit"" name=""Submit"" value=""176X220下载""></form><br/>"
else
response.write"<anchor>176X220下载<go href='diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&"' 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
Response.write "<form name=""form"" method=""post"" action=""diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&""">"
response.write "<input type=""hidden"" name=""h"" value=""320""/>"
response.write "<input type=""hidden"" name=""w"" value=""240""/>"
response.write "<input type=""hidden"" name=""pic"" value="""&pic&"""/>"
response.write "<input type=""submit"" name=""Submit"" value=""240X320下载""></form><br/>"
else
response.write"<anchor>240X320下载<go href='diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&"' 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
if saytk<>1 then
Response.write "<form name=""form"" method=""post"" action=""diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&""">"
end if
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
response.write "<input type=""hidden"" name=""pic"" value="""&pic&"""/>"
response.write "<input type=""submit"" name=""Submit"" value=""自定义下载""></form><br/>"
else
response.write"<anchor>自定义下载<go href='diy.asp?tid="&tid&"&amp;id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;zc=1&amp;TP="&TP&"&amp;saytk="&saytk&"' 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
else
	w=request.form("w")
	h=request.form("h")
	pic=request.form("pic")
	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 photoname,ranNums
randomize
ranNums=int(90000*rnd)+10000
photoname=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNums
		j.save server.mappath("/img/diy/"&photoname&".jpg")
		j.close
		set j=nothing

	response.write("<img src=""/img/diy/"&photoname&".jpg"" alt="".""/><br/><a href=""/img/diy/"&photoname&".jpg"">下载该图</a>")
end if
end if
if TP<>"" then
if id<>"" then
	response.write("<br/><a href=""photoview.asp?id="&id&"&amp;ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">返回相片</a>")
end if
	response.write("<br/><a href=""photo.asp?ids="&ids&"&amp;sid="&sid&"&amp;saytk="&saytk&""">返回相册</a>")
else
	response.write("<br/><a href=""topic.asp?tid="&tid&"&amp;sid="&sid&"&amp;saytk="&saytk&""">返回主帖</a>")
end if
call headsay()%>