%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim king
set king=new kingcms
king_down
king_url
set king=nothing
'url *** *** www.KingCMS.com *** ***
sub king_url()
dim gourl:gourl=l1ll("url",0)
dim query_string:query_string=request.servervariables("query_string")
if len(gourl)>0 then
if instr(query_string,"?")>0 then
gourl=right(query_string,len(query_string)-4)
end if
Il""
end if
end sub
'down *** *** www.KingCMS.com *** ***
sub king_down()
dim topicid,boardid,downpath,rs,filename,stream
topicid=l1ll("topicid",2):boardid=l1ll("boardid",2)
if cstr(topicid)="" and cstr(boardid)="" then exit sub
king.head 0,0
king_check
if cstr(topicid)<>"" then
set rs=conn.execute("select bbsimg,bbsdate from kingtopic where topicid="&topicid&" and topicdel=0;")
if not rs.eof and not rs.bof then
if ll11("jpeg,jpg,gif,png,bmp",lIl(rs(0))) then
downpath="../"&king_upath&"/image/"&III11(rs(1))&"/"&rs(0)
else
downpath="../"&king_upath&"/"&king_dpath&"/"&III11(rs(1))&"/"&rs(0)
end if
conn.execute "update kingtopic set downhit=downhit+1 where topicid="&topicid&";"
filename=rs(0)
else
king.error("system/error")
end if
set rs=nothing
end if
if cstr(boardid)<>"" then
set rs=conn.execute("select bbsimg,bbsdate from kingboard where boardid="&boardid&" and boarddel=0;")
if not rs.eof and not rs.bof then
if ll11("jpeg,jpg,gif,png,bmp",lIl(rs(0))) then
downpath="../"&king_upath&"/image/"&III11(rs(1))&"/"&rs(0)
else
downpath="../"&king_upath&"/"&king_dpath&"/"&III11(rs(1))&"/"&rs(0)
end if
topicid=conn.execute("select topicid from kingboard where boardid="&boardid&";")(0)
conn.execute "update kingboard set downhit=downhit+1 where boardid="&boardid&";"
filename=rs(0)
else
king.error("system/error")
end if
set rs=nothing
end if
if cstr(downpath)<>"" then
if king.id=0 then king.error("login/level")
if lllll(downpath) then
if king.ispath=false then
king.bound
conn.execute "update kinguser set usermark=usermark+"&mark_down&",userprestige=userprestige+"&prestige_down&" where userid="&king.id&";"
end if
response.contenttype = "application/ms-download"
response.addheader "content-disposition","attachment;filename="&filename
set stream = server.createobject("adodb.stream")
stream.type = 1
stream.open
stream.loadfromfile server.mappath(downpath)
while not stream.eos
response.binarywrite stream.read(1024*64)
wend
stream.close
set stream = nothing
king_sub10_page topicid,0
response.flush
else
Il""
Il king.lang("sub7/tip/nofile")
end if
response.end
end if
end sub
'check *** *** www.KingCMS.com *** ***
sub king_check()
dim urlfrom,urlserver
urlfrom = cstr(request.servervariables("http_referer"))
urlserver = cstr(request.servervariables("server_name"))
if mid(urlfrom,8,len(urlserver)) <> urlserver then
king.error("system/error/down|url:"&I11II(""&urlserver&""))
end if
' if request.cookies("logined")="" then
' response.redirect "/login.asp" '需要登陆!
' end if
end sub
'outhtm *** *** www.KingCMS.com *** ***
sub king_outhtm()
Il ol
end sub
%>