當前位置: 首頁>>代碼示例>>PHP>>正文


PHP bbcode::instance方法代碼示例

本文整理匯總了PHP中bbcode::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP bbcode::instance方法的具體用法?PHP bbcode::instance怎麽用?PHP bbcode::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bbcode的用法示例。


在下文中一共展示了bbcode::instance方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getstr

function getstr($string, $length, $in_slashes = 0, $out_slashes = 0, $bbcode = 0, $html = 0)
{
    global $_G;
    $string = trim($string);
    $sppos = strpos($string, chr(0) . chr(0) . chr(0));
    if ($sppos !== false) {
        $string = substr($string, 0, $sppos);
    }
    if ($in_slashes) {
        $string = dstripslashes($string);
    }
    $string = preg_replace("/\\[hide=?\\d*\\](.*?)\\[\\/hide\\]/is", '', $string);
    if ($html < 0) {
        $string = preg_replace("/(\\<[^\\<]*\\>|\r|\n|\\s|\\[.+?\\])/is", ' ', $string);
    } elseif ($html == 0) {
        $string = dhtmlspecialchars($string);
    }
    if ($length) {
        $string = cutstr($string, $length);
    }
    if ($bbcode) {
        require_once DISCUZ_ROOT . './source/class/class_bbcode.php';
        $bb =& bbcode::instance();
        $string = $bb->bbcode2html($string, $bbcode);
    }
    if ($out_slashes) {
        $string = daddslashes($string);
    }
    return trim($string);
}
開發者ID:upyun,項目名稱:discuz-plugin,代碼行數:30,代碼來源:function_home.php

示例2: getInstance

 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new bbcode();
     }
     return self::$instance;
 }
開發者ID:rjdesign,項目名稱:Ilch-1.2,代碼行數:7,代碼來源:bbcode.php

示例3: getstr

function getstr($string, $length, $in_slashes = 0, $out_slashes = 0, $censor = 0, $bbcode = 0, $html = 0)
{
    global $_G;
    $string = trim($string);
    if ($in_slashes) {
        $string = dstripslashes($string);
    }
    if ($html < 0) {
        $string = preg_replace("/(\\<[^\\<]*\\>|\r|\n|\\s|\\[.+?\\])/is", ' ', $string);
    } elseif ($html == 0) {
        $string = dhtmlspecialchars($string);
    }
    if ($censor) {
        if (!class_exists('discuz_censor')) {
            include libfile('class/censor');
        }
        $censor = discuz_censor::instance();
        $censor->check($string);
        if ($censor->modbanned() || $censor->modmoderated()) {
            showmessage('word_banned');
        }
    }
    if ($length) {
        $string = cutstr($string, $length);
    }
    if ($bbcode) {
        require_once DISCUZ_ROOT . './source/class/class_bbcode.php';
        $bb =& bbcode::instance();
        $string = $bb->bbcode2html($string, $bbcode);
    }
    if ($out_slashes) {
        $string = daddslashes($string);
    }
    return trim($string);
}
開發者ID:Kingson4Wu,項目名稱:php_demo,代碼行數:35,代碼來源:function_home.php

示例4: ckstart

        $page = 1;
    }
    $start = ($page - 1) * $perpage;
    ckstart($start, $perpage);
    if ($albumid > 0) {
        $count = $picid ? 1 : $album['picnum'];
    } else {
        $count = C::t('home_pic')->fetch_all_by_albumid($albumid, 0, 0, $picid, 0, 0, $_G['uid'], true);
    }
    $list = array();
    if ($count) {
        if ($page > 1 && $start >= $count) {
            $page--;
            $start = ($page - 1) * $perpage;
        }
        $bbcode =& bbcode::instance();
        $query = C::t('home_pic')->fetch_all_by_albumid($albumid, $start, $perpage, $picid, 0, 1, $albumid > 0 ? 0 : $_G['uid']);
        foreach ($query as $value) {
            if ($picid) {
                $value['checked'] = ' checked';
            }
            $value['title'] = $bbcode->html2bbcode($value['title']);
            $value['pic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote']);
            $value['bigpic'] = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
            $list[] = $value;
        }
    }
    $multi = multi($count, $perpage, $page, "home.php?mod=spacecp&ac=album&op=editpic&albumid={$albumid}");
    $albumlist = getalbums($album['uid']);
} elseif ($_GET['op'] == 'setpic') {
    album_update_pic($albumid, $picid);
開發者ID:tang86,項目名稱:discuz-utf8,代碼行數:31,代碼來源:spacecp_album.php

示例5: getstr

function getstr($string, $length, $in_slashes = 0, $out_slashes = 0, $bbcode = 0, $html = 0)
{
    global $_G;
    $string = trim($string);
    if ($in_slashes) {
        $string = dstripslashes($string);
    }
    if ($html < 0) {
        $string = preg_replace("/(\\<[^\\<]*\\>|\r|\n|\\s|\\[.+?\\])/is", " ", $string);
    } else {
        if ($html == 0) {
            $string = dhtmlspecialchars($string);
        }
    }
    if ($length) {
        $string = cutstr($string, $length);
    }
    if ($bbcode) {
        require_once DISCUZ_ROOT . "./source/class/class_bbcode.php";
        $bb =& bbcode::instance();
        $string = $bb->bbcode2html($string, $bbcode);
    }
    if ($out_slashes) {
        $string = daddslashes($string);
    }
    return trim($string);
}
開發者ID:chibimiku,項目名稱:pdnovel_for_discuz_x2,代碼行數:27,代碼來源:function_pdnovel.php


注:本文中的bbcode::instance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。