赞 | 65 |
VIP | 397 |
好人卡 | 580 |
积分 | 22 |
经验 | 311270 |
最后登录 | 2022-3-9 |
在线时间 | 4033 小时 |
Lv3.寻梦者 (版主) …あたしは天使なんかじゃないわ
- 梦石
- 0
- 星屑
- 2208
- 在线时间
- 4033 小时
- 注册时间
- 2010-10-4
- 帖子
- 10779
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 taroxd 于 2015-1-31 08:23 编辑
@小传子
注意,fuck_code 只修改了 code 代码框的内容,而没有考虑 pre 代码框。请小传子加上 pre 代码框的处理。
在 source/class/extend/extend_thread_allowat.php 中:
在每个- foreach($this->atlist as $atuid => $atusername) {
复制代码 前面调用- $this->fuck_code($parameters);
复制代码 在每个- $this->param['message'] = substr($this->param['message'], 0, strlen($this->param['message']) - 1);
复制代码 后面调用- $this->fuck_code_again();
复制代码 两个函数的定义如下:
- public function fuck_code(&$param) {
- $param['message'] = preg_replace_callback(
- '/(\[code\][\s\S]+?\[\/code\])/i',
- function ($matches) {
- return str_replace('@', 'The string serves as "at"', $matches[0]);
- },
- $param['message']
- );
- }
- public function fuck_code_again() {
- $this->param['message'] = str_replace('The string serves as "at"', '@', $this->param['message']);
- }
复制代码 |
评分
-
查看全部评分
|