Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

连续回帖自动改为在上面一楼追加【实用·长帖自动不追加·版块黑白名单】

[复制链接]
小残 发表于 2009-7-30 21:00:02 | 显示全部楼层
貌似点回复,把标题修改了就无效了
回复

使用道具 举报

ice528 发表于 2009-12-9 16:41:11 | 显示全部楼层
升级到7.2吧
回复

使用道具 举报

seahog004 发表于 2011-1-21 11:38:23 | 显示全部楼层
谢谢,很实用的插件!
回复

使用道具 举报

seahog004 发表于 2011-1-21 20:18:44 | 显示全部楼层
虽然这帖子年代比较久远了,但还是发下我的心得吧
楼主这个插件有个缺陷,就是可以无限插入,不受帖子长度限制,因此我改进为如下:
  1.                 //连续回复自动合并 by wxyuan90 add
  2.                 $_insertword = "\n\n[b]$discuz_user 于 ".date("$dateformat $timeformat", $timestamp)." 补充以下内容:[/b]\n\n";//追加内容前缀
  3.                 $_maxlength = 80;//字符数大于此值则一律不合并,注意1中文=2字符(GBK)或3字符(UTF)
  4.                 $_reducesmile = 1;//设为1=去除表情之后计算字数,0=否
  5.                 $_reducequote = 1;//设为1=去除引用之后计算字数,0=否
  6.                 $_reducespace = 1;//设为1=去除空白换行之后计算字数,0=否
  7.                 $_blackfids = array();//版块FID黑名单,此名单内不进行合并
  8.                 $_whitefids = array();//版块FID白名单,此名单内进行合并,黑白名单同时存在时白名单无效
  9.                 //设置部分结束
  10.                 if($_blackfids && $_whitefids) unset($_whitefids);
  11.                 $temp = $message;
  12.         if(is_array($smilies))if($_reducesmile) foreach($smilies as $sm) {
  13.                 $temp = str_replace($sm['code'], '', $temp);        
  14.         }
  15.         if($_reducequote) $temp = preg_replace("/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is", '', $temp);
  16.         if($_reducespace) $temp = preg_replace("/\s/is", '', $temp);
  17.         $temp = trim($temp);
  18.         $length = strlen($temp);
  19.         unset($temp);
  20.         if($length <= $_maxlength && (!$_blackfids || !in_array($fid, $_blackfids)) && (!$_whitefids || in_array($fid, $_whitefids))) {
  21.                 $q = $db->query("SELECT authorid, pid, message FROM {$tablepre}posts WHERE tid='$tid' ORDER BY pid DESC LIMIT 1");
  22.                 $q = $db->fetch_array($q);
  23.                 if($q['authorid'] == $discuz_uid && strlen($q['message'].$_insertword.$message) <= $_DCACHE['settings']['maxpostsize'] && !$attachment && !$isanonymous) {
  24.                         $message = $_insertword . $message;
  25.                         $db->query("UPDATE {$tablepre}posts SET smileyoff = 0, bbcodeoff = 0, message = CONCAT(message, '$message') WHERE pid='{$q['pid']}'");
  26.                         showmessage('post_reply_succeed', "viewthread.php?tid=$tid&pid={$q[pid]}&page=".(@ceil(($thread['special'] ? $thread['replies'] : $thread['replies'] + 1) / $ppp))."&extra=$extra#pid{$q[pid]}");
  27.                 }
  28.         }
  29.         //连续回复自动合并 by wxyuan90 end
  30.         //2011.01.21修改 by seahog004
复制代码
回复

使用道具 举报

wingwolf 发表于 2012-10-20 12:17:49 | 显示全部楼层
虽然时隔久远,但还是应该来顶一下~

LZ的这个代码实在是太好用了
7.2测试可以用

谢谢LZ{:soso_e100:}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-22 13:41 , Processed in 0.110144 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表