本文整理汇总了PHP中bbcode::acronym_pass方法的典型用法代码示例。如果您正苦于以下问题:PHP bbcode::acronym_pass方法的具体用法?PHP bbcode::acronym_pass怎么用?PHP bbcode::acronym_pass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bbcode
的用法示例。
在下文中一共展示了bbcode::acronym_pass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate_text_for_display
/**
* For display of custom parsed text on user-facing pages
* Expects $text to be the value directly from the database (stored value)
*/
function generate_text_for_display($text, $only_smileys = false, $censor = true, $acro_autolinks = false, $forum_id = '999999')
{
global $bbcode, $config, $user;
if (empty($text)) {
return '';
}
if (defined('IS_ICYPHOENIX') && $censor) {
$text = censor_text($text);
}
if (!class_exists('bbcode') || empty($bbcode)) {
include_once IP_ROOT_PATH . 'includes/bbcode.' . PHP_EXT;
}
if (empty($bbcode)) {
$bbcode = new bbcode();
if (!$user->data['session_logged_in']) {
$user->data['user_allowhtml'] = $config['allow_html'] ? true : false;
$user->data['user_allowbbcode'] = $config['allow_bbcode'] ? true : false;
$user->data['user_allowsmile'] = $config['allow_smilies'] ? true : false;
}
$bbcode->allow_html = $user->data['user_allowhtml'] && $config['allow_html'] ? true : false;
$bbcode->allow_bbcode = $user->data['user_allowbbcode'] && $config['allow_bbcode'] ? true : false;
$bbcode->allow_smilies = $user->data['user_allowsmile'] && $config['allow_smilies'] ? true : false;
}
if ($only_smileys) {
$text = $bbcode->parse_only_smilies($text);
} else {
$text = $bbcode->parse($text);
if ($acro_autolinks) {
$text = $bbcode->acronym_pass($text);
$text = $bbcode->autolink_text($text, $forum_id);
}
}
return $text;
}
示例2: parseMessage
function parseMessage($text, $enable_bbcode, $enable_html, $enable_smilies, $enable_autolinks_acronyms)
{
global $db, $cache, $config, $user, $bbcode, $lofi;
if (!class_exists('bbcode')) {
include IP_ROOT_PATH . 'includes/bbcode.' . PHP_EXT;
}
if (empty($bbcode)) {
$bbcode = new bbcode();
}
if (!empty($text)) {
$text = censor_text($text);
// Parse message and/or sig for BBCode if reqd
$bbcode->allow_html = $this->config['allow_html'] == true && $enable_html == true ? true : false;
$bbcode->allow_bbcode = $this->config['allow_bbcode'] == true && $enable_bbcode == true ? true : false;
$bbcode->allow_smilies = $this->config['allow_smilies'] == true && !$lofi == true && $enable_smilies == true ? true : false;
$text = $bbcode->parse($text);
if ($enable_autolinks_acronyms) {
$text = $bbcode->acronym_pass($text);
$text = $bbcode->autolink_text($text, '999999');
}
} else {
$text = '';
}
// Strip out the <!--break--> delimiter.
$delim = htmlspecialchars('<!--break-->');
$pos = strpos($text, $delim);
if ($pos !== false && $pos < strlen($text)) {
$text = substr_replace($text, html_entity_decode($delim), $pos, strlen($delim));
}
return $text;
}