返回列表 发帖

Discuz 6.1论坛屏蔽禁止URL超链接功能

在网上搜索了一番,只找到了一篇有点价值的文章,引用该文章局部文字:
==================================================================
最终修改位置如下:打开文件Discuz!_6.0.0_SC_UTF8\upload\include\discuzcode.func.php,把第161行,162行,163行的这三行代码:
????”/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/|callto:\/\/|bctp:\/

\/|ed2k:\/\/|thunder:\/\/|synacast:\/\/){1}([^\[\"']+?)\s*\[\/url\]/ie“,
????”/\[url=www.([^\[\"']+?)\](.+?)\[\/url\]/is”,
????”/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/([^\[\"']+?)\](.+?)

\[\/url\]/is”,

全部删除!删除后保存文件,上传覆盖掉空间里的这个文件,再次打开论坛帖子,你会发现原来的帖子和回复里的链接全部变成了这样子:  

url=http://www.baidu.com/]112[/url]
url=http://www.baidu.com/]112[/url]
  
也就是用户原先输入的超链接全部被屏蔽,不再显示为超链接,而是不做处理,原样输出了!  接着我发现有的用户签名里还是包含超链接

,这个好办,我记得论坛设置有屏蔽签名功能的。于是登录discuz后台管理,在系统设置首页-界面与显示方式下面找到了“是否显示作者签名

:”这个选项,选则否然后提交。再次刷新帖子,发现超链接没有了,签名也没有了,哈哈,所有垃圾回复里的链接全部没了。
==================================================================
嘎嘎~依样画葫芦,根本就不用那麻烦,删除一个关键词即可。

论坛版本:Discuz_60_SC_GBK
修改路径:根目录\include\discuzcode.func.php
修改步骤:
1、用Dreamweaver8打开discuzcode.func.php
2、搜索“https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast”,总共找到2处

第117行
        if(!$bbcodeoff && $allowbbcode) {
                if(strpos($message, '[/url]') !== FALSE) {
                        $message = preg_replace("/\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)([^\[\"']+?))?\](.+?)\[\/url\]/ies", "parseurl('\\1', '\\5')", $message);
                }

第216行
        if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches))

把“https?|”删除掉,保存后上传替换掉原文件即可!

【修改前示例】

肌肉健美--腹部训练
1.屈腿仰卧起坐
2.屈膝仰卧起坐
3.体操梯仰卧起坐
4.小腿搁凳仰卧起坐
5.斜板后仰起坐
6.特制凳仰卧起坐
7.跪地收腹下拉
8.坐姿收腹下拉
9.斜板仰卧腿上举
10.坐姿屈膝上举
11.悬垂屈膝上举
12.横杆转体
13.哑铃侧屈
14.罗马椅后仰起坐
15.健身盘转体

【修改后示例([url 前的 [ 去掉了)】

肌肉健美--腹部训练
url=http://www.102218.com/viewthread.php?tid=1146&extra=page%3D1]1.屈腿仰卧起坐[/url]
url=http://www.102218.com/viewthread.php?tid=1147&extra=page%3D1]2.屈膝仰卧起坐[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1147&goto=nextnewset]3.体操梯仰卧起坐[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1148&goto=nextnewset]4.小腿搁凳仰卧起坐[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1149&goto=nextnewset]5.斜板后仰起坐[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1150&goto=nextnewset]6.特制凳仰卧起坐[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1151&goto=nextnewset]7.跪地收腹下拉[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1152&goto=nextnewset]8.坐姿收腹下拉[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1153&goto=nextnewset]9.斜板仰卧腿上举[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1154&goto=nextnewset]10.坐姿屈膝上举[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1155&goto=nextnewset]11.悬垂屈膝上举[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1156&goto=nextnewset]12.横杆转体[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1157&goto=nextnewset]13.哑铃侧屈[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1158&goto=nextnewset]14.罗马椅后仰起坐[/url]
url=http://www.102218.com/redirect.php?fid=10&tid=1159&goto=nextnewset]15.健身盘转体[/url]
希望做站长本人的学生请点击
http://www.3ast.com/viewthread.php?tid=13841
QQ790653916只负责SEO以及收费教学等方面联系,他人勿扰

于智者同行,你会不同凡响;与高人为伍,你会登上巅峰

虽然看得不是很懂,但支持是必须的!

TOP

-_=!!!!!!!!狂顶;

TOP

返回列表