%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim king,action:action=request("action")
set king=new kingcms
king.head 0,0
select case action
case"topic","board" king_def()
case"refresh" king_refresh()'生成
'总置顶·置顶·精华·锁定·删除·移动·提升
case"up1","up2","down1","down2" king_up()'总置顶,置顶
case"best","nobest","lock","unlock","up" king_set()'精华,锁定,提升
case"move" king_move()'移动
case"del" king_del()
case"revert" king_revert()'恢复
case"vote" king_vote()
case"delfile" king_delfile()
case else king.error("system/error")
end select
king_outhtm
set king=nothing
'def *** *** www.KingCMS.com *** ***
sub king_def()
Server.ScriptTimeOut=600
'建立上传对象
king.range 1,0
dim selected,checked,i,rs,sql,data,dataform
dim menuid:menuid=l1ll("menuid",2):if cstr(menuid)="" then menuid=llll("menuid")
dim retopic:retopic=l1ll("retopic",2):if cstr(retopic)="" then retopic=llll("retopic")
dim topicid:topicid=l1ll("topicid",2):if cstr(topicid)="" then topicid=llll("topicid")
dim boardid:boardid=l1ll("boardid",2):if cstr(boardid)="" then boardid=llll("boardid")
dim quotetopic:quotetopic=l1ll("quotetopic",2)
dim quoteboard:quoteboard=l1ll("quoteboard",2)
dim votetype,votecontent,invote,voteend
voteend=llll("voteend"):if II11(voteend,2)=false then voteend=30
votetype=llll("votetype"):if II11(votetype,2)=false then votetype="1"
votecontent=llll("votecontent")
dim vote:vote=l1ll("vote",3):if cstr(vote)="" then vote=llll("vote")
dim datamenu',datainfo'栏目专属性和bbs信息
dim vote_i,votecheck,arrvote
dim sqltopic,sqlboard
sqltopic="bbstitle,bbscontent,bbsimg,topicdel,bbsdate,isface,isubb,issign,menuid,topicicon,topictype,topiclock"'11
sqlboard="bbstitle,bbscontent,bbsimg,boarddel,bbsdate,isface,isubb,issign,topicid"'8
'action的值来判断是否为主题贴或跟贴
if llll(l1l(left(ll11l("111"),16)))=l1l(ll11l("111")) then'submit
select case action
case"topic"
if cstr(topicid)="" then
kingtitle=king.lang("bbs/action/add")'"添加主题贴"
else
kingtitle=king.lang("bbs/action/edt")'"编辑主题贴"
end if
dataform=split(sqltopic,",")
redim data(ubound(dataform),0)
for i=0 to ubound(dataform)
data(i,0)=llll(dataform(i))
next
case"board"
if cstr(boardid)="" then
kingtitle=king.lang("bbs/action/re")'"回复主题贴"
topicid=retopic
else
kingtitle=king.lang("bbs/action/reedt")'"编辑回复贴"
end if
dataform=split(sqlboard,",")
redim data(ubound(dataform),0)
for i=0 to ubound(dataform)
data(i,0)=llll(dataform(i))
next
if cstr(data(4,0))="" then data(4,0)=tnow
' out data(4,0)
end select
else'初始数据
select case action
case"topic"
if cstr(topicid)="" then'第一次发帖
kingtitle=king.lang("bbs/action/add")'"添加主题贴"
dataform=split(sqltopic,",")
redim data(ubound(dataform),0)
data(9,0)=0
data(4,0)=tnow
data(5,0)="1"
data(6,0)="1"
data(7,0)="1"
else
kingtitle=king.lang("bbs/action/edt")'"编辑主题贴"
if II11(topicid,2)=false then king.error("system/error")
set rs=conn.execute("select "&sqltopic&" from kingtopic where topicid="&topicid&" and topicdel=0;")
if not rs.eof and not rs.bof then
data=rs.getrows()
menuid=data(8,0)
else
king.error("system/error")
end if
set rs=nothing
end if
case"board"
if cstr(boardid)="" then
kingtitle=king.lang("bbs/action/re")'"回复主题贴"
' if cstr(retopic)="" then king.error("system/error")
if II11(retopic,2)=false then king.error("system/error")
set rs=conn.execute("select menuid,bbstitle,topiclock from kingtopic where topicid="&retopic&" and topicdel=0;")
if not rs.eof and not rs.bof then
menuid=rs(0)
dataform=split(sqltopic,",")
redim data(ubound(dataform),0)
data(0,0)="Re: "&rs(1)
data(4,0)=tnow
data(5,0)="1"
data(6,0)="1"
data(7,0)="1"
else
king.error("system/error")
end if
set rs=nothing
'QUOTE 引用
if II11(quotetopic,2) then
set rs=conn.execute("select bbscontent,username,bbsdate from kingtopic where topicid=""etopic&" and topicdel=0;")
if not rs.eof and not rs.bof then
data(1,0)=lIIIII("[QUOTE][H6]"&king.lang("common/quote")&"("&rs(1)&" @ "&rs(2)&")[/H6]"&rs(0)&"[/QUOTE]"&vbcr)
else
king.error("system/error")
end if
set rs=nothing
end if
if II11(quoteboard,2) then
set rs=conn.execute("select bbscontent,userid,bbsdate,bbstitle from kingboard where boardid=""eboard&" and boarddel=0;")
if not rs.eof and not rs.bof then
dim username:username=conn.execute("select username from kinguser where userid="&rs(1)&";")(0)
data(1,0)=lIIIII("[QUOTE][H6]"&king.lang("common/quote")&"("&username&" @ "&rs(2)&")[/H6]"&rs(0)&"[/QUOTE]"&vbcr)
data(0,0)="Re: "&rs(3)
else
king.error("system/error")
end if
set rs=nothing
end if
else
kingtitle=king.lang("bbs/action/edt")'"编辑回复贴"
if II11(boardid,2)=false then king.error("system/error")
set rs=conn.execute("select "&sqlboard&" from kingboard where boardid="&boardid&" and boarddel=0;")
if not rs.eof and not rs.bof then
data=rs.getrows()
else
king.error("system/error")
end if
set rs=nothing
set rs=conn.execute("select menuid from kingtopic where topicid="&data(8,0)&" and topicdel=0;")
if not rs.eof and not rs.bof then
menuid=rs(0)
retopic=data(8,0)
else
king.error("system/error")
end if
set rs=nothing
end if
end select
end if
'栏目独有的属性
' if II11(menuid,2)=false then king.error("system/error")
set rs=conn.execute("select bbstopictype,isupload,uploadfiletype,uploadsize,menupath,menuname,bbsmaster,maxcontent,bbstype from kingmenu where menuid="&menuid&" and classid=10;")'8
if not rs.eof and not rs.bof then
datamenu=rs.getrows()
else
king.error("system/error")
end if
set rs=nothing
kingguide=king.guide(menuid)&kingtitle
'主题及回复帖子的编辑权限验证
if II11(topicid,2) and action="topic" then
set rs=conn.execute("select username,topiclock from kingtopic where topicid="&topicid&" and topicdel=0;")
if not rs.eof and not rs.bof then
if cstr(rs(1))="1" then'帖子被锁定以后,只有管理员和当前版面的版主可以编辑
king.range 3,datamenu(6,0)
else
king.range 3,datamenu(6,0)&","&rs(0)
end if
else
king.error("system/error")
end if
set rs=nothing
end if
if II11(boardid,2) and action="board" then
set rs=conn.execute("select username from kingboard where boardid="&boardid&" and boarddel=0;")
if not rs.eof and not rs.bof then
king.range 3,datamenu(6,0)&","&rs(0)
else
king.error("system/error")
end if
set rs=nothing
end if
'锁定贴的编辑权限验证
if action="board" and II11(retopic,2) then
set rs=conn.execute("select topiclock from kingtopic where topicid="&retopic&";")
if not rs.eof and not rs.bof then
if cstr(rs(0))="1" then'帖子被锁定
king.range 3,datamenu(6,0)
end if
else
king.error("system/error")
end if
set rs=nothing
end if
data(2,0)=king.upfile("upimg",data(2,0),data(4,0),datamenu(2,0),datamenu(3,0))
ol="
"
'save
if llll(l1l(left(ll11l("111"),16)))=l1l(ll11l("111")) and king.checkerr then
'发帖时间限制及积分/威望 限制
king.bound
dim bbsimg:bbsimg=data(2,0)
for i=0 to ubound(data)
data(i,0)=lll(dataform(i))
next
data(0,0)=king.dirty(data(0,0))
data(1,0)=king.dirty(data(1,0))
data(2,0)=bbsimg
if cstr(data(5,0))="" then data(5,0)="0"
if cstr(data(6,0))="" then data(6,0)="0"
if cstr(data(7,0))="" then data(7,0)="0"
dim useragent:useragent=lll1(king.lefte(request.ServerVariables("http_user_agent"),225))
select case action
case"topic"
if cstr(topicid)="" then
'投票判断
dim isvote,votetext
if cstr(vote)="on" then isvote=1 else isvote=0
invote=king.dirty(invote)
conn.execute "insert into kingtopic (bbstitle,bbscontent,bbsimg,bbsdate,sysdate,lastpostdate,lastpostuser,isface,isubb,issign,menuid,topicicon,topictype,userid,username,useragent,userip, isvote,votetext,votetype,voteend) values ('"&data(0,0)&"','"&data(1,0)&"','"&data(2,0)&"','"&data(4,0)&"','"&tnow&"','"&tnow&"','"&king.name&"',"&data(5,0)&","&data(6,0)&","&data(7,0)&","&menuid&","&data(9,0)&",'"&data(10,0)&"',"&king.id&",'"&king.name&"','"&useragent&"','"&king.ip&"' ,"&isvote&",'"&invote&"',"&votetype&",'"&dateadd("d",voteend,tnow)&"')"
'设置积分
conn.execute "update kinguser set counttopic=counttopic+1,usermark=usermark+"&mark_topic&",userprestige=userprestige+"&prestige_topic&",lastpostdate='"&tnow&"' where userid="&king.id&";"
'获得topicid
set rs=server.createobject("adodb.recordset")
rs.open ("select top 1 topicid from kingtopic order by topicid desc"),conn
dim rs_topicid
set rs_topicid=rs(0)
topicid=rs_topicid
set rs=nothing
conn.execute "update kingmenu set menucount=menucount+1 where menuid="&menuid&";"
else
' if (cstr(topicid)<>"" and action="topic") or (cstr(boardid)<>"" and action="board") then king.range 3,datamenu(6,0)&","&data(8,0)
conn.execute "update kingtopic set bbstitle='"&data(0,0)&"',bbscontent='"&data(1,0)&"',bbsimg='"&data(2,0)&"',isface="&data(5,0)&",isubb="&data(6,0)&",issign="&data(7,0)&", topicicon="&data(9,0)&",topictype='"&data(10,0)&"',lastusername='"&king.name&"',lastdate='"&tnow&"' where topicid="&topicid&";"
'更新最后发帖时间
conn.execute "update kinguser set lastpostdate='"&tnow&"' where userid="&king.id&";"
end if
case"board"
if cstr(boardid)="" then
if cstr(data(4,0))="" then data(4,0)=tnow
conn.execute "insert into kingboard (bbstitle,bbscontent,bbsimg,bbsdate,sysdate,isface,isubb,issign,topicid,userid,username,useragent,userip) values ('"&data(0,0)&"','"&data(1,0)&"','"&data(2,0)&"','"&data(4,0)&"','"&tnow&"',"&data(5,0)&","&data(6,0)&","&data(7,0)&","&topicid&","&king.id&",'"&king.name&"','"&useragent&"','"&king.ip&"');"
'设置积分
conn.execute "update kinguser set counttopic=counttopic+1,usermark=usermark+"&mark_board&",userprestige=userprestige+"&prestige_board&",lastpostdate='"&tnow&"' where userid="&king.id&";"
'主题贴被回复的时候,更新主题贴作者的积分,以及更新isview字段
set rs=conn.execute("select username from kingtopic where topicid="&topicid&";")
if not rs.eof and not rs.bof then
if ll11(rs(0),king.name)=false then'回自己的帖子不加分
conn.execute "update kinguser set usermark=usermark+"&mark_reboard&",userprestige=userprestige+"&prestige_reboard&" where username='"&rs(0)&"' and userdel=0;"
'更新isview
conn.execute "update kingtopic set isview=1 where topicid="&topicid&";"
end if
else
king.error("system/error")
end if
set rs=nothing
'更新topic表
conn.execute "update kingtopic set lastpostuser='"&king.name&"',lastpostdate='"&tnow&"',topicreply=topicreply+1 where topicid="&topicid&";"
conn.execute "update kingmenu set menucount=menucount+1 where menuid="&menuid&";"
else
topicid=conn.execute("select topicid from kingboard where boardid="&boardid&";")(0)
conn.execute "update kingboard set bbstitle='"&data(0,0)&"',bbscontent='"&data(1,0)&"',bbsimg='"&data(2,0)&"',lastdate='"&tnow&"',isface="&data(5,0)&",isubb="&data(6,0)&",issign="&data(7,0)&",useragent='"&useragent&"',userip='"&king.ip&"',lastusername='"&king.name&"' where boardid="&boardid&";"
'更新最后发帖时间
conn.execute "update kinguser set lastpostdate='"&tnow&"' where userid="&king.id&";"
end if
end select
' datamenu(4,0)
dim topicpath,rndstr
topicpath=III11(conn.execute("select sysdate from kingtopic where topicid="&topicid&";")(0))
rndstr=llIl(4)
ol="
"
king_sub10_list menuid
king_bbs
end if
end sub
'refresh *** *** www.KingCMS.com *** ***
sub king_refresh()
dim topicid,rs,re:re=request.ServerVariables("http_referer")
if len(re)=0 then king.error("system/error")
king.range 1,0
'发帖时间限制及积分/威望 限制
king.bound
conn.execute "update kinguser set lastpostdate='"&tnow&"' where userid="&king.id&";"
topicid=l1ll("topicid",2)
set rs=conn.execute("select topicid from kingtopic where topicid="&topicid&";")
if not rs.eof and not rs.bof then
king_sub10_page topicid,0
else
king.error("system/error")
end if
set rs=nothing
response.redirect re&"?"&llIl(4)
end sub
'del *** *** www.KingCMS.com *** ***
sub king_del()
dim topicid,boardid,rs,menuid,data,irs
topicid=l1ll("topicid",2)
if cstr(topicid)<>"" then
set rs=conn.execute("select menuid,sysdate,bbstitle,username from kingtopic where topicid="&topicid&" and topicdel=0;")'3
if not rs.eof and not rs.bof then
data=rs.getrows()
menuid=data(0,0)
set irs=conn.execute("select menupath,menulanguage,bbsmaster from kingmenu where menuid="&data(0,0)&";")'2
if not irs.eof and not irs.bof then
dim menupath:menupath=irs(0)
dim menulanguage:menulanguage=irs(1)
king.range 3,irs(2)&","&data(3,0)
conn.execute "update kingtopic set topicdel=1 where topicid="&topicid&" and topicdel=0;"
else
king.error("system/error")
end if
set irs=nothing
'验证权限及生成临时文件前的设置
king.language=menulanguage
l404 "../"&menupath&"/"&III11(data(1,0))&"/"&topicid&king.ext,data(2,0)
'update USER表.如果是用户自己删除,就不扣积分和威望
if ll11(data(3,0),king.name) then
conn.execute "update kinguser set counttopicdel=counttopicdel+1 where username='"&data(3,0)&"' and userdel=0;"
else
conn.execute "update kinguser set counttopicdel=counttopicdel+1,usermark=usermark+"&mark_del&",userprestige=userprestige+"&prestige_del&" where username='"&data(3,0)&"' and userdel=0;"
end if
king_sub10_page topicid,0
king_sub10_list menuid
king_bbs:king_sub1
' ll "menuid="&data(0,0)&"&sub10="&topicid&"&cmd=bbs","../"&menupath&"/index"&king.ext
response.redirect "../"&menupath&"/index"&king.ext
else
king.error("system/error")
end if
set rs=nothing
end if
boardid=l1ll("boardid",2)
if cstr(boardid)<>"" then
set rs=conn.execute("select topicid,username from kingboard where boardid="&boardid&" and boarddel=0;")
if not rs.eof and not rs.bof then
topicid=rs(0)
set irs=conn.execute("select bbsmaster,menuid from kingmenu where menuid=(select menuid from kingtopic where topicid="&topicid&");")
if not irs.eof and not irs.bof then
king.range 3,irs(0)&","&rs(1)
menuid=irs(1)
conn.execute "update kingboard set boarddel=1 where boardid="&boardid&" and boarddel=0;"
conn.execute "update kingtopic set topicreply=topicreply-1 where topicid="&topicid&";"
else
king.error("system/error")
end if
set irs=nothing
'update USER表.如果是用户自己删除,就不扣积分和威望
if ll11(rs(1),king.name) then
conn.execute "update kinguser set counttopicdel=counttopicdel+1 where username='"&rs(1)&"' and userdel=0;"
else
conn.execute "update kinguser set counttopicdel=counttopicdel+1,usermark=usermark+"&mark_del&",userprestige=userprestige+"&prestige_del&" where username='"&rs(1)&"' and userdel=0;"
end if
king_sub10_page topicid,0
king_sub10_list menuid
king_bbs
' ll "sub10="&topicid&"&cmd=bbs",request.ServerVariables("http_referer")&"?"&llIl(4)
response.redirect request.ServerVariables("http_referer")&"?"&llIl(4)
else
king.error("system/error")
end if
set rs=nothing
end if
end sub
'revert *** *** www.KingCMS.com *** ***
sub king_revert()
dim boardid,rs,data,re:re=request.ServerVariables("http_referer")
if len(re)=0 then king.error("system/error")
boardid=l1ll("boardid",2)
set rs=conn.execute("select topicid,username from kingboard where boardid="&boardid&" and boarddel=1;")
if not rs.eof and not rs.bof then
data=rs.getrows()
else
king.error("system/error/revert")
end if
set rs=nothing
set rs=conn.execute("select bbsmaster from kingmenu where menuid=(select menuid from kingtopic where topicid="&data(0,0)&");")
if not rs.eof and not rs.bof then
king.range 3,rs(0)
else
king.error("system/error")
end if
set rs=nothing
conn.execute "update kingboard set boarddel=0 where boardid="&boardid&" and boarddel=1;"
conn.execute "update kinguser set counttopicdel=counttopicdel-1,usermark=usermark-"&mark_del&",userprestige=userprestige-"&prestige_del&" where username='"&data(1,0)&"' and userdel=0;"
king_sub10_page data(0,0),0
king_bbs
' ll "sub10="&data(0,0)&"&cmd=bbs",re&"?"&llIl(4)
response.redirect re&"?"&llIl(4)
end sub
'vote *** *** www.KingCMS.com *** ***
sub king_vote()
dim rs,data,xmldoc,votenum,votes,i,votetext,voteusername
dim vote:vote=llll("vote")
king.range 1,0
' out king.name&"|"&king.id
dim topicid:topicid=llll("topicid")
if II11(topicid,2)=false then king.error("system/error")
dim re:re=request.ServerVariables("http_referer")
if cstr(re)="" or II11(topicid,2)=false then king.error("system/error")
if llll(l1l(left(ll11l("111"),16)))<>l1l(ll11l("111")) or cstr(trim(vote))="" then response.redirect re
set rs=conn.execute("select votetext,votetype,voteusername,userid from kingtopic where topicid="&topicid&" and isvote=1;")'3
if not rs.eof and not rs.bof then
data=rs.getrows()
else
king.error("system/error")
end if
set rs=nothing
if len(data(2,0))>0 then
if ll11(data(2,0),king.name) then
king.error("bbs/tip/vote/ensuser")
else
voteusername=data(2,0)&","&king.name
end if
else
voteusername=king.name
end if
'读取xml数据
set xmldoc=createobject("microsoft.xmldom")
xmldoc.async=false
xmldoc.loadxml(data(0,0))
if cstr(data(1,0))="1" then'单选
votenum=xmldoc.selectsinglenode("//vote/"&vote&"/@number").text
xmldoc.selectsinglenode("//vote/"&vote&"/@number").text=votenum+1
else
votes=split(vote,",")
for i=0 to ubound(votes)
votenum=xmldoc.selectsinglenode("//vote/"&votes(i)&"/@number").text
xmldoc.selectsinglenode("//vote/"&votes(i)&"/@number").text=votenum+1
next
end if
response.contenttype="text/xml"
votetext=xmldoc.xml
set xmldoc=nothing
conn.execute "update kingtopic set votetext='"&lll1(votetext)&"',voteusername='"&lll1(voteusername)&"' where topicid="&topicid&";"
if ll11(data(3,0),king.name)=false then'自己的帖子不加分
conn.execute "update kinguser set usermark=usermark+"&mark_reboard&",userprestige=userprestige+"&prestige_reboard&" where userid="&data(3,0)&";"
conn.execute "update kinguser set usermark=usermark+"&mark_board&",userprestige=userprestige+"&prestige_board&" where userid="&king.id&";"
end if
king_sub10_page topicid,0
king_bbs
' ll "sub10="&topicid&"&cmd=bbs",re&"?"&llIl(4)
end sub
'up *** *** www.KingCMS.com *** ***
sub king_up()
dim re:re=request.ServerVariables("http_referer")
if len(re)=0 then king.error("system/error")
dim topicid,rs,data
topicid=l1ll("topicid",2)
set rs=conn.execute("select menuid from kingtopic where topicid="&topicid&";")
if not rs.eof and not rs.bof then
data=rs.getrows()
else
king.error("system/error")
end if
set rs=nothing
'权限
if ll11("up1,down1",action) then'总置顶
king.range 5,0
if ll11("up1",action) then
conn.execute "update kingtopic set topicup=2 where topicid="&topicid&" and topicup<>2;"
else
conn.execute "update kingtopic set topicup=0 where topicid="&topicid&" and topicup<>0;"
end if
'总置顶的更新需要整站论坛都要更新
set rs=conn.execute("select menuid from kingmenu where classid=10;")
if not rs.eof and not rs.bof then
data(0,0)=""
while not rs.eof
' data(0,0)=data(0,0)&rs(0)&","
king_sub10_list rs(0)
rs.movenext
wend
end if
set rs=nothing
else
dim bbsmaster
set rs=conn.execute("select bbsmaster from kingmenu where menuid="&data(0,0)&";")
if not rs.eof and not rs.bof then
bbsmaster=rs(0)
else
king.error("system/error")
end if
set rs=nothing
king.range 3,bbsmaster
if ll11("up2",action) then
conn.execute "update kingtopic set topicup=1 where topicid="&topicid&" and topicup<>1;"
else
conn.execute "update kingtopic set topicup=0 where topicid="&topicid&" and topicup<>0;"
end if
end if
king_sub10_page topicid,0
' king_sub10_list data(0,0)
king_bbs
response.redirect re&"?"&llIl(4)
' ll "sub10="&topicid&"&menuid="&data(0,0)&"&cmd=bbs",re&"?"&llIl(4)
end sub
'best *** *** www.KingCMS.com *** ***
sub king_set()
dim rs,data,re:re=request.ServerVariables("http_referer")
if len(re)=0 then king.error("system/error")
dim topicid:topicid=l1ll("topicid",2)
dim insql
if cstr(action)="best" then
insql=" and topicbest=0"
elseif cstr(action)="nobest" then
insql=" and topicbest=1"
end if
set rs=conn.execute("select menuid,username from kingtopic where topicid="&topicid&insql&";")
if not rs.eof and not rs.bof then
data=rs.getrows()
else
response.redirect re
end if
set rs=nothing
'权限
set rs=conn.execute("select bbsmaster from kingmenu where menuid="&data(0,0)&";")
if not rs.eof and not rs.bof then
king.range 3,rs(0)
else
king.error("system/error")
end if
set rs=nothing
select case action
case"best"
conn.execute "update kingtopic set topicbest=1 where topicid="&topicid&" and topicbest=0;"
conn.execute "update kinguser set usermark=usermark+"&mark_best&",userprestige=userprestige+"&prestige_best&",counttopicbest=counttopicbest+1 where username='"&data(1,0)&"';"
case"nobest"
conn.execute "update kingtopic set topicbest=0 where topicid="&topicid&" and topicbest=1;"
conn.execute "update kinguser set counttopicbest=counttopicbest-1 where username='"&data(1,0)&"';"
case"lock"
conn.execute "update kingtopic set topiclock=1 where topicid="&topicid&" and topiclock=0;"
case"unlock"
conn.execute "update kingtopic set topiclock=0 where topicid="&topicid&" and topiclock=1;"
case"up"
conn.execute "update kingtopic set lastpostdate='"&tnow&"' where topicid="&topicid&";"
end select
king_sub10_page topicid,0
king_sub10_list data(0,0)
king_bbs
response.redirect re&"?"&llIl(4)
' ll "sub10="&topicid&"&menuid="&data(0,0)&"&cmd=bbs",re&"?"&llIl(4)
end sub
'move *** *** www.KingCMS.com *** ***
sub king_move()
dim topicid:topicid=l1ll("topicid",2):if len(topicid)=0 then topicid=llll("topicid")
if II11(topicid,2)=false then king.error("system/error")
dim rs,i,data,menuid,sysdate,topicreply
dim menupath,bbstitle
'权限
set rs=conn.execute("select menuid,sysdate,topicreply,bbstitle from kingtopic where topicid="&topicid&"")
if not rs.eof and not rs.bof then
menuid=rs(0)
sysdate=rs(1)
topicreply=rs(2)'回复数
bbstitle=rs(3)
else
king.error("system/error")
end if
set rs=nothing
kingtitle="移动帖子":kingguide=king.guide(menuid)&htmlencode(bbstitle)&" >> "&kingtitle
set rs=conn.execute("select bbsmaster,menupath from kingmenu where menuid="&menuid&";")
if not rs.eof and not rs.bof then
king.range 3,rs(0)
menupath=rs(1)
else
king.error("system/error")
end if
set rs=nothing
ol=""
'save
if llll(l1l(left(ll11l("111"),16)))=l1l(ll11l("111")) and king.checkerr then
dim menuidnew:menuidnew=lll("menuid")'检查新的menuid的合法性
if II11(menuidnew,2)=false then king.error("system/error")
set rs=conn.execute("select menuid from kingmenu where menuid="&menuidnew&" and classid=10;")
if not rs.eof and not rs.bof then
else
king.error("system/error")
end if
set rs=nothing
'删除原来的文件
l404 "../"&menupath&"/"&III11(sysdate)&"/"&topicid&king.ext,bbstitle
for i=2 to int(topicreply/8)+1
II1 "../"&menupath&"/"&III11(sysdate)&"/"&topicid&"_"&i&king.ext
next
conn.execute "update kingtopic set menuid="&menuidnew&" where topicid="&topicid&";"
king_sub10_page topicid,0
king_sub10_list menuid
king_bbs
response.redirect king.inst&menupath&"/index"&king.ext&"?"&llIl(4)
end if
end sub
'delfile *** *** www.KingCMS.com *** ***
sub king_delfile()
dim topicid,boardid,rs,re,bbsmaster,menuid
re=request.ServerVariables("http_referer")
if len(re)=0 then king.error("system/error")
topicid=l1ll("topicid",2)
boardid=l1ll("boardid",2)
if cstr(topicid)<>"" xor cstr(boardid)<>"" then
if cstr(topicid)<>"" then'topic
set rs=conn.execute("select bbsdate,bbsimg,username,menuid from kingtopic where topicid="&topicid&" and bbsimg<>'';")
if not rs.eof and not rs.bof then
menuid=rs(3)
'判断用户权限
bbsmaster=conn.execute("select bbsmaster from kingmenu where menuid="&menuid&";")(0)
king.range 3,rs(2)&","&bbsmaster
if ll11("jpeg,jpg,png,gif,bmp",lIl(rs(1))) then
II1 "../"&king_upath&"/image/"&III11(rs(0))&"/"&rs(1)
else
II1 "../"&king_upath&"/"&king_dpath&"/"&III11(rs(0))&"/"&rs(1)
end if
conn.execute "update kingtopic set bbsimg='' where topicid="&topicid&";"
end if
set rs=nothing
else'board
set rs=conn.execute("select bbsdate,bbsimg,username,topicid from kingboard where boardid="&boardid&" and bbsimg<>'';")
if not rs.eof and not rs.bof then
topicid=rs(3)
menuid=conn.execute("select menuid from kingtopic where topicid="&topicid&"")(0)
bbsmaster=conn.execute("select bbsmaster from kingmenu where menuid="&menuid&";")(0)
king.range 3,rs(2)&","&bbsmaster
if ll11("jpeg,jpg,png,gif,bmp",lIl(rs(1))) then
II1 "../"&king_upath&"/image/"&III11(rs(0))&"/"&rs(1)
else
II1 "../"&king_upath&"/"&king_dpath&"/"&III11(rs(0))&"/"&rs(1)
end if
conn.execute "update kingboard set bbsimg='' where boardid="&boardid&";"
end if
set rs=nothing
end if
king_sub10_page topicid,0
king_sub10_list menuid
response.redirect re&"?"&llIl(4)
' ll "sub10="&topicid&"&menuid="&menuid,re&"?"&llIl(4)
else
king.error("system/error")
end if
end sub
'out *** *** www.KingCMS.com *** ***
sub king_outhtm()%>
<%=kingtitle%>