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/
本博客原创文字只代表本人某一时间内的观点或结论,与本人所在公司没有任何关系。
第三方若用于商业用途的转载,须取得本人授权。
第二个插件能用吗?试过。。好像不行啊?还是我的问题呢?
不好意思,一直没时间回复你,这个插件不知道现在还能不能用,我很早就转到wp了,不过我在bob论坛看到别人修改成安装的插件,你可以去论坛看看
我说你的博客名字很熟悉,原来的确来过。
以前用BOBLOG的时候,也用过你这插件,呵呵。
呵呵,你也是bob转wp的啊,这插件不是我做的,别人做的,只是我发出来了
我很多博友都是BOBLOG用户,我算是第一个试水wordpress的,结果很多人都跟过来了。
他们以前也都用过这个插件,呵呵。
这样啊,bob开发太慢了,我是个更新控,而且bob有很多限制了,所以去年转到了wp,开始不习惯,现在感觉很爽了
BOB毕竟只一个人开发嘛,从早出的3.0传说,一直到现在的2.5。
快半年了,还没更新。。
的确啊,个人开发这个不可能和团队比的,不过还是蛮支持bob的,一个人默默贡献,比较期待3.0
Good day!
Check out
an excellent search engine –
Warning: mysql_connect(): Too many connections in /var/www/html/helper.php on line 136
P.S. Yahoo – everything will be found! Google: nothing was really lost…
See you!
Now it works
呵呵,其实我也是瞎改瞎写的,我没学过PHP的
恩,第一个插件还是建议去论坛下载他的原版,我为了自定义提醒的样式修改了程序,那插件是提醒有人来评论了,意义不是太大第二个插件就是大家都想要的回复提醒,你试试看吧
貌似是正常的,还好,只是国内不能正常访问,可以继续使用
邮件必填是假的,我只是语言包里修改了,显示为必填,其实不填也行,但是为了有邮件回复和现实Gravatar头像,所以显示个必填,但还是有人不填,郁闷,在论坛发贴询问怎么修改程序也没人回复,链接已加
Gravatar头像必须读取邮箱,后台参数是http://www.gravatar.com/avatar.php?gravatar_id=没有错误,还有可能是模板问题,模板不支持显示头像,猜测吧
昨天你的邮箱填写是l25125@qq.com,我这个记录是发送了,也没收到退信通知,不知道是不是被QQ邮箱拦截了,郁闷下,很多人的邮箱都接受成功的,你的域名访问不了,本来想去给你留言的