discuz x帖子内容[attach]转html 之前用过 {echo discuzcode($value['message',, 0,0, 0] 1, 1, 0,0, 0,0, 0);} 或者 require_once libfile('function/discuzcode'); {echo discuzcode($value['message',);} 能转大部分UBB,但是[attach]转不了。 下面是来自网络的代码,针对attach。 我用的时候做了一些修改。 fetch ( 'aid:' . $aid, $aid, array (1,- 1) )) { return get_lw_attach_path_str ( $attach ); } return $filename; } function get_lw_attach_path_str($attach) { global $_G; if (! $attach ['isimage',) { return '[url=,' . $attach ['filename', . '[/url]'; } if ($attach ['remote',) { $imgurl = $_G ['setting', ['ftp', ['attachurl', . 'forum/' . $attach ['attachment',; return ' [img][/img] '; } else { if (preg_match ( '/^(?!http:)/', $attach ['url', )) { $attach ['url', = $_G ['siteurl', . 'data/attachment/forum/' . $attach ['url',; } $imgurl = $attach ['url', . $attach ['attachment', . ($_G ['gp_width', ? '&width=' . $_G ['gp_width', : '') . ($_G ['gp_height', ? '&height=' . $_G ['gp_height', : ''); return '[url...
内容已隐藏,请关注公众号输入验证码查看
本帖支持关注公众号查看
【无套路 无套路 无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】
|