• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bbcode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bbcode的典型用法代码示例。如果您正苦于以下问题:PHP bbcode类的具体用法?PHP bbcode怎么用?PHP bbcode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了bbcode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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;
}
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:38,代码来源:functions_bbcode.php


示例3: render_message

 /**
  * Render BBCode in a message
  *
  * @param string $message Message to render -- should already be parsed using message parser. Using some modified code from $bbcode->bbcode_cache_init() in phpBB's bbcode.php.
  * @param string $uid BBCode uid
  * @param string $bitfield BBCode bitfield
  * @return string Demo HTML
  */
 public function render_message($message, $uid, $bitfield)
 {
     if (empty($this->bbcode_data)) {
         return $message;
     }
     if (!is_object($this->bbcode)) {
         if (!class_exists('\\bbcode')) {
             require $this->phpbb_root_path . 'includes/bbcode.' . $this->php_ext;
         }
         $this->bbcode = new \bbcode();
     }
     // We define bbcode_bitfield here instead of when instantiating the class to prevent bbcode_cache_init() from running
     $this->bbcode->bbcode_bitfield = $bitfield;
     $bbcode_tpl = !empty($this->bbcode_data['second_pass_replace']) ? $this->bbcode_data['second_pass_replace'] : $this->bbcode_data['bbcode_tpl'];
     // Handle language variables
     $bbcode_tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(phpbb::\$user->lang['\$1'])) ? phpbb::\$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl);
     if ($this->bbcode_data['second_pass_replace']) {
         $this->bbcode->bbcode_cache[$this->contrib_id] = array('preg' => array($this->bbcode_data['second_pass_match'] => $bbcode_tpl));
     } else {
         $this->bbcode->bbcode_cache[$this->contrib_id] = array('str' => array($this->bbcode_data['second_pass_match'] => $bbcode_tpl));
     }
     $this->bbcode->bbcode_uid = $uid;
     $this->bbcode->bbcode_second_pass($message);
     return bbcode_nl2br($message);
 }
开发者ID:Sajaki,项目名称:customisation-db,代码行数:33,代码来源:demo.php


示例4: get_html

 function get_html($tree = null)
 {
     $str = '';
     foreach ($this->tree as $item) {
         if ('item' == $item['type']) {
             continue;
         }
         $str .= $item['str'];
     }
     $bb = new bbcode();
     $bb->tags = $this->tags;
     $bb->mnemonics = $this->mnemonics;
     $bb->autolinks = $this->autolinks;
     $bb->parse($str);
     return '<code class="bb_code">' . $bb->highlight() . '</code>';
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:16,代码来源:Bbcode.php


示例5: 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


示例6: modify_case_img

 /**
  * Changes the regex replacement for second pass
  *
  * @param object $event
  * @return null
  * @access public
  */
 public function modify_case_img($event)
 {
     $bbcode_id = 4;
     // [img] has bbcode_id 4 hardcoded
     $bbcode_cache = $event['bbcode_cache'];
     if (!isset($bbcode_cache[$bbcode_id]) || !$this->user->optionget('viewimg')) {
         return;
     }
     $this->template->set_filenames(array('bbcode.html' => 'bbcode.html'));
     $bbcode = new \bbcode();
     // We need these otherwise we cannot use $bbcode->bbcode_tpl()
     $bbcode->template_bitfield = new \bitfield($this->user->style['bbcode_bitfield']);
     $bbcode->template_filename = $this->template->get_source_file_for_handle('bbcode.html');
     $extimgaslink_boardurl = generate_board_url() . '/';
     $bbcode_cache[$bbcode_id] = array('preg' => array('#\\[img:$uid\\](' . preg_quote($extimgaslink_boardurl, '#') . '.*?)\\[/img:$uid\\]#s' => $bbcode->bbcode_tpl('img', $bbcode_id), '#\\[img:$uid\\](.*?)\\[/img:$uid\\]#s' => str_replace('$2', $this->user->lang('EXTIMGLINK'), $bbcode->bbcode_tpl('url', $bbcode_id, true))));
     $event['bbcode_cache'] = $bbcode_cache;
 }
开发者ID:Galixte,项目名称:phpbb-ext-external-images-as-link,代码行数:24,代码来源:listener.php


示例7: mail_read

function mail_read()
{
    global $smarty;
    $mail_id = (int) $_REQUEST['mail_id'];
    $db_query = "\n\t\t\tSELECT \n\t\t\t\t`players`.`name` as 'from', \n\t\t\t\t`mail`.`mail_id`, \n\t\t\t\t`mail`.`from_player_id`, \n\t\t\t\t`mail`.`body`, \n\t\t\t\t`mail`.`subject`, \n\t\t\t\t`mail`.`time`, \n\t\t\t\t`mail`.`status` \n\t\t\tFROM `mail` \n\t\t\tLEFT JOIN `players` ON `players`.`player_id` = `mail`.`from_player_id` \n\t\t\tWHERE \n\t\t\t\t`mail`.`round_id` = '" . $_SESSION['round_id'] . "' AND \n\t\t\t\t`mail`.`mail_id` = '" . $mail_id . "' AND \n\t\t\t\t`mail`.`to_player_id` = '" . $_SESSION['player_id'] . "' AND \n\t\t\t\t`mail`.`status` != '" . MAILSTATUS_DELETED . "'\n\t\t\tORDER BY `time` ASC \n\t\t\tLIMIT 30";
    $db_result = mysql_query($db_query);
    if (mysql_num_rows($db_result) == 0) {
        $status[] = 'That mail does not exist or you do not have permission to view it.';
        $smarty->append('status', $status);
        mail_list();
        exit;
    }
    $mail = mysql_fetch_array($db_result, MYSQL_ASSOC);
    $mail['time'] = format_timestamp($mail['time'] + 3600 * $_SESSION['preferences']['timezone']);
    $mail['subject'] = htmlentities($mail['subject']);
    $mail['body'] = nl2br(htmlentities($mail['body']));
    if ($mail['from_player_id'] == 0) {
        $mail['from'] = 'Administration';
    }
    $bbtags = array('b' => array('Name' => 'b', 'HtmlBegin' => '<span style="font-weight: bold;">', 'HtmlEnd' => '</span>'), 'i' => array('Name' => 'i', 'HtmlBegin' => '<span style="font-style: italic;">', 'HtmlEnd' => '</span>'), 'u' => array('Name' => 'u', 'HtmlBegin' => '<span style="text-decoration: underline;">', 'HtmlEnd' => '</span>'), 's' => array('Name' => 's', 'HtmlBegin' => '<span style="text-decoration: line-through;">', 'HtmlEnd' => '</span>'), 'quote' => array('Name' => 'quote', 'HasParam' => true, 'HtmlBegin' => '<b>Quote %%P%%:</b><div class="mailquote">', 'HtmlEnd' => '</div>'));
    require_once dirname(__FILE__) . '/includes/bbcode.php';
    $bbcode = new bbcode();
    $bbcode->add_tag($bbtags['b']);
    $bbcode->add_tag($bbtags['i']);
    $bbcode->add_tag($bbtags['u']);
    $bbcode->add_tag($bbtags['s']);
    $bbcode->add_tag($bbtags['quote']);
    $mail['body'] = $bbcode->parse_bbcode($mail['body']);
    if ($mail['status'] == 1) {
        $db_query = "UPDATE `mail` SET `status` = '2' WHERE `mail_id` = '" . $mail_id . "' LIMIT 1";
        $db_result = mysql_query($db_query);
    }
    $smarty->assign('mail', $mail);
    $smarty->display('mail_read.tpl');
}
开发者ID:WilliamJamesDalrympleWest,项目名称:imperial-kingdoms,代码行数:35,代码来源:mail.php


示例8: bbcode_cache_init_end

 /**
  * Changes the regex replacement for second pass
  *
  * Based on phpBB.de - External Image as Link from Christian Schnegelberger<[email protected]> and Oliver Schramm <[email protected]>
  *
  * @param object $event
  * @return null
  * @access public
  */
 public function bbcode_cache_init_end($event)
 {
     $bbcode_id = 4;
     // [img] has bbcode_id 4 hardcoded
     $bbcode_cache = $event['bbcode_cache'];
     if (!isset($bbcode_cache[$bbcode_id]) || !$this->user->optionget('viewimg')) {
         return;
     }
     $this->template->set_filenames(array('bbcode.html' => 'bbcode.html'));
     $bbcode = new \bbcode();
     // We need these otherwise we cannot use $bbcode->bbcode_tpl()
     $bbcode->template_bitfield = new \bitfield($this->user->style['bbcode_bitfield']);
     $bbcode->template_filename = $this->template->get_source_file_for_handle('bbcode.html');
     $extimgaslink_boardurl = generate_board_url() . '/';
     $url = $this->helper->route('tas2580_imageproxy_main', array());
     $bbcode_cache[$bbcode_id] = array('preg' => array('#\\[img:$uid\\](' . preg_quote($extimgaslink_boardurl, '#') . '.*?)\\[/img:$uid\\]#s' => $bbcode->bbcode_tpl('img', $bbcode_id), '#\\[img:$uid\\](.*?)\\[/img:$uid\\]#s' => str_replace('$1', $url . '?img=$1', $bbcode->bbcode_tpl('img', $bbcode_id, true))));
     $event['bbcode_cache'] = $bbcode_cache;
 }
开发者ID:tas2580,项目名称:imageproxy,代码行数:27,代码来源:listener.php


示例9: tohtml

 public static function tohtml($text, $advanced = TRUE, $charset = 'utf8')
 {
     $basic_bbcode = array('[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]', '[s]', '[/s]', '[ul]', '[/ul]', '[li]', '[/li]', '[ol]', '[/ol]', '[center]', '[/center]', '[left]', '[/left]', '[right]', '[/right]');
     $basic_html = array('<b>', '</b>', '<i>', '</i>', '<u>', '</u>', '<s>', '</s>', '<ul>', '</ul>', '<li>', '</li>', '<ol>', '</ol>', '<div style="text-align: center;">', '</div>', '<div style="text-align: left;">', '</div>', '<div style="text-align: right;">', '</div>');
     $text = str_replace($basic_bbcode, $basic_html, $text);
     if ($advanced) {
         $advanced_bbcode = array('#\\[color=([a-zA-Z]*|\\#?[0-9a-fA-F]{6})](.+)\\[/color\\]#Usi', '#\\[size=([0-9][0-9]?)](.+)\\[/size\\]#Usi', '#\\[quote](\\r\\n)?(.+?)\\[/quote]#si', '#\\[quote=(.*?)](\\r\\n)?(.+?)\\[/quote]#si', '#\\[url](.+)\\[/url]#Usi', '#\\[url=(.+)](.+)\\[/url\\]#Usi', '#\\[email]([\\w\\.\\-]+@[a-zA-Z0-9\\-]+\\.?[a-zA-Z0-9\\-]*\\.\\w{1,4})\\[/email]#Usi', '#\\[email=([\\w\\.\\-]+@[a-zA-Z0-9\\-]+\\.?[a-zA-Z0-9\\-]*\\.\\w{1,4})](.+)\\[/email]#Usi', '#\\[img](.+)\\[/img]#Usi', '#\\[img=(.+)](.+)\\[/img]#Usi', '#\\[code](\\r\\n)?(.+?)(\\r\\n)?\\[/code]#si', '#\\[youtube]http://[a-z]{0,3}.youtube.com/watch\\?v=([0-9a-zA-Z]{1,11})\\[/youtube]#Usi', '#\\[youtube]([0-9a-zA-Z]{1,11})\\[/youtube]#Usi');
         $advanced_html = array('<span style="color: $1">$2</span>', '<span style="font-size: $1px">$2</span>', "<div class=\"quote\"><span class=\"quoteby\">Disse:</span>\r\n\$2</div>", "<div class=\"quote\"><span class=\"quoteby\">Disse <b>\$1</b>:</span>\r\n\$3</div>", '<a rel="nofollow" target="_blank" href="$1">$1</a>', '<a rel="nofollow" target="_blank" href="$1">$2</a>', '<a href="mailto: $1">$1</a>', '<a href="mailto: $1">$2</a>', '<img src="$1" alt="$1" />', '<img src="$1" alt="$2" />', '<div class="codeblock"><code>$2</code></div>', '<object type="application/x-shockwave-flash" style="width: 450px; height: 366px;" data="http://www.youtube.com/v/$1"><param name="movie" value="http://www.youtube.com/v/$1" /><param name="wmode" value="transparent" /></object>', '<object type="application/x-shockwave-flash" style="width: 450px; height: 366px;" data="http://www.youtube.com/v/$1"><param name="movie" value="http://www.youtube.com/v/$1" /><param name="wmode" value="transparent" /></object>');
         $text = preg_replace($advanced_bbcode, $advanced_html, $text);
     }
     return bbcode::nl2br($text);
 }
开发者ID:TaylerKing,项目名称:PHP-Basics-Framework,代码行数:12,代码来源:bbcode.chunk.php


示例10: activeutil

 /**
  * Constructor
  *
  * @param $qsf - Quicksilver Forums module
  **/
 function activeutil(&$qsf)
 {
     parent::bbcode($qsf);
     $this->get =& $qsf->get;
     $this->user_id = $qsf->user['user_id'];
     $this->time = $qsf->time;
     $this->ip = $qsf->ip;
     $this->agent = $qsf->agent;
     $this->self = $qsf->self;
     if (isset($qsf->session['id'])) {
         $this->sessionid = $qsf->session['id'];
     }
 }
开发者ID:BackupTheBerlios,项目名称:qsf-svn,代码行数:18,代码来源:activeutil.php


示例11: book_info

function book_info($mysql_db, $sqlite_db, $min)
{
    $sqlite_db->query("begin transaction;");
    $bb = new bbcode();
    $bb->autolinks = false;
    $sqltest = "SELECT BookId FROM libbannotations WHERE BookId>{$min}";
    $query = $mysql_db->query($sqltest);
    while ($row = $query->fetch_array()) {
        echo "Book: " . $row['BookId'] . "\n";
        $sqltest1 = "SELECT Body FROM libbannotations WHERE BookId=" . $row['BookId'];
        $query1 = $mysql_db->query($sqltest1);
        $row1 = $query1->fetch_array();
        $sql = "UPDATE books SET description=? where id=?";
        $insert = $sqlite_db->prepare($sql);
        $bb->parse($row1['Body']);
        $body = $bb->get_html();
        $body = str_replace("&lt;", "<", $body);
        $body = str_replace("&gt;", ">", $body);
        $insert->execute(array($body, $row['BookId']));
        $insert->closeCursor();
    }
    $sqlite_db->query("commit;");
}
开发者ID:EvgeniiFrolov,项目名称:myrulib,代码行数:23,代码来源:conv_info.php


示例12: bbcode2html

 function bbcode2html($message, $parseurl = 0)
 {
     if (empty($this->search_exp)) {
         $this->search_exp = array("/\\s*\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s*/is", "/\\[url\\]\\s*(https?:\\/\\/|ftp:\\/\\/|gopher:\\/\\/|news:\\/\\/|telnet:\\/\\/|rtsp:\\/\\/|mms:\\/\\/|callto:\\/\\/|ed2k:\\/\\/){1}([^\\[\"']+?)\\s*\\[\\/url\\]/i", "/\\[em:(.+?):\\]/i");
         $this->replace_exp = array("<div class=\"quote\"><blockquote>\\1</blockquote></div>", "<a href=\"\\1\\2\" target=\"_blank\">\\1\\2</a>", " <img src=\"" . STATICURL . "image/smiley/comcom/\\1.gif\" class=\"vm\"> ");
         $this->search_str = array('[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]');
         $this->replace_str = array('<b>', '</b>', '<i>', '</i>', '<u>', '</u>');
     }
     if ($parseurl == 2) {
         $this->search_exp[] = "/\\[img\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/img\\]/ies";
         $this->replace_exp[] = '$this->bb_img(\'\\1\')';
         $message = bbcode::parseurl($message);
     }
     @($message = str_replace($this->search_str, $this->replace_str, preg_replace($this->search_exp, $this->replace_exp, $message, 20)));
     return nl2br(str_replace(array("\t", '   ', '  '), array('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;'), $message));
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:16,代码来源:bbcode.class.php


示例13: isset

     $member['session_time'] = isset($row['session_time']) ? $row['session_time'] : 0;
     $member['session_viewonline'] = isset($row['session_viewonline']) ? $row['session_viewonline'] : 0;
     unset($row);
 }
 if ($config['load_user_activity']) {
     display_user_activity($member);
 }
 // Do the relevant calculations
 $memberdays = max(1, round((time() - $member['user_regdate']) / 86400));
 $posts_per_day = $member['user_posts'] / $memberdays;
 $percentage = $config['num_posts'] ? min(100, $member['user_posts'] / $config['num_posts'] * 100) : 0;
 if ($member['user_sig']) {
     $member['user_sig'] = censor_text($member['user_sig']);
     if ($member['user_sig_bbcode_bitfield']) {
         include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
         $bbcode = new bbcode();
         $bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']);
     }
     $member['user_sig'] = bbcode_nl2br($member['user_sig']);
     $member['user_sig'] = smiley_text($member['user_sig']);
 }
 $poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);
 $template->assign_vars(show_profile($member));
 // Custom Profile Fields
 $profile_fields = array();
 if ($config['load_cpf_viewprofile']) {
     include_once $phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx;
     $cp = new custom_profile();
     $profile_fields = $cp->generate_profile_fields_template('grab', $user_id);
     $profile_fields = isset($profile_fields[$user_id]) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
 }
开发者ID:html,项目名称:PI,代码行数:31,代码来源:memberlist.php


示例14: isset

 function get_html($tree = null)
 {
     $attr = ' class="bb"';
     $width = isset($this->attrib['width']) ? $this->attrib['width'] : '';
     if ($width) {
         $attr .= ' width="' . htmlspecialchars($width) . '"';
     }
     $height = isset($this->attrib['height']) ? $this->attrib['height'] : '';
     if ($height) {
         $attr .= ' height="' . htmlspecialchars($height) . '"';
     }
     $align = isset($this->attrib['align']) ? $this->attrib['align'] : '';
     if ($align) {
         $attr .= ' align="' . htmlspecialchars($align) . '"';
     }
     $valign = isset($this->attrib['valign']) ? $this->attrib['valign'] : '';
     if ($valign) {
         $attr .= ' valign="' . htmlspecialchars($valign) . '"';
     }
     if (isset($this->attrib['colspan'])) {
         $colspan = (int) $this->attrib['colspan'];
         if ($colspan) {
             $attr .= ' colspan="' . $colspan . '"';
         }
     }
     if (isset($this->attrib['rowspan'])) {
         $rowspan = (int) $this->attrib['rowspan'];
         if ($rowspan) {
             $attr .= ' rowspan="' . $rowspan . '"';
         }
     }
     return '<th' . $attr . '>' . parent::get_html($this->tree) . '</th>';
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:33,代码来源:Th.php


示例15: isset

 function get_html($tree = null)
 {
     $attr = ' class="bb"';
     $border = isset($this->attrib['border']) ? (int) $this->attrib['border'] : null;
     if (null !== $border) {
         $attr .= ' border="' . $border . '"';
     }
     $width = isset($this->attrib['width']) ? $this->attrib['width'] : '';
     if ($width) {
         $attr .= ' width="' . htmlspecialchars($width) . '"';
     }
     $cellspacing = isset($this->attrib['cellspacing']) ? (int) $this->attrib['cellspacing'] : null;
     if (null !== $cellspacing) {
         $attr .= ' cellspacing="' . $cellspacing . '"';
     }
     $cellpadding = isset($this->attrib['cellpadding']) ? (int) $this->attrib['cellpadding'] : null;
     if (null !== $cellpadding) {
         $attr .= ' cellpadding="' . $cellpadding . '"';
     }
     $align = isset($this->attrib['align']) ? $this->attrib['align'] : '';
     if ($align) {
         $attr .= ' align="' . htmlspecialchars($align) . '"';
     }
     $str = '<table' . $attr . '>';
     foreach ($this->tree as $key => $item) {
         if ('text' == $item['type']) {
             unset($this->tree[$key]);
         }
     }
     $str .= parent::get_html($this->tree) . '</table>';
     return $str;
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:32,代码来源:Table.php


示例16: switch

 function get_html($tree = null)
 {
     $align = '';
     if (isset($this->attrib['justify'])) {
         $align = 'justify';
     }
     if (isset($this->attrib['left'])) {
         $align = 'left';
     }
     if (isset($this->attrib['right'])) {
         $align = 'right';
     }
     if (isset($this->attrib['center'])) {
         $align = 'center';
     }
     if (!$align && isset($this->attrib['align'])) {
         switch (strtolower($this->attrib['align'])) {
             case 'left':
                 $align = 'left';
                 break;
             case 'right':
                 $align = 'right';
                 break;
             case 'center':
                 $align = 'center';
                 break;
             case 'justify':
                 $align = 'justify';
                 break;
         }
     }
     return '<div class="bb" align="' . $align . '">' . parent::get_html($this->tree) . '</div>';
 }
开发者ID:ZerGabriel,项目名称:ffcms,代码行数:33,代码来源:Align.php


示例17:

 function get_html($tree = null)
 {
     $sign = '';
     if (strlen($this->attrib['size'])) {
         $sign = $this->attrib['size'][0];
     }
     if ('+' != $sign) {
         $sign = '';
     }
     $size = (int) $this->attrib['size'];
     if ($size >= 50 && $size <= 200) {
         return '<font style="font-size:' . $size . '%">' . parent::get_html($this->tree) . '</font>';
     }
     if (7 < $size) {
         $size = 7;
         $sign = '';
     }
     if (-6 > $size) {
         $size = '-6';
         $sign = '';
     }
     if (0 == $size) {
         $size = 3;
     }
     $size = $sign . $size;
     return '<font size="' . $size . '">' . parent::get_html($this->tree) . '</font>';
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:27,代码来源:Size.php


示例18: switch

 function get_html($tree = null)
 {
     $tag_name = 'ul';
     $type = '';
     switch ($this->tag) {
         case 'ol':
             $tag_name = 'ol';
             $type = strtolower($this->attrib['ol']);
             break;
         case 'list':
             if ($this->attrib['list']) {
                 $tag_name = 'ol';
             }
             $type = strtolower($this->attrib['list']);
             $this->tag = 'del';
     }
     $attr = ' class="bb"';
     if ('1' == $type) {
         $attr .= ' type="1"';
     } elseif ($type) {
         $attr .= ' type="a"';
     }
     $str = '<' . $tag_name . $attr . '>' . parent::get_html() . '</' . $tag_name . '>';
     return $str;
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:25,代码来源:List.php


示例19: htmlspecialchars

 function get_html($tree = null)
 {
     $attrib = 'class="bb"';
     if ($this->attrib['abbr']) {
         $attrib .= ' title="' . htmlspecialchars($this->attrib['abbr']) . '"';
     }
     return '<abbr ' . $attrib . '>' . parent::get_html($this->tree) . '</abbr>';
 }
开发者ID:ei-grad,项目名称:phorm,代码行数:8,代码来源:Abbr.php


示例20:

 function get_html($tree = null)
 {
     $attrib = 'class="bb"';
     if ('' !== $this->attrib['*']) {
         $this->attrib['*'] = (int) $this->attrib['*'];
         $attrib .= ' value="' . $this->attrib['*'] . '"';
     }
     return '<li ' . $attrib . '>' . parent::get_html($this->tree) . '</li>';
 }
开发者ID:ZerGabriel,项目名称:ffcms,代码行数:9,代码来源:Li.php



注:本文中的bbcode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bd类代码示例发布时间:2022-05-23
下一篇:
PHP basis_db类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap