⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newpoll.asp

📁 仿雅虎论坛静态生成html版 后台管理:admin/admin.asp 用户名:admin 密码:admin TOP/top.htm 顶部模板 left.htm 左边树形菜单模板
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="const.asp"-->
<!--#include file="UserPost_Const.asp"-->
<!--#include file="code.asp"-->
<!--#include file="char.asp"-->
<!--#include file="BtBBS_Fun.asp"-->
<!--#include file="../conn.asp"-->
<%dim err
 StarTime = Timer():AccessNum=0
 username=Request.Cookies("username")
 login=BT_SF
 Bmid=Request.QueryString("boardid")
 if IsNumeric(Bmid)=false then Response.Redirect "index.asp" end if '-----------------------论坛状态及访问控制-----------------
 
   BT_Board():aRS=Application(BBSname&"BT_Board")
   if aRS(1,0)<>-1 and VarType(aRS)<>0 then 
    For i=0 to UBound(aRS,2)
     If aRS(0,i)=cint(Bmid) then
      boardname=aRS(3,i)
      bbsid=aRS(1,i)
      Flname=aRS(2,i)
     End if
    Next
   end if

Call JCC_Board_Top
titlename=htmlencode(Request.Form("titlename"))
err=""
if len(titlename)>TitleLen then titlename="":err="<tr><td><li>标题长度超过规定的"&cstr(TitleLen)&"字节</li></td></tr>" end if  '不允许标题长度超过规定的字节
tptype=Request.Form("tptype")
tpnl1=Request.Form("tpnl1")
tpnl2=Request.Form("tpnl2")
tpnl3=Request.Form("tpnl3")
tpnl4=Request.Form("tpnl4")
tpnl5=Request.Form("tpnl5")
tpnl6=Request.Form("tpnl6")
tpnl7=Request.Form("tpnl7")
tpnl8=Request.Form("tpnl8")
tpnl9=Request.Form("tpnl9")
tpnl10=Request.Form("tpnl10")
nl=ubbcode(Request.Form("nl"))
if len(nl)>FileLen then nl="":err=err+"<tr><td><li>内容长度超过规定的"&cstr(FileLen)&"字节</li></td></tr>" end if
if Request.Form("ftbq")<>"" then nl="<img src=../../images/ftbq/"+Request.Form("ftbq")+">"+nl end if
Call Login_EN
  if login<>"Y" then
   Response.Write "<center><table width=743><tr><td height=30 class=light>&nbsp;<img src=../images/nav.gif>&nbsp;<a href=index.asp><font class=NavColor>论坛首页</a>&nbsp;>>&nbsp;<a href=dislist.asp?boardid="&Bmid&"><font class=NavColor>"&boardname&"</font></a>&nbsp;>>&nbsp;发新帖</font></td></tr></table>"
   Response.Write "<br><br><table width=300><tr><td class=light>可能存在下列错误</td></tr> "&err&" <tr><td><li>尚未登陆或用户名/密码错误!</li></td></tr><tr><td align=center><a href=# onclick=history.go(-1)>返回</a> &nbsp;<a href=exit.asp>登陆</a></td></tr></table><br>"
   %></form><form name=newfile  method="post" action="login.asp">
   <table border=1 width=230 cellspacing=0 cellpadding=0 align=center class=table1>
   <tr><td width=80 height=30 align=center class=light1><b>用户名:</b></td><td class=light>   
   <INPUT class=fminpt name=username type=text size=20></td></tr>
   <tr><td height=30 align=center class=light1><b>密&nbsp;&nbsp;码:</b></td><td class=light>
   <INPUT class=fminpt name=password type=password size=20></td></tr>
   <tr><td align=center height=30 class=light1><B>有效期:</B></td><td class=light><Select name=CkiExp><option value=-1>无效<option value=365>一年<option value=1>一天<option value=2>两天<option value=7>一周<option value=31>一月</select></td></tr>
   </td></tr>
   <tr><td colspan=2 align=center height=30 class=light1><input type=Submit value="完成" name=add>&nbsp; <input type="reset" name="Clear" value="重写"></td></tr>
   </form>
   </table><br><br><%
   titlename=""
   nl=""
  end if
  if err<>"" then
   login="N"
   Response.Write "<br><br><table width=300><tr><td class=light>可能存在下列错误</td></tr> "&err&" <tr><td align=center><a href=# onclick=history.go(-1)>返回</a></td></tr></table><br>"
  end if
Response.Write "<script src=online.asp?userwz=发起新的投票&dis=NO></script>"
if titlename<>"" and tptype<>"" and tpnl1<>"" and tpnl2<>"" and username=Request.Form("username") then
'处理投票数据内容
 AccessNum=AccessNum+1
 Set rs = Server.CreateObject("ADODB.Recordset")
 sql="SELECT top 11 * FROM 投票项目 "
 rs.open sql,conn,1,3
 rs.addnew
 rs("投票类型")=tptype
 rs("选项内容")=titlename
 rs.update
 pollid=rs("id")
 if tptype=1 then
  tpnl=titlename+"<br><form name=tppoll action=../poll.asp?tptype=1&pollid="&pollid&" method=post target=_blank><input name=tp type=radio value="&pollid+1&">"+tpnl1+"<br>"
  rs.addnew
  rs("主题ID")=pollid
  rs("选项内容")=tpnl1
  tpnl=tpnl+"<input name=tp type=radio value="&pollid+2&">"+tpnl2+"<br>"
  rs.addnew
  rs("主题ID")=pollid
  rs("选项内容")=tpnl2
  if tpnl3<>"" then
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+3&">"+tpnl3+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl3
  end if
  if tpnl4<>"" then 
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+4&">"+tpnl4+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl4
  end if
  if tpnl5<>"" then
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+5&">"+tpnl5+"<br>"
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl5
  end if
  if tpnl6<>"" then
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+6&">"+tpnl6+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl6
  end if
  if tpnl7<>"" then
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+7&">"+tpnl7+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl7
  end if
  if tpnl8<>"" then
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+8&">"+tpnl8+"<br>"
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl8
  end if
  if tpnl9<>"" then
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+9&">"+tpnl9+"<br>"
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl9
  end if
  if tpnl10<>"" then
   tpnl=tpnl+"<input name=tp type=radio value="&pollid+10&">"+tpnl10+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl10
  end if
  tpnl=tpnl+"<input type=Submit value=提交 name=okpoll>&nbsp;<a href=javascript:openScript('../poll.asp?lookpollid="&pollid&"',500,400)>查看结果</a></form>"
 else
  tpnl=titlename+"<br><form name=tppoll action=../poll.asp?tptype=2&pollid="&pollid&" method=post target=_blank><input name=tp type=checkbox value="&pollid+1&">"+tpnl1+"<br>"
  rs.addnew
  rs("主题ID")=pollid
  rs("选项内容")=tpnl1
  tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+2&">"+tpnl2+"<br>"
  rs.addnew
  rs("主题ID")=pollid
  rs("选项内容")=tpnl2
  if tpnl3<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+3&">"+tpnl3+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl3
  end if
  if tpnl4<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+4&">"+tpnl4+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl4
  end if
  if tpnl5<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+5&">"+tpnl5+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl5
  end if
  if tpnl6<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+6&">"+tpnl6+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl6
  end if
  if tpnl7<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+7&">"+tpnl7+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl7
  end if
  if tpnl8<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+8&">"+tpnl8+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl8
  end if
  if tpnl9<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+9&">"+tpnl9+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl9
  end if
  if tpnl10<>"" then
   tpnl=tpnl+"<input name=tp type=checkbox value="&pollid+10&">"+tpnl10+"<br>" 
   rs.addnew
   rs("主题ID")=pollid
   rs("选项内容")=tpnl10
  end if
  tpnl=tpnl+"<input type=Submit value=提交 name=okpoll>&nbsp;<a href=javascript:openScript('../poll.asp?lookpollid="&pollid&"',500,400)>查看结果</a></form>"
 end if
 rs.update
 rs.close
 set rs=nothing
  nl=tpnl+"<br><br>"+nl
 AccessNum=AccessNum+1
 Set rs = Server.CreateObject("ADODB.Recordset")
 sql="SELECT top 1 * FROM BT_Topic "
 rs.open sql,conn,1,3
 rs.AddNew
 rs("BoardName")=boardname
 rs("BoardID")=Bmid
 rs("Subject")=titlename
 rs("PostUser")=username

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -