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

📄 vote.asp

📁 BBS论坛的开发和设计
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin/BBSConfig.asp"-->
<!--#include file="INC/online.asp"-->
<!--#include file="INC/ShowMsg.asp"-->
<!--#include file="INC/header.asp"-->
<!--#include file="INC/Board_Config.asp"-->
<%
'****************************************************************
'*  joinboard BBS Ver2.3.0/友盟论坛 Ver2.3.0
'*
'*  版权所有: JoinBoard V2.3
'*
'*  程序制作: 友盟工作室
'*           
'*  主页地址: http://joinboard.com    友盟论坛
'*
'*  论坛地址: http://bbs.joinboard.com/、http://youmeng.com
'*	                 
'****************************************************************
'*  Powered by: JoinBoard V2.3
'* Copyright 2003-2004.  - All Rights Reserved.
'*  JoinBoard is a trademark of YouMeng Studio.
'****************************************************************
voteID = trim(request.QueryString("pollID"))
if Not(IsNumeric(voteID)) or voteID = "0" then
	response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL="&BBSHomeUrl&"'>")
	response.End()
End if
	set rs = Conn.ExeCute("select threadID,Board_ID,thread_title From JBB_thread where pollID="&voteID)
	if Not rs.eof then
		threadID = rs("threadID")
		BoardID = rs("Board_ID")
		Board_info BoardID
		Board_Config = Application(JBBMasterCookies&"Board_Config"&BoardID)
		title = Board_Config(2)
		if Board_Config(6)=true then styleid = Board_Config(5)
	else
		set rs = Nothing
		response.Write("<META HTTP-EQUIV='REFRESH' CONTENT='0; URL="&BBSHomeUrl&"'>")
		response.End()		
	End if
	set rs = Nothing
%>
<!--#include file="INC/style.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="joinboard,forum,bbs,youmeng,友盟论坛">
<title><%=BBS_Config(0)&" - "& Board_Config(2) &" - 参加投票"%></title>
<link href="<%=Css_path%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%
Call onlineuser()
call top()

response.Write "<table border=""0"" align=""center"" cellpadding=""0"" cellspacing=""0"" class=""path-table"">"
response.Write "<tr><td>"
response.Write "<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;<a href="""&BBSHomeUrl&""">"& BBS_Config(0) &"</a>&nbsp;<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;<a href=""board.asp?BoardID="& BoardID &""">"& Board_Config(2) &"</a>&nbsp;<img src="""& BBS_Skin(3) &"JBB_bullet.gif"">&nbsp;参加投票"
response.Write "</td></tr></table>"

if Board_Config(17) = True or Board_Config(18) = True then
	if usergroup <= 4 then 
		enter = true
	End if
else
	enter = true
End if
'------------------------------------------------
if user_group(17) <> True or enter <> true then
	loginform "对不起,您不可以参加此投票或者您还没有登录,点击 <a href=""javascript:history.back()"">这里</a> 返回<br>"
	Call Bottom()
	response.End()
End if
'-----------------------------------------
dim votevalue(50)
set rs = server.CreateObject("adodb.recordset")
rs.open "select * from JBB_poll where pollid ="&voteid,conn,1,1
if rs.eof or rs.bof then
	ShowMsg "此投票不存在,请点击 <a href=""javascript:history.back()"">这里</a> 返回"
else
	if datediff("d",rs("times"),Now()) > rs("time_out") and rs("time_out") > 0 then
		ShowMsg "此投票已经过期,请点击 <a href=""javascript:history.back()"">这里</a> 返回"
	else
		set rs1 = Conn.ExeCute("select userid from JBB_polluser where pollid="&voteID&" and userid="&userid)
		if Not(rs1.eof and rs1.bof) then
			ShowMsg "您已经投过票了,请点击 <a href=""javascript:history.back()"">这里</a> 返回"
		else
			votenum=split(rs("votes"),"||")
			if rs("polltype") then
				for i = 0 to ubound(votenum)
				'response.Write(i)
				votevalue(i) = trim(request.form("votevalue_"& i &""))
				next
				'response.End()
			end if
			for j = 0 to ubound(votenum)
			if not(rs("polltype")) then
				if int(request("votevalue"))=j then
				votenum(j)=votenum(j)+1
				voteOption=j+1
				end if
				votenum_1=""&votenum_1&""&votenum(j)&"||"
				postnum=1
			else
				if votevalue(j)<>"" then
					if int(votevalue(j))=j then
						votenum(j)=votenum(j)+1
						postnum=postnum+1
						voteOption=voteOption & j+1 & ","
					end if
				end if
				votenum_1=""&votenum_1&""&votenum(j)&"||"
			end if
			next
			votenumlen=len(votenum_1)
			votenum_1=left(votenum_1,votenumlen-2)
			joinpollcount=rs("joinpollcount")+1
			conn.ExeCute("update JBB_poll set votes='"&votenum_1&"',joinpollcount="&joinpollcount&" where pollid ="&voteid)
			conn.execute("insert into JBB_polluser (pollID,userid,votetime,VoteOption) values ("&voteid&","&userid&",'"& now() &"','"&voteOption&"')")
			backurl = true
		End if
		set rs1 = nothing
	End if
End if
rs.close
set rs = nothing
'response.Write(threadID)
if backurl = true then	
response.redirect("showthread.asp?threadID="&threadID)
End if
'--------------------------------------
Call Bottom()
%>

⌨️ 快捷键说明

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