talk_votedeal.asp
上传用户:stone001
上传日期:2016-10-28
资源大小:685k
文件大小:3k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
ASP/ASPX
- <!--插入html头部分以及数据库接口-->
- <!--#include file="in_conn.asp"-->
- <!--插入时间id的函数-->
- <!--#include file="in_idtime.asp"-->
- <!--获取发布内容字数限制-->
- <!--#include file="in_talksize.asp"-->
- <body>
- <!--插入网站置顶-->
- <% if u_name="" then
- Response.Redirect "log_err.asp"
- else
- %>
- <!--#include file="in_topmb.asp"-->
- <% end if %>
- <%
- '判断用户权限
- IF u_power=0 THEN
- Response.Redirect "resp.asp?cmd=id_wait"
- ELSEIF u_power<0 THEN
- Response.Redirect "resp.asp?cmd=id_forbid&time="&u_fobdate
- END IF
- %>
- <table align="center" width="700" height="50" border="0" cellspacing="0" cellpadding="11" class="rdkuang"><tr>
- <td width="100%" height="100%" align="center">
- <%
- '获取传值
- dim vtopic,vcontent
- dim vemo,vonly1
- vtopic=trim(Request.Form("txttopic"))
- vcontent=Request.Form("txtcontent")
- vemo=0
- vonly1=CBool(Request.Form("radonly1"))
- '检查正确性
- IF vtopic="" OR vcontent="" OR LEN(vtopic)>50 OR LEN(vcontent)>DEF_talksize*1024 THEN
- response.Redirect "resp.asp"
- END IF
- '检查投票选项
- dim opcount,opi
- dim str_option(9),opstr
- opcount=0
- For opi=1 to 10
- opstr=Request.Form("option"&opi)
- if opstr<>"" then
- str_option(opcount)=opstr
- opcount=opcount+1
- end if
- Next
- '检查选项是否大于2项
- if opcount<2 then
- Response.Redirect "resp.asp?cmd=vote2op"
- end if
- '检查是否重复发文
- dim cnt
- cnt=conn.Execute("SELECT COUNT(t_ID) FROM tbltalk WHERE t_topic='"&stryin(vtopic)&"' AND t_author='"&u_name&"' AND t_isreply=False",0,1)(0)
- if cnt<>0 then
- Response.Redirect "resp.asp?cmd=talk_repub"
- end if
- '处理时间
- dim vidfre
- dim vtdate
- vtdate=now()
- vidfre=idtime(vtdate)
- '插入数据
- sqlstr="INSERT INTO tbltalk(t_author,t_topic,t_content,t_datepub,t_isreply,t_class,t_idfre,t_owner,t_re,t_clk,t_emotion) VALUES('"&u_name&"','"&stryin(vtopic)&"','"&stryin(vcontent)&"',#"&vtdate&"#,False,1,"&vidfre&",'"&u_name&"',0,0,"&vemo&")"
- conn.Execute sqlstr
- '获得新记录的id
- dim vtid
- vtid=conn.Execute("SELECT t_ID FROM tbltalk WHERE t_idfre="&vidfre,0,1)(0)
- '插入选项
- sqlstr="INSERT INTO tblvote(v_topicID,v_voter,v_enable,v_only1,v_option) VALUES("&vtid&",'"&u_name&"',false,"&vonly1&",'"
- For i=0 to opcount-1
- conn.Execute sqlstr&stryin(str_option(i))&"')"
- Next
- '更新你的发水量
- sqlstr="UPDATE tblmates SET cnt_water=cnt_water+1 WHERE ID="&u_ID
- conn.Execute sqlstr
- %>
- 恭喜:发表主题成功!
- <table align="center" width="400" height="25" border="0">
- <tr><td>
- 请选择接下来的操作:<font color="red">(系统在3秒后将自动转向您刚发表的投票主题)</font>
- <br><a href="voteview.asp?id=<% =vtid %>"><img src="img/icn_go.gif" border="0">返回您刚发表的投票主题</a>
- <br><a href="talkbook.asp"><img src="img/icn_go.gif" border="0">返回[班级讨论区]</a>
- <br><a href="index.asp"><img src="img/icn_go.gif" border="0">返回首页</a>
- </td></tr>
- </table>
- </td>
- </tr></table>
- <script defer language="javascript">
- setTimeout('location.href="voteview.asp?id=<% =vtid %>"',3000);
- </script>
- <br>
- <!--插入在线统计-->
- <!--#include file="in_online.asp"-->
- <!--插入网站置底-->
- <!--#include file="in_bottom.asp"-->
- </body>
- </html>