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

📄 postfo.asp

📁 一个不错的论坛原代码
💻 ASP
📖 第 1 页 / 共 2 页
字号:
 
if r_email<>"" and isemail=0 then 
 sqlreplynum=sqlreplynum&" ,t_email=t_email&'"&cpbusername&","&"'"
 elseif r_email="" and isemail=1 then
 t_email1=replace(t_email,cpbusername,"")
 sqlreplynum=sqlreplynum&" ,t_email='"&t_email1&"'"
end if

if not isnull(t_email) and t_email<>"" then
t_email1=split(t_email,",")
admina="admin"
q_content="你在"&rstt("t_time")&"订阅的主题《"&rstt("t_title")&"》已经有了新回复,请前去[url=topic.asp?l_id="&rstt("l_id")&"&t_id="&rstt("t_id")&"]看看[/url]"
q_title="订阅的主题新回复通知"

for i=0 to (ubound(t_email1))
if t_email1(i)<>cpbusername and t_email1(i)<>"" then
 sqlpm="insert into pm (q_receive,q_title,q_content,q_send) values('"&t_email1(i)&"','"&q_title&"','"&q_content&"','"&admina&"')"
conn.Execute(sqlpm)
end if

next
end if

end if
sqlreplynum=sqlreplynum&"  where t_id="&chktopic(request.querystring("t_id"))&""

 conn.Execute (sqlreplynum)
 

set rstt=nothing

'清空上传限制
session("upcount")=""

  sqlnum="update total set r_num=r_num+1,h_replytoday=h_replytoday+1"
 conn.Execute (sqlnum)

  sqllanmu="update lanmu set l_count= l_count+1  where l_id="&l_id&""
 conn.Execute (sqllanmu)
  sqluser1="update user set u_todaysend=u_todaysend+1, send=send+1,fen=fen+"&r_fen&",u_beauty=u_beauty+"&h_replybeauty&",u_money=u_money+"&h_replymoney&", lastsend='"&HTMLEncode(r_title)&"',lastsendtime='"&nowtime&"'  where username='"&r_username&"'"
 conn.Execute (sqluser1)
 
Session("LastPostTime")=nowtime

sqluser2="select grade,fen,send from user  where username='"&r_username&"'"
set rsuser2=conn.Execute (sqluser2)
  if not rsuser2.eof then
 rsg=rsuser2("grade")-1
if rsuser2("grade")=<4 then
 response.redirect"postfo.asp?t_id="&request.querystring("t_id")&"&l_id="&request.querystring("l_id")&"&action=do"
 end if
 sqlgrade1="select * from grade  where g_num="&rsg&""
 set rsgrade1=conn.Execute (sqlgrade1)
if rsuser2("fen")<rsgrade1("g_fen") then
response.redirect"postfo.asp?t_id="&request.querystring("t_id")&"&l_id="&request.querystring("l_id")&"&action=do"
end if
sqlgrade2="update user set grade= grade-1  where username='"&r_username&"'"
conn.Execute (sqlgrade2)
end if
response.redirect"postfo.asp?t_id="&request.querystring("t_id")&"&l_id="&request.querystring("l_id")&"&action=do"

'编辑主题
Elseif  request.querystring("action")="edit" then
if issupermaster=false and ismaster=false and isbanzhu=false then
sqlchecadmin="select l_id,t_email,t_username from topic where t_id="&chktopic(request.querystring("t_id"))&" and t_username='"&cpbusername&"'"
set rschecadmin=conn.execute(sqlchecadmin)
if  (rschecadmin.eof or rschecadmin.bof) then
errornum=1
errormsg="<Li>很抱歉,您没有权限操作,请确认您是管理员,或者是总版主,或者是该版块的版主,或者是主题原作者</li>"
else
topic_username=rschecadmin("t_username")
t_email1=rschecadmin("t_email")
l_idd=rschecadmin("l_id")
end if
else
'写出作者
sqlchecadmin="select l_id, t_username,t_email from topic where t_id="&request.querystring("t_id")&""
set rschecadmin=conn.execute(sqlchecadmin)
if  not (rschecadmin.eof or rschecadmin.bof) then
 topic_username=rschecadmin("t_username")
 t_email1=rschecadmin("t_email")
 l_idd=rschecadmin("l_id")
set rschecadmin=nothing
end if
end if


if errornum<>1 and issupermaster=false and ismaster=false then
if int(l_idd)<>int(chktopic(request.querystring("l_id"))) then
errornum=1
errormsg="<Li>很抱歉,您没有权限操作,请确认您是管理员,或者是总版主,或者是该版块的版主,或者是主题原作者</li>"
end if
end if 

if errornum=1 then
call error(errormsg)
call bq()
response.end
end if





f3_content=chktopic(request.form("f3_content"))
t_lastedit1="<br><i>本主题由 "& cpbusername & " 编辑于 " & nowtime &"</i>"

if  f3_content=""  then
errornum=1
errormsg=errormsg&"内容不能为空</li>"
end if
if  len(f3_content)<h_lesstopic then
errornum=1
errormsg=errormsg&"内容不能少于"&h_lesstopic&"个字符</li>"
end if
if  len(f3_content)>t_size then
errornum=1
errormsg=errormsg&"内容不能超过"&t_size&"个字符</li>"
end if
if errornum=1 then
call error(errormsg)
call bq()
response.end
end if

t_email=chktopic(request.form("t_email"))
t_autourl=chktopic(Request.Form("t_autourl"))
t_sign=chktopic(Request.Form("t_sign"))
if t_sign="" then t_sign=1
if t_autourl="" then t_autourl=0
t_lockubb=chktopic(Request.Form("t_lockubb"))
if t_lockubb="" then t_lockubb=0
f3_motif=chktopic(request.form("f3_motif"))
t_face=chktopic(Request.Form("f3_face"))
if f3_motif=""  then 
errornum=1
errormsg="<li>主题不能为空</li>"
end if
if len(f3_motif)>30 then
errornum=1
errormsg=errormsg&"<li>主题不能超过30个字符</li>"
end if



isemail=0

if instr(t_email1,cpbusername)>0 then
isemail=1
end if
 
 sqlreplynum="update topic set t_sign="&t_sign&",t_autourl="&t_autourl&",t_lockubb="&t_lockubb&",t_title='"&f3_motif&"',t_content= '"&f3_content&"',t_lastedit='"&t_lastedit1&"',t_face='"&t_face&"'"
 
if t_email<>"" and isemail=0 then 
 sqlreplynum=sqlreplynum&" ,t_email=t_email&'"&cpbusername&","&"'"
 elseif t_email="" and isemail=1 then
 t_email1=replace(t_email,cpbusername,"")
 sqlreplynum=sqlreplynum&" ,t_email='"&t_email1&"'"
end if

sqlreplynum=sqlreplynum&"  where t_id="&chktopic(request.querystring("t_id"))&""
 conn.Execute (sqlreplynum)

 

response.redirect"postfo.asp?t_id="&request.querystring("t_id")&"&l_id="&request.querystring("l_id")&"&action=do"

'编辑回复贴
Elseif  request.querystring("action")="editreply" then
if issupermaster=false and ismaster=false and isbanzhu=false then
sqlchecadmin="select l_id,r_username from reply where r_id="&chktopic(request.querystring("r_id"))&" and r_username='"&cpbusername&"'"
set rschecadmin=conn.execute(sqlchecadmin)
if  (rschecadmin.eof or rschecadmin.bof) then
errornum=1
errormsg="<Li>很抱歉,你没有权限操作,请确认你是总版主,或者是该版块的版主,或者是主题原作者</li>"
else
l_idd=rschecadmin("l_id")
end if
set rschecadmin=nothing
end if

if errornum<>1 and issupermaster=false and ismaster=false  then
sqlchecadmin="select l_id from reply where r_id="&chktopic(request.querystring("r_id"))&""
set rschecadmin=conn.execute(sqlchecadmin)
l_idd=rschecadmin("l_id")
if int(l_idd)<>int(chktopic(request.querystring("l_id"))) then
errornum=1
errormsg="<Li>很抱歉,您没有权限操作,请确认您是管理员,或者是总版主,或者是该版块的版主,或者是主题原作者</li>"
end if
end if 

if errornum=1 then
call error(errormsg)
call bq()
response.end
end if

dell=request("dell")
if dell="1" then
sql="select l_id,r_username,r_title,t_id from reply where  r_id="&chktopic(request.querystring("r_id"))&""
set rs=conn.execute(sql)
if not rs.eof then
r_username=rs("r_username")
e_content="删除回复帖:"&htmlencode(rs("r_title"))
t_id=rs("t_id")
l_id=rs("l_id")
end if
set rs=nothing

'写进事件
sql="insert into even (e_lanmu,e_topic,e_ip,e_time,e_content,e_username,e_admin) values ("&l_id&","&t_id&",'"&o_ip&"','"&nowtime&"','"&e_content&"','"&r_username&"','"&cpbusername&"')"
conn.execute(sql)
sqluser1="update user set u_deltopic=u_deltopic+1,fen=fen-"&h_delfen&",u_beauty=u_beauty-"&h_delbeauty&",u_money=u_money-"&h_delmoney&" where username='"&r_username&"'"
conn.Execute (sqluser1)
sqll="delete * from reply where r_id="&chktopic(request.querystring("r_id"))&""
conn.execute(sqll)

 sqlnum="update total set r_num=r_num-1"
 conn.Execute (sqlnum)
 sqllanmu="update lanmu set l_count= l_count-1  where l_id="&chktopic(request.querystring("l_id"))&""
 conn.Execute (sqllanmu)
 sqllanmu="update topic set t_replynum= t_replynum-1  where t_id="&chktopic(request.querystring("t_id"))&""
 conn.Execute (sqllanmu)
 else
 sql="select r_username from reply where  r_id="&chktopic(request.querystring("r_id"))&""
set rs=conn.execute(sql)
if not rs.eof then
reply_username=rs("r_username")
end if

 
 tt_id=chktopic(request.querystring("t_id"))
 rr_usrname=cpbusername
 r_email=chktopic(Request.Form("t_email"))
 t_autourl=chktopic(Request.Form("t_autourl"))
 t_sign=chktopic(Request.Form("t_sign"))
 if t_sign="" then t_sign=1
 t_lockubb=chktopic(Request.Form("t_lockubb"))
 if t_lockubb="" then t_lockubb=0
 if t_autourl="" then t_autourl=0
r_face=chktopic(request("f3_face"))
if r_face="" then r_face="icon/1.gif"
 r_title=chktopic(trim(request.form("f3_motif")))
 f3_content=chktopic(request.form("f3_content"))
 t_lastedit1="<br><i>本回复由 "& cpbusername & " 编辑于 " & nowtime &"</i>"
 if  r_title=""  then
 errornum=1
 errormsg=errormsg&"<Li>回复标题不能为空</li>"
 end if
  if  len(r_title)>30  then
 errornum=1
 errormsg=errormsg&"<Li>回复标题不能为超过30个字符</li>"
 end if
 if  f3_content=""  then
errornum=1
errormsg=errormsg&"<Li>内容不能为空</li>"
end if
if  len(f3_content)<h_lesstopic then
errornum=1
errormsg=errormsg&"<Li>内容不能少于"&h_lesstopic&"个字符</li>"
end if
if  len(f3_content)>t_size then
errornum=1
errormsg=errormsg&"<Li>内容不能超过"&t_size&"个字符</li>"
end if
if errornum=1 then
call error(errormsg)
call bq()
response.end
end if


   sqllanmu="update reply set t_sign="&t_sign&", r_content= '"&f3_content&"',t_lastedit='"&t_lastedit1&"',t_autourl="&t_autourl&",t_lockubb="&t_lockubb&" ,r_title='"&r_title&"' ,r_face='"&r_face&"'  where r_id="&chktopic(request.querystring("r_id"))&""
 conn.Execute (sqllanmu) 
  end if
  
  sqlchecadmin="select t_email from topic where t_id="&chktopic(request.querystring("t_id"))&""
set rschecadmin=conn.execute(sqlchecadmin)
if  not (rschecadmin.eof or rschecadmin.bof) then
 t_email1=rschecadmin("t_email")
end if

 set rschecadmin=nothing 
 
  isemail=0
if instr(t_email1,cpbusername)>0 then
isemail=1
end if
 

if r_email<>"" and isemail=0 then 
 sqlreplynum="update topic set t_email=t_email&'"&cpbusername&","&"'  where t_id="&chktopic(request.querystring("t_id"))&" "
   conn.Execute (sqlreplynum)
 elseif r_email="" and isemail=1 then
 t_email1=replace(t_email,cpbusername,"")
 sqlreplynum="update topic set t_email='"&t_email1&"' where t_id="&chktopic(request.querystring("t_id"))&""
  conn.Execute (sqlreplynum)
end if






 response.redirect"postfo.asp?t_id="&request.querystring("t_id")&"&l_id="&request.querystring("l_id")&"&action=do"

'发表成功
Elseif  request.querystring("action")="do" then
set rs_reply = server.createobject("adodb.recordset") 
sql = "select r_id from reply where t_id="&chktopic(request.querystring("t_id"))&""
rs_reply.open sql,conn,1,1
if not(rs_reply.BOF or rs_reply.EOF) then
rs_reply.pagesize = r_page 
maxpagecount=rs_reply.pagecount
end if
%>
<center>
<table border=1 borderColor=<%=tdc2%> cellPadding=2 cellSpacing=1 width=<%=tdc3%> style="border-collapse: collapse">
    <TR><td <%=tColor%> class=tdc1 height=20>
    <p align="center">
    操作成功
    </p>
    </td>
     </tr>
      <td bgcolor=<%=tColor2%> class=tdc height=46>
     <BR>
    <p align="center">
    操作成功!感谢你的参与(5秒钟后将自动返回主题)</p>
    <p align="center"><a href="index.asp">返回论坛</a>
    <br>
    <br>
    <a href="list.asp?l_id=<%=request.querystring("l_id")%>">返回栏目</a>
    <br>
    <br>
    <a href="topic.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=request.querystring("t_id")%>">返回主题</a> 

  <%  if maxpagecount="" then maxpagecount=1
            if r="" then r=0
            if maxpagecount>1 then
pagestart=page-5
pageend=page+5
if pagestart<1 then pagestart=1
if pageend>maxpagecount then pageend=maxpagecount
response.write(" [ ")
if maxpagecount > 6 then Response.Write ("<a href=topic.asp?l_id="&request.querystring("l_id")&"&t_id="&request.querystring("t_id")&"&page=1>1</a> ... ")
for i=pagestart to pageend
if i<>int(page) then
Response.Write (" <a href=topic.asp?l_id="&request.querystring("l_id")&"&t_id="&request.querystring("t_id")&"&page="&i&">" & i & "</a> ")
else
Response.Write ("<b>"&i&"</b> ")
end if
next
if maxpagecount > page +5 then Response.Write( " ... <a href=topic.asp?l_id="&request.querystring("l_id")&"&t_id="&request.querystring("t_id")&"&page="&maxpagecount&">"&maxpagecount&"</a>")
response.write(" ] ")
end if
%><br>
     </td>
    </tr>

      <script language=javascript>
 setTimeout("location.replace('topic.asp?l_id=<%=request.querystring("l_id")%>&t_id=<%=request.querystring("t_id")%>&page=<%=maxpagecount%>')",5000)
             </script>
    </table>  
   <%end if%><!--#include file="bq.asp" -->





⌨️ 快捷键说明

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