找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 202|回复: 0

[cms教程] discuz x帖子内容[attach]转html

[复制链接]

该用户从未签到

发表于 2019-4-5 14:55:00 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

×
   
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...

   
内容已隐藏,请关注公众号输入验证码查看

               
验证码 

  

本帖支持关注公众号查看

【无套路  无套路  无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】

回复

使用道具 举报

网站地图|页面地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2025-6-23 05:13

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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