<% sub initapp call put_init MaxTalk=cint(rsparam("maxtalk")) call put_maxtalk MaxUser=0 call put_maxuser current=0 redim says(MaxTalk,5) for i=0 to MaxTalk says(i,0)=0 next call put_says redim guests(rsparam("maxuser"),14) call put_guests redim votes(9) votes(0)=0 call put_votes end sub errtext="" response.expires=0 set Rsparam=conn.execute("select * from param") call get_init if chatinit<>"true" then call initapp errtext="聊天室被初始化成功!" else myid=Session("myid") myname=Session("myname") call get_guests if myid="" or myname="" then errtext="你还没有进入聊天室!" elseif myname<>guests(myid,0) or Session("mytemp")<>guests(myid,1) then errtext="你还没有进入聊天室!" elseif guests(myid,4)<>rsparam("superlevel") then errtext="超级管理员才能执行此操作!" end if if errtext<>"" then call echoerr(errtext,"default.asp") response.end elseif request("op")="init" then call initapp conn.Execute("INSERT INTO record (occ_env,occ_time,for_what) VALUES ('管理员 重新初始化了 聊天室!','"&now()&"','此处只做记录,不输入理由!')") errtext="聊天室被重新初始化,所有的用户和发言被清除!" elseif request("op")="pre" then call get_says talk_num=cint(rsparam("maxtalk")) if talk_num>MaxTalk then talk_num=MaxTalk dim newsays redim newsays(cint(rsparam("maxtalk")),5) for i=0 to rsparam("maxtalk") newsays(i,0)=0 next c=current for i=talk_num to 0 step -1 for j=0 to 5 newsays(i,j)=says(c,j) next c=c-1 if c<0 then c=MaxTalk next MaxTalk=cint(rsparam("maxtalk")) current=talk_num says=newsays call put_says call put_maxtalk call get_guests call get_maxuser user_num=cint(rsparam("maxuser")) if user_num>MaxUser then user_num=MaxUser dim newguests redim newguests(cint(rsparam("maxuser")),14) for i=0 to rsparam("maxuser") newguests(i,0)="" next for i=0 to user_num for j=0 to 14 newguests(i,j)=guests(i,j) next next MaxUser=user_num call put_maxuser guests=newguests call put_guests conn.Execute("INSERT INTO record (occ_env,occ_time,for_what) VALUES ('管理员 重新修正了 聊天室!','"&now()&"','此处只做记录,不输入理由!')") errtext="根据数据库设置修正了聊天室数据!" end if end if call echoerr(errtext,"default.asp") %>