Bo-Blog留言评论提醒插件
此插件不是我制作的,是Gently制作的,此次修改并未征得他同意,仅为自己学习修改的
一个插件是访客留言评论提醒博主,其实这个插件就是论坛的SMS2,不过由于输出的邮件过分简单,只有评论内容,没有具体的哪一篇文章,看着很不爽,所以自己修改了下,不过鄙人没学过PHP,只是用C++的感觉去修改的,后台的控制面板没了,非常简单,SPAM的过滤也没了,所以仅供自己学习修改自用
首先备份文件夹下的mod_visit.php,打开修改,找到下面代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | if ($job=='addreply') { //Is a reply $plusquery_c="'{$v_id}', "; $targettable="{$db_prefix}replies"; $currentmaxid=$maxrecord['maxrepid']+1; $alter_column='maxrepid'; $replies_now=$originblog['replies']+1; if ($suspectspam!=1) { //Not a spam $blog->query("UPDATE `{$db_prefix}blogs` SET `replies`='{$replies_now}' WHERE `blogid`='{$v_id}'"); $count_new=$statistics['replies']+1; $blog->query("UPDATE `{$db_prefix}counter` SET `replies`='{$count_new}'"); } } elseif ($job=='addmessage') { // Is a message $plusquery_c=''; $targettable="{$db_prefix}messages"; $currentmaxid=$maxrecord['maxmessagepid']+1; $alter_column='maxmessagepid'; if ($suspectspam!=1) { //Not a spam $blog->query("UPDATE `{$db_prefix}counter` SET `messages`=`messages`+1"); } |
修改为
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | if ($job=='addreply') { //Is a reply $plusquery_c="'{$v_id}', "; $targettable="{$db_prefix}replies"; $currentmaxid=$maxrecord['maxrepid']+1; $alter_column='maxrepid'; $replies_now=$originblog['replies']+1; if ($suspectspam!=1) { //Not a spam $blog->query("UPDATE `{$db_prefix}blogs` SET `replies`='{$replies_now}' WHERE `blogid`='{$v_id}'"); $count_new=$statistics['replies']+1; $blog->query("UPDATE `{$db_prefix}counter` SET `replies`='{$count_new}'"); $rep_type="评论"; include_once 'plugin/sms2/visitorsubmit.php'; } } elseif ($job=='addmessage') { // Is a message $plusquery_c=''; $targettable="{$db_prefix}messages"; $currentmaxid=$maxrecord['maxmessagepid']+1; $alter_column='maxmessagepid'; if ($suspectspam!=1) { //Not a spam $blog->query("UPDATE `{$db_prefix}counter` SET `messages`=`messages`+1"); $rep_type="留言"; include_once 'plugin/sms2/visitorsubmit.php'; } |
然后下载压缩包解压后,修改压缩包里的visitorsubmit.php,主要是修改发送邮件的设置,就是改为你的邮箱的SMTP服务器,用户名和密码,不过也可以自己修改邮件内容样式,修改好后,上传到plugin文件夹安装就行
sms2.rar
下面这个是很多Bo-Blog用户一直很想要的插件,博主回复留言后,发送邮件到留言者信箱提示已经有回复,增加回访率
这个插件还是Gently制作的,不过由于没有制作完善,所以没有发布,我是个人找他要的,我没能力修改处有后台,不过修改下源文件就能用,还是很不错的
备份admin文件夹下的cp_message.php,打开修改,找到下面代码
1 2 3 4 5 6 | if ($job=='editadminreply'){ $queryplus="`adminrepeditorid`='{$userdetail['userid']}', `adminrepeditor`='{$userdetail['username']}', `adminrepedittime`='{$currenttime}'"; } else{ $queryplus="`adminreplier`='{$userdetail['username']}', `adminrepid`='{$userdetail['userid']}',`adminreptime`='{$currenttime}'"; } |
修改为
1 2 3 4 5 6 7 8 | if ($job=='editadminreply'){ $queryplus="`adminrepeditorid`='{$userdetail['userid']}', `adminrepeditor`='{$userdetail['username']}', `adminrepedittime`='{$currenttime}'"; } else{ $queryplus="`adminreplier`='{$userdetail['username']}', `adminrepid`='{$userdetail['userid']}',`adminreptime`='{$currenttime}'"; $rep_type="留言"; include_once 'plugin/pushmail/sendmail.php'; } |
先备份admin文件夹下的cp_reply.php,打开修改,找到下面代码
1 2 3 4 5 6 | if ($job=='editadminreply'){ $queryplus="`adminrepeditorid`='{$userdetail['userid']}', `adminrepeditor`='{$userdetail['username']}', `adminrepedittime`='{$currenttime}'"; } else{ $queryplus="`adminreplier`='{$userdetail['username']}', `adminrepid`='{$userdetail['userid']}',`adminreptime`='{$currenttime}'"; } |
修改为
1 2 3 4 5 6 7 8 | if ($job=='editadminreply'){ $queryplus="`adminrepeditorid`='{$userdetail['userid']}', `adminrepeditor`='{$userdetail['username']}', `adminrepedittime`='{$currenttime}'"; } else{ $queryplus="`adminreplier`='{$userdetail['username']}', `adminrepid`='{$userdetail['userid']}',`adminreptime`='{$currenttime}'"; $rep_type="评论"; include_once 'plugin/pushmail/sendmail.php'; } |
修改好上面两个文件后,下载安装包,修改压缩包里的sendmail.php文件,主要是修改发送邮件的设置,就是改为你的邮箱的SMTP服务器,用户名和密码,不过也可以自己修改邮件内容样式,修改好后上传到plugin文件夹,不需要安装,直接使用了
这两个插件仅为自己学习修改用,如使用出错,造成一切损失本站概不负责
第一个插件,接口是我自己一个一个试出来的,之前没做过插件,也没看过插件制作文档,所以不知道怎么在游客权限获得评论ID,如有高手看到,愿意的话完善下,非常感谢
作者:小峰JoysBoy@小峰网络遨游记
原文地址:http://blog.joysboy.net/bo-blogl-comments-and-message-e-mai-remind/
本博客原创文字只代表本人某一时间内的观点或结论,与本人所在公司没有任何关系。
第三方若用于商业用途的转载,须取得本人授权。
Gravatar头像必须读取邮箱、这个我明白的、因为我所有的油箱都弄了Gravatar 在贵站显示得好好的、如果后台没错的话、那我想是模板有问题了、不知道如何加入、
还有哦、我昨天在留言、有些油箱的、是QQ油箱、我怎么没有收到妳的回复呢?我今天是故意来的、难道这插件不起着用了么?
路过看看,鼓励下……
谢谢支持啊
回覆文章時出現:
未知的操纵类型Invalid address: You must provide at least one recipient email address. send mail to success
為什麼?
我已经没使用BoBlog了,这个本来就是半成品,问题很多
刚才的错误是没有定义邮箱,可能是没填邮箱吧
还有BoBlog论坛已经有人把这个插件完善了,你可以去看看
123123123
请问你这条什么意思?来测试吗?
SMTP Error: Could not connect to SMTP host. send mail to boss@simplove.me success
我的一直都是这个提示
不知道是什么意思
gmail QQ 163的我换了好几个都是这种提示
博主你知道是什么问题吗?
不好意思,最近复习,一直没电脑,今天菜看到你的留言,插件不是我做的,我只是自己稍加修改用了,我以前看到在bob论坛已经有人做成安装的插件了,那个可能稳定点