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

<%Call Head()
dim sql,rs1,sql1,id
id=request.QueryString("id")
if id="" or IsNumeric(id)=False then
  Call Error("<card title=""ID无效""><p>ID无效！")
  end if
dim ids,pa,cid,picw,pich
ids=request.QueryString("class")
if ids="" or IsNumeric(ids)=False then
  Call Error("<card title=""ID无效""><p>ID无效！")
  end if
pa=request.QueryString("pa")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * from wjfile where ID="&id
rs.open sql,conn,1,3
if rs.eof then
  rs.close
  set rs=Nothing
  Call Error("<card title=""ID无效""><p>ID无效！")
  end if
dim Counts
Counts=rs("filepin")


Call saycardd(""&ubb1(rs("name"))&"")






'-------A登录信息
if myid=0 then
Response.write "欢迎您:<a href='login.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"'>登陆/注册</a><br/>----------<br/>"& chr(13)
else

'检查有几条新留言
dim newguest
newguest = 0
IF myid > 0 THEN
  newguest = ForNewGuest(myid)
END IF
if newguest > 0 then
Response.write "<a href='bbs/msgview.asp?url="&Replace(Replace(R_url(),"sid=","sidoo="),"sid=","sidoo=")&"&amp;sid="&sid&"'>您有"&newguest&"条新消息</a><br/>"& chr(13)
end if
end if
'---------------------------
If Not rs.eof	Then
rs("hit")=rs("hit")+1
rs.update()
end if
Response.Write	""&ubb(rs("name"))&"<br/>"
Response.Write	"来源:"&ubb(rs("laiy"))&"<br/>"
Response.Write	"日期:"&ubb(fordate(rs("times")))&"<br/>"
Response.Write	"人气:"&ubb(rs("hit"))&"<br/>"
if myid<>0 then
mz="[url=/bbs/uinfo.asp?id="&myid&"&amp;sid=[sid]]"&myni&"[/url]"
else
mz="游客"
end if
conn.execute("insert into sqdt(shijian,dz)values('"&now&"','"&mz&"浏览了图片(url=/picview.asp?id="&id&"&class="&ids&"&amp;sid=[sid])"&ubb(rs("name"))&"(/url)')")
set Rs=Server.CreateObject("ADODB.Recordset")
Sql="select ID,picurl,format,YD_size from [uppic] where lid="&id&" order by id desc"
rs.open Sql,conn,1,1
If Not rs.eof	Then
Dim PageSize,i
	PageSize=picviewnum				
	Dim Count,page,pagecount,gopage,act	
	gopage="picview.asp?id="&id&"&amp;class="&ids&"&amp;pa=" & pa & "&amp;sid="&sid&"&amp;"
	Count=rs.recordcount
	page=int(request.QueryString ("page"))
	if page<=0 or page="" then page=1    
	pagecount=(count+pagesize-1)\pagesize
        if page>pagecount then page=pagecount	
	rs.move(pagesize*(page-1))
        response.write ("共:"&count&"张图片<br/>")
	For i=1 To PageSize       						
	If rs.eof Then Exit For	
			
Response.write "<img src="""&rs("picurl")&""" alt='图SayTK.COM'/><br/>" 
response.write"<a href='"&rs("picurl")&"'>免费下载</a> "
dim picc
picc=replace(rs("picurl"),"http://"&request.ServerVariables("Server_NAME")&"","")
response.write"<a href='diy.asp?id="&id&"&amp;class="&ids&"&amp;cid="&cid&"&amp;pa=" & pa & "&amp;url=picview.asp&amp;pic="&picc&"&amp;sid="&sid&"'>编辑</a><br/>"
	rs.moveNext 								
	Next	
	if page-pagecount<0 then response.write "<br/><a href="""&gopage&"page="&page+1&""">下页-</a><a href="""&gopage&"page="&pagecount&""">尾页</a>"
	if page>1 then response.write "<a href="""&gopage&"page="&page-1&""">上页-</a><a href="""&gopage&"page=1"">首页</a>"
	if pagecount>1 then response.write "<br/><b>"&page&"</b>/"&pagecount&"页<input name=""page"" format=""*N"" value="""&page&""" type=""text"" maxlength=""5"" emptyok=""true"" size=""3""/><a href="""&gopage&"page=$(page)"">[GO]</a><br/>"
Else
Response.write "无此图片！<br/>"
end if
rs.close
set rs=nothing
set rs1=server.createobject("adodb.recordset")
sql="select top 1 ID,name,lid,idd from wjfiLE where lid="&ids&" and id<"&id&" order by id desc"
rs1.open sql,conn,1,1
if rs1.recordcount>0 then
%>
<a href="picview.asp?id=<%=rs1("id")%>&amp;class=<%=rs1("lid")%>&amp;cid=<%=rs1("idd")%>&amp;pa=<%=pa%>&amp;sid=<%=sid%>">&gt;&gt;<%=ubb(rs1("name"))%></a><br/>
<%
end if
rs1.close
set rs1=nothing
set rs2=server.createobject("adodb.recordset")
sql="select top 1 ID,name,lid,idd from wjfile where lid="&ids&" and id>"&id&" order by id asc"
rs2.open sql,conn,1,1
if rs2.recordcount>0 then
%>
<a href="picview.asp?id=<%=rs2("id")%>&amp;class=<%=rs2("lid")%>&amp;cid=<%=rs2("idd")%>&amp;pa=<%=pa%>&amp;sid=<%=sid%>">&lt;&lt;<%=ubb(rs2("name"))%></a><br/>
<%end if
rs2.close
set rs2=nothing
'-------------------
'随机广告开始
if adsetkf("ads5")=1 then
call adstr(5)
response.write"<br/>"&chr(13)
end if
'-------------------
%>
~~~~~~~<br/><a href='palist.asp?id=<%=id%>&amp;class=<%=ids%>&amp;pa=<%=pa%>&amp;TP=1&amp;sid=<%=sid%>'>发表评论(<%=Counts%>)条</a><br/>
<a href='getbook.asp?id=<%=id%>&amp;class=<%=ids%>&amp;pa=<%=pa%>&amp;url=/picview.asp-w-id-d-<%=id%>-a-class-d-<%=ids%>&amp;sid=<%=sid%>'>加入收藏</a><br/>
<%conn.close   
set conn=nothing%>
----------<br/>
<%if pa<>"" then%>
<a href='piclist.asp?class=<%=ids%>&amp;pa=<%=pa%>&amp;sid=<%=sid%>'>返回列表</a><br/>
<%end if%>
<a href='piclist.asp?cid=<%=cid%>&amp;class=<%=ids%>&amp;sid=<%=sid%>'>返回上级</a><br/>
<!--#include file="fanhui.asp"-->
<%call headsay()%>     