📄 con_forum_vote.asp
字号:
<%
dim fir_vote_num
sub forum_vote_type()
dim dim_name,dim_num,v_name,v_num,v_type,v_tim,v_day,v_username,vi,v_sum,n_num
v_sum=0
v_type="radio"
response.write vbcrlf&"<table cellspacing=1 cellpadding=1 class=table>" & _
vbcrlf&"<tr><td class=td colspan=2> 投票:"&joekoe_cms.code_html(fir_topic,1,0)&"</td></tr>"
sql="select top 1 v_name,v_num,v_type,v_tim,v_day,v_username from bbs_vote where reply_id="&viewid
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then
v_name=rs(0)
v_num=rs(1)
if rs(2) then v_type="checkbox"
v_tim=rs(3)
v_day=rs(4)
v_username=rs(5)
end if
rs.close
if v_name="" or v_num="" then
response.write vbcrlf&"<tr><td class=bg_td colspan=2 height=25> <font class=red>投票出现异常错误!</font></td></tr>"
else
response.write vbcrlf&"<form name=vote_frm action='forum_vote.asp?view_id="&viewid&"' method=post>"
dim_name=split(v_name,"|")
dim_num=split(v_num,"|")
for vi=0 to ubound(dim_num)
v_sum=v_sum+dim_num(vi)
next
for vi=0 to ubound(dim_name)
n_num=1
if int(v_sum)>0 then
n_num=cint(replace(formatpercent(dim_num(vi)/v_sum),"%",""))*3.3
if int(n_num)<1 then n_num=1
end if
response.write vbcrlf&"<tr class=bg_td height=25>" & _
vbcrlf&"<td width='50%'><input type="&v_type&" name=vote_nid value='"&vi&"' class=bg_td>"&joekoe_cms.code_html(dim_name(vi),1,0)&"</td>" & _
vbcrlf&"<td width='50%'><img src='"&joekoe_cms.web_dir&"images/vote/vb"&vi+1&".gif' border=0 width="&n_num&" height=8> "&dim_num(vi)&" 票</td>" & _
vbcrlf&"</tr>"
next
erase dim_name
erase dim_num
end if
if int(v_sum)<>int(fir_vote_num) then
call joekoe_cms.exec("update bbs_topic set vote_num="&v_sum&" where id="&viewid,0)
end if
response.write vbcrlf&"<tr><td class=bg_tds colspan=2 height=25> "
if login_mode="" then
response.write web_nologin
else
response.write "<input type=submit value='我来投一票'> 投票信息:共<font class=red>"&v_sum&"</font>票,截止日期:"
if int(v_day)=0 then
response.write "永不过期"
else
response.write dateadd("d",v_day,v_tim)
end if
end if
response.write " <font class=gray>[ <a href='javascript:;' onclick=""javascript:open_win('forum_vote_user.asp?view_id="&viewid&"','vote_user',400,500,'yes');"">查看投票用户</a> ]</font></td></tr>"
response.write vbcrlf&"</form></table>"&ukong
end sub
sub forum_vote_print()
dim tmp1,dim_name,dim_num,v_name,v_num,v_tim,v_day,v_username,vi,v_sum,n_num
v_sum=0
sql="select top 1 v_name,v_num,v_type,v_tim,v_day,v_username from bbs_vote where reply_id="&viewid
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then
v_name=rs(0)
v_num=rs(1)
v_tim=rs(3)
v_day=rs(4)
v_username=rs(5)
end if
rs.close
tmp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=2 width='99%'>"
if v_name="" or v_num="" then
tmp1=tmp1&vbcrlf&"<tr><td colspan=2 height=30> <font class=red>投票出现异常错误!</font></td></tr>"
else
dim_name=split(v_name,"|")
dim_num=split(v_num,"|")
for vi=0 to ubound(dim_num)
v_sum=v_sum+dim_num(vi)
next
for vi=0 to ubound(dim_name)
n_num=1
if int(v_sum)>0 then
n_num=cint(replace(formatpercent(dim_num(vi)/v_sum),"%",""))*3.3
if int(n_num)<1 then n_num=1
end if
tmp1=tmp1&vbcrlf&"<tr>" & _
vbcrlf&"<td width='50%'><font class=gray>--</font> <b>"&joekoe_cms.code_html(dim_name(vi),1,0)&"</b></td>" & _
vbcrlf&"<td width='50%'><img src='images/vote/vb"&vi+1&".gif' border=0 width="&n_num&" height=8> "&dim_num(vi)&" 票</td>" & _
vbcrlf&"</tr>"
next
erase dim_name
erase dim_num
end if
tmp1=tmp1&vbcrlf&"<tr><td colspan=2> 投票信息:共<font class=red>"&v_sum&"</font>票,截止日期:"
if int(v_day)=0 then
tmp1=tmp1&"永不过期"
else
tmp1=tmp1&dateadd("d",v_day,v_tim)
end if
tmp1=tmp1&vbcrlf&"</table>"
response.write tmp1
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -