<%@ Language=VBScript%> <% Response.Buffer=true Response.Expires=0 %> <% keyno=Request.QueryString("keyno") method=Request.QueryString("method") pageno=Request.QueryString("pageno") set cn = Server.CreateObject("ADODB.Connection") cn.Open(mycnstr) set rs = Server.CreateObject("ADODB.Recordset") set rs2 = Server.CreateObject("ADODB.Recordset") tablename="forum" if keyno="" then Response.End sql="select keyno,classcode,querycount from "+tablename+" where keyno="&keyno rs.Open sql,cn,1,3 if not rs.EOF then classcode=trim(rs("classcode")) querycount=rs("querycount") end if rs.Close if classcode<>"" then sql="select * from forum_class where state='1' and classcode='"+classcode+"'" else sql="select * from forum_class where state='1' order by sortnum" end if rs2.Open sql,cn,1,1 if not rs2.EOF then manager=trim(rs2("manager")) classcode=trim(rs2("classcode")) classname=trim(rs2("classname")) topcount=rs2("topcount") totcount=rs2("reccount") flag=rs2("flag") else Response.End end if rs2.Close myurl="forum_display.asp?classcode="+classcode+"&keyno="+keyno backurl="forum_list.asp?classcode="+classcode usercode=Session("usercode") userno=Session("userno") select case Session("userflag") case "1" userqx=mid(flag,2,1) case "2" userqx=mid(flag,3,1) case else userqx=mid(flag,1,1) end select if manager<>"" then keyword=manager+"/" manager="" xx1=1 xx2=instr(xx1,keyword,chr(47)) wheretxt="" do while xx2>0 ttt=mid(keyword,xx1,xx2-xx1) if ttt<>"" then sql="select userno from userinfo where state='1' and usercode='"+ttt+"'" rs2.Open sql,cn,1,1 if not rs2.EOF then if cstr(Session("userno"))=cstr(rs2(0)) then userqx="9" end if ttt=""+ttt+"" if manager="" then manager=ttt else manager=manager+","+ttt end if end if rs2.Close end if xx1=xx2+1 xx2=instr(xx1,keyword,"/") loop else manager="暂无" end if if Session("userqx")="9" or Session("userflag")="9" then userqx="9" end if if userqx="0" then Response.End end if if Request.ServerVariables("REQUEST_METHOD")="POST" then if method="" then bz=1 formsize=request.totalbytes formdata=request.binaryread(formsize) bncrlf=chrB(13) & chrB(10) if formsize>122880 then bz="2" sysmess="上传文件太大!文件限为:120K,"+"目前为:"&int(formsize/1024)&"K 。" end if hds=1 datastart=1 do while datastart dataend then picflag="0" else picflag="1" end if picdata=mydata case 6,7 case 8 newcontent=bin2str(mydata) end select hds=hds+1 loop if Session("userno")="" then sql="select userno,userpass,flag,state,logintime,logincount,ipaddress,cookieqx from userinfo where usercode='"+usercode+"' and state='1'" rs.Open sql,cn,1,3 if rs.EOF then bz=2 else oldpass=Lcase(trim(rs(1))) if oldpass=userpass then rs("logintime")=now() rs("logincount")=rs("logincount")+1 rs("ipaddress")=Request.ServerVariables("Remote_HOST") cookieqx=trim(rs("cookieqx")) rs.Update Response.Cookies("usercode")=usercode Response.Cookies("userpass")=userpass Response.Cookies("loginflag")=loginflag select case cookieqx case "1" Response.Cookies("usercode").Expires=now()+1 Response.Cookies("userpass").Expires=now()+1 Response.Cookies("loginflag").Expires=now()+1 case "2" Response.Cookies("usercode").Expires=now()+30 Response.Cookies("userpass").Expires=now()+30 Response.Cookies("loginflag").Expires=now()+30 case "3" Response.Cookies("usercode").Expires=now()+365 Response.Cookies("userpass").Expires=now()+365 Response.Cookies("loginflag").Expires=now()+365 end select Session("userno")=rs(0) Session("usercode")=usercode Session("userflag")=rs("flag") userno=rs(0) loginflag="1" cn.Execute "delete from user_login where userno="&userno&" or keyno="&Session.SessionID if databaseflag="access" then sql="Insert into user_login values ("&Session.SessionID&","&userno&",'"+usercode+"',now(),now(),'"+classcode+"','"+loginflag+"','"+Request.ServerVariables("Remote_HOST")+"')" else sql="Insert into user_login values ("&Session.SessionID&","&userno&",'"+usercode+"',getdate(),getdate(),'"+classcode+"','"+loginflag+"','"+Request.ServerVariables("Remote_HOST")+"')" end if cn.Execute sql else bz=2 Session.Abandon end if end if rs.Close end if if bz=1 and (userqx="1" or userqx="9") then sql="select top 1 * from "+tablename rs.Open sql,cn,1,3 rs.AddNew newkeyno=syskeyno(tablename,"keyno") rs("keyno")=newkeyno rs("parentno")=keyno rs("title")=newtitle rs("classcode")=classcode rs("emote")=emote rs("content")=newcontent rs("grade")=2 rs("userno")=userno rs("usercode")=usercode rs("userflag")="1" rs("clen")=len(content) rs("picflag")=picflag rs("querycount")=0 rs("replycount")=0 rs("flag")="0" rs("topflag")="0" rs("ipaddress")=Request.ServerVariables("Remote_HOST") rs("creadate")=Now() rs.Update rs.Close if picflag="1" then sql="select top 1 * from picfiles" rs2.Open sql,cn,1,3 rs2.AddNew rs2("keyno")=newkeyno rs2("code")=tablename rs2("tablename")=tablename rs2("picfile").appendchunk picdata rs2.Update rs2.Close end if sql="update userinfo set talkcount=talkcount+1,amount=amount+1 where userno="&userno cn.Execute sql sql="update forum_class set reccount=reccount+1 where classcode='"+classcode+"'" cn.Execute sql if databaseflag="sql" then sql="update forum set replycount=replycount+1,replyno="&newkeyno&",replytime=getdate(),replyuser='"+usercode+"' where keyno="&keyno else sql="update forum set replycount=replycount+1,replyno="&newkeyno&",replytime=now(),replyuser='"+usercode+"' where keyno="&keyno end if cn.Execute sql xx=myurl&"&pageno="&pageno 'Response.Write xx 'Response.End Response.Redirect(xx) 'Response.Redirect myurl&"&pageno="&pageno&"#end" end if else if userqx="9" then delkeyno=Request.Form("delkeyno") sql="delete from forum where keyno="&delkeyno cn.Execute sql sql="select count(keyno) from forum where classcode='"+classcode+"' and grade=1" rs2.Open sql,cn,1,1 topcount=rs2(0) rs2.Close sql="select count(keyno) from forum where classcode='"+classcode+"'" rs2.Open sql,cn,1,1 reccount=rs2(0) rs2.Close sql="update forum_class set topcount="&topcount&",reccount="&reccount&" where classcode='"+classcode+"'" cn.Execute sql Response.Redirect(myurl) end if end if end if Function bin2str(binstr) Dim varlen,clow,ccc,skipflag '中文字符Skip标志 skipflag=0 ccc = "" varlen=LenB(binstr) For i=1 To varlen If skipflag=0 Then clow = MidB(binstr,i,1) '判断是否中文的字符 If AscB(clow) > 127 Then 'AscW会把二进制的中文字符高位和低位反转,所以要先把中文的高低位先反转 ccc =ccc & Chr(AscW(MidB(binstr,i+1,1) & clow)) skipflag=1 Else ccc = ccc & Chr(AscB(clow)) End If Else skipflag=0 End If Next bin2str = ccc End Function function ipaddress(txt) dim i i=instr(txt,".") i=instr(i+1,txt,".") ipaddress=left(txt,i)+"xxx.xxx" end function %> <% mybz=0 set rsb1 = Server.CreateObject("ADODB.Recordset") set rsb2 = Server.CreateObject("ADODB.Recordset") if Session("userno")="" then c_usercode=Request.Cookies("usercode") c_userpass=Request.Cookies("userpass") c_loginflag=Request.Cookies("loginflag") if c_usercode<>"" then sql="select userno,userpass,flag,state,logintime,logincount,picfile,ipaddress from userinfo where usercode='"+c_usercode+"' and state='1'" rsb1.Open sql,cn,1,3 if rsb1.EOF then else oldpass=Lcase(trim(rsb1(1))) if oldpass=c_userpass then mybz=1 rsb1("logintime")=now() rsb1("logincount")=rsb1("logincount")+1 rsb1("ipaddress")=Request.ServerVariables("Remote_HOST") rsb1.Update Session("userno")=rsb1(0) Session("usercode")=c_usercode Session("userflag")=c_loginflag userno=rsb1(0) cn.Execute "delete from user_login where userno="&userno&" or keyno="&Session.SessionID if databaseflag="access" then sql="Insert into user_login values ("&Session.SessionID&","&userno&",'"+c_usercode+"',now(),now(),'"+classcode+"','"+loginflag+"','"+Request.ServerVariables("Remote_HOST")+"')" else sql="Insert into user_login values ("&Session.SessionID&","&userno&",'"+c_usercode+"',getdate(),getdate(),'"+classcode+"','"+loginflag+"','"+Request.ServerVariables("Remote_HOST")+"')" end if cn.Execute sql end if end if rsb1.Close end if end if if mybz=0 then sql="select * from user_login where keyno="&Session.SessionID rsb2.Open sql,cn,1,3 if not rsb2.EOF then rsb2("updatetime")=now() rsb2("classcode")=classcode else rsb2.Addnew rsb2("keyno")=Session.SessionID rsb2("userno")=0 rsb2("logintime")=now() rsb2("updatetime")=now() rsb2("loginflag")="0" rsb2("ipaddress")=Request.ServerVariables("Remote_HOST") rsb2("classcode")=classcode end if rsb2.Update rsb2.Close end if %> <%=forumtitle%>_澳大利亚论坛_留学移民论坛_澳大利亚ABC环球集团
<%if Session("userno")<>"" then%> <%else%> <%end if%>
<%=Session("usercode")%> 重登录 | 注销 | 我的资料 | 现在时间是 <%=time()%>  
登录 | 注册 | 现在时间是 <%=time()%>  
  欢迎光临<%=forumtitle%>  
<% sql="select * from forum where parentno="&keyno&" order by keyno asc" rs.Open sql,cn,1,3 pagesize=20 rs.PageSize=pagesize if pageno="" then pageno=1 else pageno=cint(pageno) if rs.PageCount>0 then rs.AbsolutePage=pageno pagecount=rs.PageCount reccount=rs.RecordCount if not rs.EOF then title=trim(rs("title")) content=trim(rs("content")) if rs("grade")=1 then rs("querycount")=rs("querycount")+1 rs.Update end if end if %> <%if classflag="1" then%> <%else%> <%end if%>
<%=forumtitle%> > <%=classname%> > 帖子列表<%=forumtitle%> > <%=classname%> > 帖子列表  
<%if bz=2 then%>
>出错信息  
出错原因可能如下: <%if sysmess="" then%>
  • 用户名不正确,或没有此用户名
  • 密码不正确
  • 此用户已被系统管理员锁定
  • 上传文件太大,文件限制为100K以内
  • <% else %>
    <%=sysmess%>
    <%end if%>
    <%end if%> <%else%> 您对本版块具有只读权限 <%end if%>
    <%if userqx="1" or userqx="9" then%> 您是本帖的第 <%=querycount+1%> 位阅读者 版主:<%=manager%>
    >帖子主题:<%=title%>
    <% i=1 do while not rs.EOF and i<=pagesize if i mod 2=1 then color1="ffffff" else color1="f6f6f6" end if %> <% i=i+1 rs.MoveNext loop rs.Close %>
    <% sql="select userno,usercode,intro,creadate,picflag,picfile,talkcount,grade,amount from userinfo where userno="&rs("userno") rs2.Open sql,cn,1,1 if not rs2.EOF then userintro=trim(rs2("intro")) %> <%if userqx="9" then%> <%else%> <%end if%>
       <%=trim(rs2("usercode"))%>
      <%if rs2("picflag")="1" then%> " width=120> <%end if%> <%if rs2("picflag")="2" then%> .gif"> <%end if%>
     文章:<%=rs2("talkcount")%>
     积分:<%=rs2("amount")%>
     注册:<%=rs2("creadate")%>
    来自:[<%=trim(rs("ipaddress"))%>]
    来自:[<%=ipaddress(trim(rs("ipaddress")))%>]
    <%end if rs2.Close %>
    <%if i=pagesize or i=reccount then%> <%end if%>
    发表于 <%=rs("creadate")%>  <%if userqx="9" and rs("grade")>1 then%> ')"> <%end if%>   <%if cstr(Session("userno"))=cstr(rs("userno")) then%> [">编辑] <%end if%> <%if rs("grade")=1 then%>楼 主<%else%>第 <%=((pageno-1)*pagesize+i)%> 楼<%end if%>
    <%if rs("updatetime")<>"" then%> <%end if%> <%if rs("emote")=3 then%> <%end if%> <%if userintro<>"" then%> <%end if%>
    .gif" border="0"><%Response.Write server.HTMLEncode(trim(rs("title")))%>

    <%if rs("picflag")="1" then%>
    " border="0" name="oldpic<%=rs("keyno")%>">

    <%end if%> <%=checkstr(trim(rs("content")),"1")%>
    [此帖已被作者于 <%=rs("updatetime")%> 编辑过]
    [本文为ABC论坛征文活动作品。版权归ABC论坛与原作者所有,未经同意,不得随意转载与传播。若发现本文并非原创,请报告管理员!]
    <%=string(30,"-")%>
    <%=checkstr(userintro,"1")%>
     本主题帖共有 <%=reccount%> 条帖子 <%if pagecount>1 then%> <%if pageno>1 then%> 首页  <<上一页  <%end if%> <% if pageno>5 then minj=pageno-5 else minj=1 if pagecount>pageno+5 then maxj=pageno+5 else maxj=pagecount for j=minj to maxj if j=pageno then color2="ff6600" else color2="000000" %> ><%=j%> <%next%>  页  <%if pageno 下一页>>  末页 <%end if%> <%end if%>
    <%if userqx="1" or userqx="9" then%>
    >回复帖子
    <%if Session("userno")="" then%> <%else%> <%end if%>
    用户名:   * 若没有注册,请立即注册
    密码:    忘记密码,请查询密码
    用户名:   <%=usercode%> (来自<%=Request.ServerVariables("Remote_HOST")%>)
    主题:   *不超过25个汉字
    心情图标:
    微笑 咧嘴笑脸 惊讶的笑脸 吐舌笑脸 眨眼笑脸 悲伤的脸 困惑的笑脸 失望的脸 哭泣的脸
    尴尬的笑脸 热烈的笑脸 生气的脸 天使的笑脸 恶魔笑脸 保守秘密 咬牙切齿 讽刺的脸 悄悄话
    礼品盒 咖啡 红心 红玫瑰 生日蛋糕 高脚杯 左侧拥抱 右侧拥抱 金钱
    图片上传:   支持jpg,gif文件,文件大小不得超过100K
    内容:
  • 支持HTML
  • 支持贴图

  •         
    <%else%> <%else%> 您对本版块具有只读权限 <%end if%>
    <%if userqx="1" or userqx="9" then%> 您是本帖的第 <%=querycount%> 位阅读者 版主:<%=manager%>
    <%end if%>