增加贴子回复站内短信或邮件通知的方法


第一步、执行sql语句

Code:
alter table bbs_data add emailflag int null 'bbs_data表中添加字段emailflag
update bbs_data set emailflag=2 '将原来的贴子的回复通知初始值设为2,即站内短信通知模式


地二步、forum_write.asp
1、在

Code:
sub forum_write_chk()

下边 添加

Code:
dim emailflag

2、在77行左右

Code:
tcolor=trim(request.form("tcolor"))

下边添加  

Code:
emailflag=request.form("emailflag")

3、在122行左右

Code:
rs("sys")=user_sys

下边添加

Code:
rs("emailflag")=emailflag

4、在293行左右
改:

Code:
<% if int(login_modep)=1 then %>
<tr class=bg_td>
<td>高级选项:</td>
<td><input type=checkbox name=istop value='yes' class=bg_td> 固顶 <input type=checkbox name=istops value='yes' class=bg_td> 总固顶 <input type=checkbox name=isgood value='yes' class=bg_td> 精华 <input type=checkbox name=islock value='yes' class=bg_td> 锁定</td>
</tr>
<% end if %>

为:

Code:
<tr class=bg_td>
<td>高级选项:</td>
<td><input type="radio" name=emailflag value="0" checked>不通知
<input type="radio" name=emailflag value="1" >邮件通知
<input type="radio" name=emailflag value="2" >短信通知
<input type="radio" name=emailflag value="3" >邮件和短信通知
<% if int(login_modep)=1 then %>
<input type=checkbox name=istop value='yes' class=bg_td> 固顶 <input type=checkbox name=istops value='yes' class=bg_td> 总固顶 <input type=checkbox name=isgood value='yes' class=bg_td> 精华 <input type=checkbox name=islock value='yes' class=bg_td> 锁定
<% end if %>
</td></tr>



第三步、文件forum_edit.asp

1、在21行下面添加

Code:
dim emailflag

2、在61行左右

Code:
tim=rs("tim")

下边添加

Code:
emailflag=rs("emailflag")

3、在104行左右

Code:
word=request.form("jk_word")

下面添加

Code:
emailflag=request.form("emailflag")

4、在138行左右

Code:
rs("word")=word&word_edit

下面添加

Code:
rs("emailflag")=emailflag


5、在224行左右
改:

Code:
<% if int(login_modep)=1 then %>
<tr class=bg_td>
<td>高级选项:</td>
<td><input type=checkbox name=edit_info value='yes' class=bg_td checked> 显示编辑信息  
<% if is_topic then %>
<input type=checkbox name=istop value='yes' class=bg_td<%if int(fir_istop)=1 then response.write " checked"%>> 固顶 <input type=checkbox name=istops value='yes' class=bg_td<%if int(fir_istop)=2 then response.write " checked"%>> 总固顶 <input type=checkbox name=isgood value='yes' class=bg_td<%if int(fir_isgood)=1 then response.write " checked"%>> 精华 <input type=checkbox name=islock value='yes' class=bg_td<%if int(fir_islock)=1 then response.write " checked"%>> 锁定
<% end if %>
</td>
</tr>
<% end if %>

为:

Code:
<tr class=bg_td>
<td>高级选项:</td>
<td><input type="radio" name=emailflag value="0" <%if int(emailflag)=0 then response.write " checked"%>>不通知
<input type="radio" name=emailflag value="1" <%if int(emailflag)=1 then response.write " checked"%>>邮件通知
<input type="radio" name=emailflag value="2" <%if int(emailflag)=2 then response.write " checked"%>>短信通知
<input type="radio" name=emailflag value="3" <%if int(emailflag)=3 then response.write " checked"%> >邮件和短信通知
<% if int(login_modep)=1 then %>
<input type=checkbox name=edit_info value='yes' class=bg_td checked> 显示编辑信息  
<% if is_topic then %>
<input type=checkbox name=istop value='yes' class=bg_td<%if int(fir_istop)=1 then response.write " checked"%>> 固顶 <input type=checkbox name=istops value='yes' class=bg_td<%if int(fir_istop)=2 then response.write " checked"%>> 总固顶 <input type=checkbox name=isgood value='yes' class=bg_td<%if int(fir_isgood)=1 then response.write " checked"%>> 精华 <input type=checkbox name=islock value='yes' class=bg_td<%if int(fir_islock)=1 then response.write " checked"%>> 锁定
<% end if %>
<% end if %>
</td>
</tr>


第四步、文件  forum_reply.asp

1、在

Code:
sub forum_reply_chk()

下面添加

Code:
dim emailflag

2、在83行左右  

Code:
word=request.form("jk_word")

下面添加  

Code:
emailflag=request.form("emailflag")

3、在118行左右  

Code:
rs("sys")=user_sys

下面添加
  
Code:
if emailflag="" then
    rs("emailflag")=0
  else
    rs("emailflag")=emailflag
  end if

4、在137行左右

Code:
application.unlock

下面添加

Code:
call forum_emailflag()

5、查找

Code:
<td> <%response.write jk_em("write_frm","jk_word")%></td>
</tr>

在下面添加


Code:
<tr class=bg_td>
<td>高级选项:</td>
<td><input type="radio" name=emailflag value="0" checked>不通知
<input type="radio" name=emailflag value="1" >邮件通知
<input type="radio" name=emailflag value="2" >短信通知
<input type="radio" name=emailflag value="3" >邮件和短信通知
</td>
</tr>

6、在文件顶部加上

Code:
<!-- #include file="include/jk_sendmail.asp" -->

7、在文件最后一个 %> 符号之前添加

Code:
sub forum_emailflag()
dim eemail,eusername,stit,sbody,rse
sql="select id,forum_id,reply_id,username,topic,emailflag from bbs_data where emailflag>0 and username<>'"&login_username&"' and reply_id="&viewid
call joekoe_cms.exec(sql,-1)
rs.open sql,conn,1,1
do while not rs.eof
  if rs("emailflag")=2 or rs("emailflag")=3 then
    call joekoe_cms.exec("insert into user_mail(accept_u,send_u,topic,word,tim,types,isread) values('"&rs("username")&"','"&web_dim(3)&"','系统信息:贴子回复通知!','您在论坛发表的贴子《"&rs("topic")&"》有新的回复请点击查看!','"&joekoe_cms.now_time&"',1,0)",0)
  end if
  if rs("emailflag")=1 or rs("emailflag")=3 then
    eusername=rs("username")
    sql="select email from user_data where username='"&eusername&"'"
    set rse=joekoe_cms.exec(sql,1)
      if not rse.eof then
      eemail=rse(0)
      rse.close
      stit="贴子回复通知!"
      sbody="您在论坛发表的贴子:"& _
        vbcrlf& _
        vbcrlf&"《"&rs("topic")&"》"& _
        vbcrlf& _
        vbcrlf& "有新的回复,请点击查看!"& _
        vbcrlf& _
        vbcrlf&""&joekoe_cms.web_urls&"forum_view.asp?forum_id="&rs("forum_id")&"&view_id="&rs("reply_id")&""
        call send_mail(eusername,eemail,stit,sbody)
      end if
    end if
  rs.movenext
loop
rs.close
end sub


[ads:view.banner]



http://www.joekoe.com/forum/view_100563.html

文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 540
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭