当前位置: 首页>>代码示例>>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;未经允许,请勿转载。