求熟習discuz的朋友看看。

來源:互聯網
上載者:User
求熟悉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標籤就轉換,其他的自己去理解吧,主要作用就是這個
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.