?? talk_votedeal.asp
字號(hào):
<!--插入html頭部分以及數(shù)據(jù)庫接口-->
<!--#include file="in_conn.asp"-->
<!--插入時(shí)間id的函數(shù)-->
<!--#include file="in_idtime.asp"-->
<!--獲取發(fā)布內(nèi)容字?jǐn)?shù)限制-->
<!--#include file="in_talksize.asp"-->
<body>
<!--插入網(wǎng)站置頂-->
<% if u_name="" then
Response.Redirect "log_err.asp"
else
%>
<!--#include file="in_topmb.asp"-->
<% end if %>
<%
'判斷用戶權(quán)限
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"))
vkind=Request.Form("hid_kind")
'版面是否存在
dim kind_name
IF isNumeric(Request.Form("hid_kind")) THEN
vkind=CLng(vkind)
'找出該版面的相關(guān)信息
sqlstr="SELECT kd_name FROM tblkind WHERE kd_ID="&vkind
rs.open sqlstr,conn,1,1
if rs.eof AND rs.bof then
Response.Redirect "resp.asp?cmd=kindmiss"
else
kind_name=rs("kd_name")
end if
rs.close
ELSE
Response.Redirect "resp.asp"
END IF
'檢查正確性
IF vtopic="" OR vcontent="" OR LEN(vtopic)>50 OR LEN(vcontent)>DEF_talksize*1024 THEN
response.Redirect "resp.asp"
END IF
'檢查投票選項(xiàng)
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
'檢查選項(xiàng)是否大于2項(xiàng)
if opcount<2 then
Response.Redirect "resp.asp?cmd=vote2op"
end if
'檢查是否重復(fù)發(fā)文
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
'處理時(shí)間
dim vidfre
dim vtdate
vtdate=now()
vidfre=idtime(vtdate)
'插入數(shù)據(jù)
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,t_kind) VALUES('"&u_name&"','"&stryin(vtopic)&"','"&stryin(vcontent)&"',#"&vtdate&"#,False,1,"&vidfre&",'"&u_name&"',0,0,"&vemo&","&vkind&")"
conn.Execute sqlstr
'獲得新記錄的id
dim vtid
vtid=conn.Execute("SELECT t_ID FROM tbltalk WHERE t_idfre="&vidfre,0,1)(0)
'插入選項(xiàng)
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
'更新版面相關(guān)信息
sqlstr="UPDATE tblkind SET kd_topic=kd_topic+1,kd_upd=#"&vtdate&"# WHERE kd_ID="&vkind
conn.Execute sqlstr
'更新你的發(fā)水量
sqlstr="UPDATE tblmates SET cnt_water=cnt_water+1 WHERE ID="&u_ID
conn.Execute sqlstr
%>
恭喜:發(fā)表主題成功!
<table align="center" width="400" height="25" border="0">
<tr><td>
請(qǐng)選擇接下來的操作:<font color="red">(系統(tǒng)在3秒后將自動(dòng)轉(zhuǎn)向您剛發(fā)表的投票主題)</font>
<br><a href="voteview.asp?id=<% =vtid %>"><img src="img/icn_go.gif" border="0">返回您剛發(fā)表的投票主題</a>
<br><a href='talklist.asp?kind=<% =vkind %>'><img src="img/icn_go.gif" border="0">返回到 <% =unhtml(kind_name) %></a>
<br><a href="talkbook.asp"><img src="img/icn_go.gif" border="0">返回[班級(jí)討論區(qū)]</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>
<!--插入在線統(tǒng)計(jì)-->
<!--#include file="in_online.asp"-->
<!--插入網(wǎng)站置底-->
<!--#include file="in_bottom.asp"-->
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -