再加一个管理组不受限制,嘿嘿~~~- //连续回复自动合并 by wxyuan90 add
- if (!in_array($adminid, array(1,2,3))){//可以在这里设置不受此限制的管理组id(1管理员2超版3普版-1特殊)
- $_insertword = "\n\n[b][color=Red]$discuz_userss 于 ".date("$dateformat $timeformat", $timestamp)." 补充以下内容[/color]
- [/b]\n\n";//追加内容前缀
- $_maxlength = 10;//字符数大于此值则一律不合并,注意1中文=2字符(GBK)或3字符(UTF)
- $_reducesmile = 1;//设为1=去除表情之后计算字数,0=否
- $_reducequote = 1;//设为1=去除引用之后计算字数,0=否
- $_reducespace = 1;//设为1=去除空白换行之后计算字数,0=否
- //设置部分结束
- $temp = $message;
- if(is_array($smilies))if($_reducesmile) foreach($smilies as $sm) {
- $temp = str_replace($sm['code'], '', $temp);
- }
- if($_reducequote) $temp = preg_replace("/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is", '', $temp);
- if($_reducespace) $temp = preg_replace("/\s/is", '', $temp);
- $temp = trim($temp);
- $length = strlen($temp);
- unset($temp);
- if($length <= $_maxlength) {
- $q = $db->query("SELECT authorid, pid FROM {$tablepre}posts WHERE tid='$tid' ORDER BY pid DESC LIMIT 1");
- $q = $db->fetch_array($q);
- if($q['authorid'] == $discuz_uid && !$attachment && !$isanonymous) {
- $message = $_insertword . $message;
- $db->query("UPDATE {$tablepre}posts SET bbcodeoff = 0, message = CONCAT(message, '$message') WHERE
- pid='{$q['pid']}'");
- 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]}");
- }
- }
- }
- //连续回复自动合并 by wxyuan90 end
复制代码
[ 本帖最后由 小小新 于 2008-8-18 02:39 编辑 ] |