本文整理汇总了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);
}
示例2: getInstance
public static function getInstance()
{
if (is_null(self::$instance)) {
self::$instance = new bbcode();
}
return self::$instance;
}
示例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);
}
示例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);
示例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);
}