Home  >  Article  >  Backend Development  >  求相熟discuz的朋友看看。

求相熟discuz的朋友看看。

WBOY
WBOYOriginal
2016-06-13 11:47:04795browse

求熟悉discuz的朋友看看。。
 求指教,我在discuz 插件中看见 require_once libfile('function/discuzcode');
foreach($tasks as $k=>$task){
$tasks[$k]['intro']=discuzcode($task['intro']);
}
 
这段代码,我想请教下,discuzcode()函数是什么意思。。我把这段注释掉好像对插件也没有影响。。


具体函数代码我就不上了,反正我看了下,貌似有14个参数。。



------解决方案--------------------

引用:
 求指教,我在discuz 插件中看见 require_once libfile('function/discuzcode');
foreach($tasks as $k=>$task){
$tasks[$k]['intro']=discuzcode($task['intro']);
}
 
这段代码,我想请教下,discuzcode()函数是什么意思。。我把这段注释掉好像对插件也没有影响。。


具体函数代码我就不上了,反正我看了下,貌似有14个参数。。


function discuzcode($message, $smileyoff, $bbcodeoff, $htmlon = 0, $allowsmilies = 1, $allowbbcode = 1, $allowimgcode = 1, $allowhtml = 0, $jammer = 0, $parsetype = '0', $authorid = '0', $allowmediacode = '0', $pid = 0, $lazyload = 0) {
        global $_G;
 
        static $authorreplyexist;
 
        if($parsetype != 1 && !$bbcodeoff && $allowbbcode && (strpos($message, '[/code]') 
------解决方案--------------------
 strpos($message, '[/CODE]')) !== FALSE) {
                $message = preg_replace("/\s?\[code\](.+?)\[\/code\]\s?/ies", "codedisp('\\1')", $message);
        }
 
        $msglower = strtolower($message);
看看这里就知道了啊
第一个参数就是传递过来的内容参数 $message,对这个内容进行标签转换,他默认的情况下是需要标签转换的,就是如果含有[/CODE]这个的UBB标签就转换,其他的自己去理解吧,主要作用就是这个
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn