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

PHP BBCode类代码示例

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

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



在下文中一共展示了BBCode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: strip

 private function strip($in)
 {
     $bb = new BBCode();
     $tfe = new TextFormattingEvent($in);
     $bb->receive_event($tfe);
     return $tfe->stripped;
 }
开发者ID:kmcasto,项目名称:shimmie2,代码行数:7,代码来源:test.php


示例2: nbbc

 /**
  * @return BBCode;
  */
 public function nbbc()
 {
     if ($this->_NBBC === null) {
         $plugin = new BBCode();
         $this->_NBBC = $plugin->nbbc();
         $this->_NBBC->setIgnoreNewlines(true);
         $this->_NBBC->addRule('attachment', array('mode' => Nbbc\BBCode::BBCODE_MODE_CALLBACK, 'method' => array($this, "DoAttachment"), 'class' => 'image', 'allow_in' => array('listitem', 'block', 'columns', 'inline', 'link'), 'end_tag' => Nbbc\BBCode::BBCODE_PROHIBIT, 'content' => Nbbc\BBCode::BBCODE_PROHIBIT, 'plain_start' => "[image]", 'plain_content' => array()));
     }
     return $this->_NBBC;
 }
开发者ID:vanilla,项目名称:addons,代码行数:13,代码来源:class.ipbformatter.plugin.php


示例3: NBBC

 /**
  * @return BBCode;
  */
 public function NBBC()
 {
     if ($this->_NBBC === NULL) {
         require_once PATH_PLUGINS . '/HtmLawed/htmLawed/htmLawed.php';
         $Plugin = new NBBCPlugin('BBCodeRelaxed');
         $this->_NBBC = $Plugin->NBBC();
         $this->_NBBC->ignore_newlines = TRUE;
         $this->_NBBC->enable_smileys = FALSE;
         $this->_NBBC->AddRule('attachment', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, "DoAttachment"), 'class' => 'image', 'allow_in' => array('listitem', 'block', 'columns', 'inline', 'link'), 'end_tag' => BBCODE_PROHIBIT, 'content' => BBCODE_PROHIBIT, 'plain_start' => "[image]", 'plain_content' => array()));
     }
     return $this->_NBBC;
 }
开发者ID:nilsen,项目名称:addons,代码行数:15,代码来源:class.ipbformatter.plugin.php


示例4: Parse

 function Parse($string)
 {
     global $config;
     require_once dirname(__FILE__) . '/nbbc/nbbc.php';
     $setup = new BBCode();
     if (!isset($config)) {
         // old compatibility mode
         $setup->SetSmileyURL(baseaddress() . 'smileys');
     } else {
         $setup->SetSmileyURL($config->getValue('baseaddress') . 'smileys');
     }
     // $setup->SetEnableSmileys(false);
     $setup->SetAllowAmpersand(true);
     // escape (x)html entities
     return $setup->Parse(htmlent($string));
 }
开发者ID:laiello,项目名称:bz-owl,代码行数:16,代码来源:nbbc-wrapper_example.php


示例5: __construct

 /**
  * Create new BBCode object and initialize our own settings
  *
  * @param  string  $text
  */
 public function __construct($text = null)
 {
     parent::BBCode();
     $this->text = $text;
     // Automagically print hrefs
     $this->SetDetectURLs(true);
     // We have our own smileys
     $config = Kohana::$config->load('site.smiley');
     if (!empty($config)) {
         $this->ClearSmileys();
         $this->SetSmileyURL(URL::base() . $config['dir']);
         foreach ($config['smileys'] as $name => $smiley) {
             $this->AddSmiley($name, $smiley['src']);
         }
     } else {
         $this->SetEnableSmileys(false);
     }
     // We handle newlines with Kohana
     //$this->SetIgnoreNewlines(true);
     $this->SetPreTrim('a');
     $this->SetPostTrim('a');
     // User our own quote
     $this->AddRule('quote', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_quote'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns'), 'content' => BBCODE_REQUIRED));
     // Media tags
     $this->AddRule('audio', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_media'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'allow' => array('align' => '/^left|center|right$/'), 'default' => array('align' => 'left'), 'content' => BBCODE_REQUIRED, 'plain_content' => array('')));
     $this->AddRule('video', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_media'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'allow' => array('align' => '/^left|center|right$/'), 'default' => array('align' => 'left'), 'content' => BBCODE_REQUIRED, 'plain_content' => array('')));
 }
开发者ID:anqh,项目名称:anqh,代码行数:32,代码来源:bb.php


示例6: ShowSendMessagesPage

function ShowSendMessagesPage()
{
    global $USER, $LNG;
    $ACTION = HTTP::_GP('action', '');
    if ($ACTION == 'send') {
        switch ($USER['authlevel']) {
            case AUTH_MOD:
                $class = 'mod';
                break;
            case AUTH_OPS:
                $class = 'ops';
                break;
            case AUTH_ADM:
                $class = 'admin';
                break;
            default:
                $class = '';
                break;
        }
        $Subject = HTTP::_GP('subject', '', true);
        $Message = HTTP::_GP('text', '', true);
        $Mode = HTTP::_GP('mode', 0);
        $Lang = HTTP::_GP('lang', '');
        if (!empty($Message) && !empty($Subject)) {
            require 'includes/classes/BBCode.class.php';
            if ($Mode == 0 || $Mode == 2) {
                $From = '<span class="' . $class . '">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
                $pmSubject = '<span class="' . $class . '">' . $Subject . '</span>';
                $pmMessage = '<span class="' . $class . '">' . BBCode::parse($Message) . '</span>';
                $USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '" . Universe::getEmulated() . "'" . (!empty($Lang) ? " AND `lang` = '" . $GLOBALS['DATABASE']->sql_escape($Lang) . "'" : "") . ";");
                while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
                    $sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
                    PlayerUtil::sendMessage($UserData['id'], $USER['id'], $From, 50, $pmSubject, $sendMessage, TIMESTAMP, NULL, 1, Universe::getEmulated());
                }
            }
            if ($Mode == 1 || $Mode == 2) {
                require 'includes/classes/Mail.class.php';
                $userList = array();
                $USERS = $GLOBALS['DATABASE']->query("SELECT `email`, `username` FROM " . USERS . " WHERE `universe` = '" . Universe::getEmulated() . "'" . (!empty($Lang) ? " AND `lang` = '" . $GLOBALS['DATABASE']->sql_escape($Lang) . "'" : "") . ";");
                while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
                    $userList[$UserData['email']] = array('username' => $UserData['username'], 'body' => BBCode::parse(str_replace('{USERNAME}', $UserData['username'], $Message)));
                }
                Mail::multiSend($userList, strip_tags($Subject));
            }
            exit($LNG['ma_message_sended']);
        } else {
            exit($LNG['ma_subject_needed']);
        }
    }
    $sendModes = $LNG['ma_modes'];
    if (Config::get()->mail_active == 0) {
        unset($sendModes[1]);
        unset($sendModes[2]);
    }
    $template = new template();
    $template->assign_vars(array('langSelector' => array_merge(array('' => $LNG['ma_all']), $LNG->getAllowedLangs(false)), 'modes' => $sendModes));
    $template->show('SendMessagesPage.tpl');
}
开发者ID:Reapertonio,项目名称:2Moons,代码行数:58,代码来源:ShowSendMessagesPage.php


示例7: parse

 public static function parse($code)
 {
     $bbcode = new BBCode();
     if (defined('SMILEY_DIR')) {
         $bbcode->SetSmileyDir(substr(SMILEY_PATH, 0, -1));
         $bbcode->SetSmileyURL(substr(SMILEY_DIR, 0, -1));
     }
     // A few backwards compatible issues
     $code = str_replace('[img:right]', '[img align="right"]', $code);
     /*
     	'quote' => Array(
     		'mode' => BBCODE_MODE_LIBRARY,
     		'method' => "DoQuote",
     		'allow_in' => Array('listitem', 'block', 'columns'),
     		'before_tag' => "sns",
     		'after_tag' => "sns",
     		'before_endtag' => "sns",
     		'after_endtag' => "sns",
     		'plain_start' => "\n<b>Quote:</b>\n",
     		'plain_end' => "\n",
     	),
     */
     // Open tags
     $bbcode->AddRule('open', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array(__CLASS__, 'DoOpen'), 'class' => 'link', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'content' => BBCODE_REQUIRED, 'plain_start' => "<a href=\"{\$link}\">", 'plain_end' => "</a>", 'plain_content' => array('_content', '_default'), 'plain_link' => array('_default', '_content')));
     $bbcode->AddRule('colour', array('mode' => BBCODE_MODE_ENHANCED, 'allow' => array('_default' => '/^#?[a-zA-Z0-9._ -]+$/'), 'template' => '<span style="color:{$_default/tw}">{$_content/v}</span>', 'class' => 'inline', 'allow_in' => array('listitem', 'block', 'columns', 'inline', 'link')));
     for ($i = 1; $i < 5; $i++) {
         $bbcode->AddRule('h' . $i, array('simple_start' => "\n<h" . $i . ">\n", 'simple_end' => "\n</h" . $i . ">\n", 'allow_in' => array('listitem', 'block', 'columns'), 'before_tag' => "sns", 'after_tag' => "sns", 'before_endtag' => "sns", 'after_endtag' => "sns", 'plain_start' => "\n", 'plain_end' => "\n"));
     }
     $bbcode->AddRule('quote', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array(__CLASS__, 'DoQuote'), 'allow_in' => array('listitem', 'block', 'columns'), 'before_tag' => "sns", 'after_tag' => "sns", 'before_endtag' => "sns", 'after_endtag' => "sns", 'plain_start' => "\n<b>Quote:</b>\n", 'plain_end' => "\n"));
     $bbcode->AddRule('span', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array(__CLASS__, 'DoSpan'), 'allow_in' => array('listitem', 'block', 'columns'), 'before_tag' => "sns", 'after_tag' => "sns", 'before_endtag' => "sns", 'after_endtag' => "sns", 'plain_start' => "\n<b>Quote:</b>\n", 'plain_end' => "\n"));
     /*
     		'mode' => BBCODE_MODE_LIBRARY,
     		'method' => 'DoURL',
     		'class' => 'link',
     		'allow_in' => Array('listitem', 'block', 'columns', 'inline'),
     		'content' => BBCODE_REQUIRED,
     		'plain_start' => "<a href=\"{\$link}\">",
     		'plain_end' => "</a>",
     		'plain_content' => Array('_content', '_default'),
     		'plain_link' => Array('_default', '_content'),
     */
     $bbcode->AddRule('action', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array(__CLASS__, 'DoAction'), 'class' => 'link', 'allow_in' => array('listitem', 'block', 'columns', 'inline'), 'content' => BBCODE_REQUIRED, 'plain_start' => "<a href=\"{\$link}\">", 'plain_end' => "</a>", 'plain_content' => array('_content', '_default'), 'plain_link' => array('_default', '_content')));
     return '<div class="text">' . @$bbcode->Parse($code) . '</div>';
 }
开发者ID:catlabinteractive,项目名称:dolumar-engine,代码行数:44,代码来源:Parser.php


示例8: __construct

	/**
	 * Object Constructor
	 *
	 * @param
	 * @return	void
	 * @since	1.0
	 */
	function __construct() {
		parent::__construct ();
		$this->defaults = new KunenaBBCodeLibrary;
		$this->tag_rules = $this->defaults->default_tag_rules;
		$this->smileys = $this->defaults->default_smileys;
		if (empty($this->smileys)) $this->SetEnableSmileys(false);
		$this->SetSmileyDir ( JPATH_ROOT .'/'. KPATH_COMPONENT_RELATIVE );
		$this->SetSmileyURL ( JURI::root(true) . '/' . KPATH_COMPONENT_RELATIVE );
		$this->SetDetectURLs ( true );
	}
开发者ID:rich20,项目名称:Kunena,代码行数:17,代码来源:bbcode.php


示例9: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $sujet = ForumSubjects::where("id", $id)->first();
     $categorie = ForumCategories::find($sujet->category);
     foreach ($sujet->messages as $message) {
         Date::setLocale('fr');
         $date = new Date($message->created);
         $message->when = $date->format('j F Y');
         $message->message = $this::text_humanized($message->message);
         $message->message = BBCode::parse($message->message);
     }
     return view('forum.sujets.show', ['categorie' => $categorie, "sujet" => $sujet]);
 }
开发者ID:AxelCardinaels,项目名称:CbSeraing-Laravel,代码行数:19,代码来源:ForumSujetsController.php


示例10: __construct

 /**
  * Create new BBCode object and initialize our own settings
  *
  */
 public function __construct($text = null)
 {
     parent::BBCode();
     $this->text = $text;
     // Automagically print hrefs
     $this->SetDetectURLs(true);
     // We have our own smileys
     $config = Kohana::config('site.smiley');
     if (!empty($config)) {
         $this->ClearSmileys();
         $this->SetSmileyURL(url::base() . $config['dir']);
         foreach ($config['smileys'] as $name => $smiley) {
             $this->AddSmiley($name, $smiley['src']);
         }
     } else {
         $this->SetEnableSmileys(false);
     }
     // We handle newlines with Kohana
     $this->SetIgnoreNewlines(true);
     $this->SetPreTrim('a');
     $this->SetPostTrim('a');
     // User our own quote
     $this->AddRule('quote', array('mode' => BBCODE_MODE_CALLBACK, 'method' => array($this, 'bbcode_quote'), 'class' => 'block', 'allow_in' => array('listitem', 'block', 'columns'), 'content' => BBCODE_REQUIRED));
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:28,代码来源:BB.php


示例11: foreach

<?php 
if (!$published || !empty($revision) || !empty($preview)) {
    ?>
<br /><br />
<blockquote>
<strong>Description:</strong><br />
<?php 
    echo $description;
    ?>
</blockquote>
<?php 
}
?>
	
	<p><?php 
echo BBCode::parse($body);
?>
</p>

<?php 
if (!empty($mlt)) {
    ?>
    <p><h4>More Like This:</h4>
<?php 
    foreach ($mlt as $fetched) {
        echo '<a href="' . Url::format('article/view/' . Id::create($fetched, 'news')) . '">' . $fetched['title'] . '</a><br />';
    }
    ?>
</p>
<?php 
}
开发者ID:Zandemmer,项目名称:HackThisSite-Old,代码行数:31,代码来源:articleFull.php


示例12: callback_html

 /**
  * This callback processes any custom BBCodes with parser.php
  */
 protected function callback_html($field)
 {
     // Strips Invision custom HTML first from $field before parsing $field to parser.php
     $invision_markup = $field;
     $invision_markup = html_entity_decode($invision_markup);
     // Replace '[html]' with '<pre><code>'
     $invision_markup = preg_replace('/\\[html\\]/', '<pre><code>', $invision_markup);
     // Replace '[/html]' with '</code></pre>'
     $invision_markup = preg_replace('/\\[\\/html\\]/', '</code></pre>', $invision_markup);
     // Replace '[sql]' with '<pre><code>'
     $invision_markup = preg_replace('/\\[sql\\]/', '<pre><code>', $invision_markup);
     // Replace '[/sql]' with '</code></pre>'
     $invision_markup = preg_replace('/\\[\\/sql\\]/', '</code></pre>', $invision_markup);
     // Replace '[php]' with '<pre><code>'
     $invision_markup = preg_replace('/\\[php\\]/', '<pre><code>', $invision_markup);
     // Replace '[/php]' with '</code></pre>'
     $invision_markup = preg_replace('/\\[\\/php\\]/', '</code></pre>', $invision_markup);
     // Replace '[xml]' with '<pre><code>'
     $invision_markup = preg_replace('/\\[xml\\]/', '<pre><code>', $invision_markup);
     // Replace '[/xml]' with '</code></pre>'
     $invision_markup = preg_replace('/\\[\\/xml\\]/', '</code></pre>', $invision_markup);
     // Replace '[CODE]' with '<pre><code>'
     $invision_markup = preg_replace('/\\[CODE\\]/', '<pre><code>', $invision_markup);
     // Replace '[/CODE]' with '</code></pre>'
     $invision_markup = preg_replace('/\\[\\/CODE\\]/', '</code></pre>', $invision_markup);
     // Replace '[quote:XXXXXXX]' with '<blockquote>'
     $invision_markup = preg_replace('/\\[quote:(.*?)\\]/', '<blockquote>', $invision_markup);
     // Replace '[quote="$1"]' with '<em>@$1 wrote:</em><blockquote>'
     $invision_markup = preg_replace('/\\[quote="(.*?)":(.*?)\\]/', '<em>@$1 wrote:</em><blockquote>', $invision_markup);
     // Replace '[/quote:XXXXXXX]' with '</blockquote>'
     $invision_markup = preg_replace('/\\[\\/quote:(.*?)\\]/', '</blockquote>', $invision_markup);
     // Replace '[twitter]$1[/twitter]' with '<a href="https://twitter.com/$1">@$1</a>"
     $invision_markup = preg_replace('/\\[twitter\\](.*?)\\[\\/twitter\\]/', '<a href="https://twitter.com/$1">@$1</a>', $invision_markup);
     // Replace '[member='username']' with '@username"
     $invision_markup = preg_replace('/\\[member=\'(.*?)\'\\]/', '@$1 ', $invision_markup);
     // Replace '[media]' with ''
     $invision_markup = preg_replace('/\\[media\\]/', '', $invision_markup);
     // Replace '[/media]' with ''
     $invision_markup = preg_replace('/\\[\\/media\\]/', '', $invision_markup);
     // Replace '[list:XXXXXXX]' with '<ul>'
     $invision_markup = preg_replace('/\\[list\\]/', '<ul>', $invision_markup);
     // Replace '[list=1:XXXXXXX]' with '<ul>'
     $invision_markup = preg_replace('/\\[list=1\\]/', '<ul>', $invision_markup);
     // Replace '[*:XXXXXXX]' with '<li>'
     $invision_markup = preg_replace('/\\[\\*\\](.*?)\\<br \\/\\>/', '<li>$1</li>', $invision_markup);
     // Replace '[/list:u:XXXXXXX]' with '</ul>'
     $invision_markup = preg_replace('/\\[\\/list\\]/', '</ul>', $invision_markup);
     // Replace '[hr]' with '<hr>"
     $invision_markup = preg_replace('/\\[hr\\]/', '<hr>', $invision_markup);
     // Replace '[font=XXXXXXX]' with ''
     $invision_markup = preg_replace('/\\[font=(.*?)\\]/', '', $invision_markup);
     // Replace '[/font]' with ''
     $invision_markup = preg_replace('/\\[\\/font\\]/', '', $invision_markup);
     // Replace any Invision smilies from path '/sp-resources/forum-smileys/sf-smily.gif' with the equivelant WordPress Smilie
     $invision_markup = preg_replace('/\\<img src=(.*?)EMO\\_DIR(.*?)bbc_emoticon(.*?)alt=\'(.*?)\' \\/\\>/', '$4', $invision_markup);
     $invision_markup = preg_replace('/\\:angry\\:/', ':mad:', $invision_markup);
     $invision_markup = preg_replace('/\\:mellow\\:/', ':neutral:', $invision_markup);
     $invision_markup = preg_replace('/\\:blink\\:/', ':eek:', $invision_markup);
     $invision_markup = preg_replace('/B\\)/', ':cool:', $invision_markup);
     $invision_markup = preg_replace('/\\:rolleyes\\:/', ':roll:', $invision_markup);
     $invision_markup = preg_replace('/\\:unsure\\:/', ':???:', $invision_markup);
     // Now that Invision custom HTML has been stripped put the cleaned HTML back in $field
     $field = $invision_markup;
     require_once bbpress()->admin->admin_dir . 'parser.php';
     $bbcode = BBCode::getInstance();
     $bbcode->enable_smileys = false;
     $bbcode->smiley_regex = false;
     return html_entity_decode($bbcode->Parse($field));
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:72,代码来源:Invision.php


示例13: saveInfo

 /**
  * This is save info function, use it whatever saving or updating 
  * 
  * @param string $lowerItem
  * @param array $fields
  * @param array $systemFields
  * @param string $actionType
  * @return array 
  */
 public function saveInfo($lowerItem, $fields, $systemFields, $actionType, $compatible = false)
 {
     $item = ucfirst($lowerItem);
     $modelName = $item . 'InfoView';
     $model = new $modelName();
     $basicInfoFields = array_keys($model->attributes);
     $basicInfoFields[] = 'action_note';
     $basicInfo = array();
     $customInfo = array();
     $isNeedBBCodeTransfer = true;
     if (isset($fields['no_bbcode_transfer']) && !empty($fields['no_bbcode_transfer'])) {
         $isNeedBBCodeTransfer = false;
     }
     foreach ($fields as $key => $field) {
         if (in_array($key, $systemFields)) {
             continue;
         }
         if ($compatible) {
             if ('AssignedTo' == $key || 'ScriptedBy' == $key) {
                 $field = $this->getRealNameByName($field);
             } else {
                 if ('MailTo' == $key) {
                     $field = $this->getRealNamesByMailTo($field);
                 }
             }
             $key = $this->fieldOld2New($key, $lowerItem);
         }
         if ($isNeedBBCodeTransfer && in_array($key, array('action_note', 'repeat_step', 'case_step', 'result_step'))) {
             $field = BBCode::bbcode2html($field);
         }
         if ('no_bbcode_transfer' != $key && !in_array($key, $basicInfoFields)) {
             $customInfo[$key] = $field;
             continue;
         }
         $basicInfo[$key] = $field;
     }
     if (Info::ACTION_OPEN == $actionType && isset($basicInfo['id'])) {
         unset($basicInfo['id']);
     }
     if (Info::ACTION_OPEN_EDIT == $actionType && 'bug' == $lowerItem && isset($basicInfo['id'])) {
         $bug = BugInfo::model()->findByPk($basicInfo['id']);
         if (!isset($basicInfo['bug_status'])) {
             $basicInfo['bug_status'] = $bug->bug_status;
         }
         if (null !== $bug) {
             switch ($basicInfo['bug_status']) {
                 case BugInfo::STATUS_ACTIVE:
                     if (BugInfo::STATUS_ACTIVE !== $bug->bug_status) {
                         $actionType = BugInfo::ACTION_ACTIVATE;
                     } else {
                         $actionType = BugInfo::ACTION_OPEN_EDIT;
                     }
                     break;
                 case BugInfo::STATUS_RESOLVED:
                     if (BugInfo::STATUS_RESOLVED !== $bug->bug_status) {
                         $actionType = BugInfo::ACTION_RESOLVE;
                     } else {
                         $actionType = BugInfo::ACTION_RESOLVE_EDIT;
                     }
                     break;
                 case BugInfo::STATUS_CLOSED:
                     if (BugInfo::STATUS_CLOSED !== $bug->bug_status) {
                         $actionType = BugInfo::ACTION_CLOSE;
                     } else {
                         $actionType = BugInfo::ACTION_CLOSE_EDIT;
                     }
                     break;
                 default:
                     break;
             }
         }
     }
     $code = API::ERROR_NONE;
     $attachmentFile = CUploadedFile::getInstancesByName('attachment_file');
     $result = InfoService::saveInfo($lowerItem, $actionType, $basicInfo, $customInfo, $attachmentFile);
     $info = $result['detail'];
     if (CommonService::$ApiResult['FAIL'] === $result['status']) {
         $code = API::ERROR_SAVE_INFO;
     }
     return array($code, $info);
 }
开发者ID:mjrao,项目名称:BugFree,代码行数:90,代码来源:API.php


示例14: view

 function view()
 {
     global $USER, $LNG;
     require 'includes/classes/BBCode.class.php';
     $db = Database::get();
     $ticketID = HTTP::_GP('id', 0);
     $sql = "SELECT a.*, t.categoryID, t.status FROM %%TICKETS_ANSWER%% a INNER JOIN %%TICKETS%% t USING(ticketID) WHERE a.ticketID = :ticketID ORDER BY a.answerID;";
     $answerResult = $db->select($sql, array(':ticketID' => $ticketID));
     $answerList = array();
     if (empty($answerResult)) {
         $this->printMessage(sprintf($LNG['ti_not_exist'], $ticketID), array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=ticket')));
     }
     $ticket_status = 0;
     foreach ($answerResult as $answerRow) {
         $answerRow['time'] = _date($LNG['php_tdformat'], $answerRow['time'], $USER['timezone']);
         $answerRow['message'] = BBCode::parse($answerRow['message']);
         $answerList[$answerRow['answerID']] = $answerRow;
         if (empty($ticket_status)) {
             $ticket_status = $answerRow['status'];
         }
     }
     $categoryList = $this->ticketObj->getCategoryList();
     $this->assign(array('ticketID' => $ticketID, 'categoryList' => $categoryList, 'answerList' => $answerList, 'status' => $ticket_status));
     $this->display('page.ticket.view.tpl');
 }
开发者ID:sincilite,项目名称:Evermoon,代码行数:25,代码来源:ShowTicketPage.class.php


示例15: login_session_refresh

<?php

require '../include/mellivora.inc.php';
login_session_refresh();
head('Home');
if (cache_start('home', CONFIG_CACHE_TIME_HOME)) {
    require CONFIG_PATH_THIRDPARTY . 'nbbc/nbbc.php';
    $bbc = new BBCode();
    $bbc->SetEnableSmileys(false);
    $news = db_query_fetch_all('SELECT * FROM news ORDER BY added DESC');
    foreach ($news as $item) {
        echo '
        <div class="news-container">';
        section_head($item['title']);
        echo '
            <div class="news-body">
                ', $bbc->parse($item['body']), '
            </div>
        </div>
        ';
    }
    cache_end('home');
}
foot();
开发者ID:jpnelson,项目名称:mellivora,代码行数:24,代码来源:home.php


示例16: callback_html

 protected function callback_html($field)
 {
     require_once bbpress()->admin->admin_dir . 'parser.php';
     $bbcode = BBCode::getInstance();
     return html_entity_decode($bbcode->Parse($field));
 }
开发者ID:hscale,项目名称:webento,代码行数:6,代码来源:converter.php


示例17: split_on_bbcodes

 protected static function split_on_bbcodes($text, $allowed = 0, $allow_html = false)
 {
     global $bb_codes;
     # Split all bbcodes.
     $text_parts = BBCode::split_bbcodes($text);
     # Merge all bbcodes and do special actions depending on the type of code.
     $text = '';
     while ($part = array_shift($text_parts)) {
         if ($part['code'] == 'php') {
             # [PHP]
             $text .= $allowed ? BBCode::decode_php($part['text']) : nl2br(htmlspecialchars($part['text']));
         } elseif ($part['code'] == 'code') {
             # [CODE]
             if (!$allowed && false !== strpos($part['text'], '<')) {
                 $part['text'] = nl2br(htmlspecialchars($part['text']));
             }
             $text .= $allowed ? BBCode::decode_code($part['text']) : $part['text'];
         } elseif ($part['code'] == 'quote') {
             # [QUOTE] and [QUOTE=""]
             if ($part['text'][6] == ']') {
                 $text .= $bb_codes['quote'] . BBCode::split_on_bbcodes(substr($part['text'], 7, -8), $allowed, $allow_html) . $bb_codes['quote_close'];
             } else {
                 $part['text'] = preg_replace('/\\[quote=["]*(.*?)["]*\\]/si', $bb_codes['quote_name'], BBCode::split_on_bbcodes(substr($part['text'], 0, -8), $allowed, $allow_html), 1);
                 $text .= $part['text'] . $bb_codes['quote_close'];
             }
         } elseif ($part['subc']) {
             $tmptext = '[' . BBCode::split_on_bbcodes(substr($part['text'], 1, -1)) . ']';
             $text .= $part['code'] == 'list' ? BBCode::decode_list($tmptext) : $tmptext;
             unset($tmptext);
         } else {
             if ($allow_html) {
                 $tmptext = false === strpos($part['text'], '<') ? nl2br($part['text']) : $part['text'];
             } else {
                 $tmptext = nl2br(BBCode::encode_html($part['text']));
             }
             $text .= $part['code'] == 'list' ? BBCode::decode_list($tmptext) : $tmptext;
             unset($tmptext);
         }
     }
     return $text;
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:41,代码来源:nbbcode.php


示例18: parse_html

 public static function parse_html($content, $process_content_plugins = false, $bbcode = true, $autolink = true)
 {
     if ($bbcode) {
         require_once CJLIB_PATH . '/lib/nbbc/nbbc_main.php';
         $bbcode = new BBCode();
         $bbcode->SetSmileyURL(CJLIB_MEDIA_URI . '/smileys');
         $bbcode->SetSmileyDir(CJLIB_MEDIA_PATH . DS . 'smileys');
         $bbcode->SetTagMarker('[');
         $bbcode->SetAllowAmpersand(false);
         $bbcode->SetEnableSmileys(true);
         $bbcode->SetDetectURLs($autolink);
         $bbcode->SetPlainMode(false);
         $bbcode->SetDebug(false);
         $content = $bbcode->Parse($content);
     } else {
         if ($autolink) {
             require_once 'lib_autolink.php';
             $content = autolink_urls($content, 50, ' rel="nofollow"');
         }
     }
     if ($process_content_plugins) {
         $content = JHTML::_('content.prepare', $content);
     }
     return $content;
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:25,代码来源:functions.php


示例19: preg_replace

$email = preg_replace("[\r\n]", "", $email);
$sub = $sanitize->CleanStr($sub, 0);
//Or this
$sub = preg_replace("[\r\n]", "", $sub);
$url = $sanitize->CleanStr($url, 0);
//Or this
$url = preg_replace("[\r\n]", "", $url);
$resto = $sanitize->CleanStr($resto, 0);
//Or this
$resto = preg_replace("[\r\n]", "", $resto);
$com = $sanitize->CleanStr($com, $moderator);
//But they can with this.
$clean = $sanitize->process($name, $com, $sub, $email, $resto, $url, $dest, $moderator);
if (USE_BBCODE === true) {
    require_once CORE_DIR . '/general/text_process/bbcode.php';
    $bbcode = new BBCode();
    $clean['com'] = $bbcode->format($clean['com']);
}
if (SPOILERS && $spoiler) {
    $clean['sub'] = "SPOILER<>" . $clean['sub'];
}
if ($moderator && isset($_POST['showCap'])) {
    if ($moderator == 1) {
        $clean['name'] = '<span class="cap moderator" >' . $clean['name'] . ' ## Mod </span> <img src="http://3chan.ml/static/mod-icon.png" alt="Mod Icon" title="This user is a 3chan Modorator." style="margin-bottom: -3px;"/> ';
    }
    if ($moderator == 2) {
        $clean['name'] = '<span class="cap admin" >' . $clean['name'] . ' ## Admin </span> <img src="http://3chan.ml/static/admin-icon.png" alt="Admin Icon" title="This user is a 3chan Administrator." style="margin-bottom: -3px;"/>';
    }
    if ($moderator == 3) {
        $clean['name'] = '<span class="cap manager" >' . $clean['name'] . ' ## Manager  </span>';
    }
开发者ID:Bossgod,项目名称:3ch,代码行数:31,代码来源:regist.php


示例20: getBlogsReviews


//.........这里部分代码省略.........
                     $blog_link = $this->url->link('product/category', 'path=' . $blog_href['path']);
                     $record_link = $this->url->link('product/product', 'product_id=' . $comment['record_id'] . "&path=" . $blog_href['path']);
                     $rate = array();
                     $this->data['text_category'] = $this->language->get('text_category');
                     $this->data['text_record'] = $this->language->get('text_product');
                 }
                 //$comment['type'] == 'categories'
                 $rate_count = 0;
                 $rate_delta = 0;
                 $rate_delta_plus = 0;
                 $rate_delta_minus = 0;
                 foreach ($rate as $r) {
                     $rate_count = $r['rate_count'];
                     $rate_delta = $r['rate_delta'];
                     $rate_delta_plus = $r['rate_delta_plus'];
                     $rate_delta_minus = $r['rate_delta_minus'];
                 }
                 //$rate as $r
                 $this->load->model('tool/image');
                 if ($comment) {
                     if ($comment['image']) {
                         if (isset($thislist['avatar']['width']) && isset($thislist['avatar']['height']) && $thislist['avatar']['width'] != "" && $thislist['avatar']['height'] != "") {
                             $thumb = $this->model_tool_image->resize($comment['image'], $thislist['avatar']['width'], $thislist['avatar']['height'], 1);
                         } else {
                             $thumb = $this->model_tool_image->resize($comment['image'], 150, 150, 1);
                         }
                     } else {
                         $thumb = '';
                     }
                 } else {
                     $thumb = '';
                 }
                 if (!isset($comment['text'])) {
                     $comment['text'] = '';
                 }
                 //!isset($comment['text'])
                 if ($comment['text'] != '') {
                     $flag_desc = 'none';
                     if ($thislist['desc_symbols'] != '') {
                         $amount = $thislist['desc_symbols'];
                         $flag_desc = 'symbols';
                     }
                     //$thislist['desc_symbols'] != ''
                     if ($thislist['desc_words'] != '') {
                         $amount = $thislist['desc_words'];
                         $flag_desc = 'words';
                     }
                     //$thislist['desc_words'] != ''
                     if ($thislist['desc_pred'] != '') {
                         $amount = $thislist['desc_pred'];
                         $flag_desc = 'pred';
                     }
                     //$thislist['desc_pred'] != ''
                     switch ($flag_desc) {
                         case 'symbols':
                             $pattern = '/((.*?)\\S){0,' . $amount . '}/isu';
                             preg_match_all($pattern, strip_tags(html_entity_decode($comment['text'], ENT_QUOTES, 'UTF-8')), $out);
                             $text = $out[0][0];
                             break;
                         case 'words':
                             $pattern = '/((.*?)\\x20){0,' . $amount . '}/isu';
                             preg_match_all($pattern, strip_tags(html_entity_decode($comment['text'], ENT_QUOTES, 'UTF-8')), $out);
                             $text = $out[0][0];
                             break;
                         case 'pred':
                             $pattern = '/((.*?)\\.){0,' . $amount . '}/isu';
                             preg_match_all($pattern, strip_tags(html_entity_decode($comment['text'], ENT_QUOTES, 'UTF-8')), $out);
                             $text = $out[0][0];
                             break;
                         case 'none':
                             $text = html_entity_decode($comment['text'], ENT_QUOTES, 'UTF-8');
                             break;
                     }
                     //$flag_desc
                 }
                 //$comment['text'] != ''
                 if ($text == '') {
                     $text = html_entity_decode($comment['text'], ENT_QUOTES, 'UTF-8');
                 }
                 //$text == ''
                 if ($this->rdate($this->language->get('text_date')) == $this->rdate($this->language->get('text_date'), strtotime($comment['date_added']))) {
                     $date_str = $this->language->get('text_today');
                 } else {
                     $date_str = $this->language->get('text_date');
                 }
                 $date_available = $this->rdate($date_str . $this->language->get('text_hours'), strtotime($comment['date_added']));
                 require_once DIR_SYSTEM . 'library/bbcode.class.php';
                 $text = strip_tags($text);
                 $text = BBCode::parse($text);
                 $this->data['comments'][] = array('comment_id' => $comment['comment_id'], 'parent_id' => $comment['parent_id'], 'blog_id' => $comment['blog_id'], 'blog_name' => $comment['blog_name'], 'blog_href' => $blog_link, 'blog_path' => $blog_href['path'], 'record_id' => $comment['record_id'], 'record_comments' => $comment['record_comments'], 'record_viewed' => $comment['record_viewed'], 'record_name' => $comment['record_name'], 'record_rating' => (int) $comment['rating_avg'], 'record_href' => $record_link, 'customer_id' => $comment['customer_id'], 'author' => $comment['author'], 'text' => $text, 'rating' => (int) $comment['rating'], 'rate_count' => $rate_count, 'rate_delta' => $rate_delta, 'rate_delta_plus' => $rate_delta_plus, 'rate_delta_minus' => $rate_delta_minus, 'date' => $date_available, 'image' => $comment['image'], 'thumb' => $thumb, 'text_category' => $this->data['text_category'], 'text_record' => $this->data['text_record']);
             }
             //$comments as $comment
         }
         //isset($comments) && count($comments) > 0
         $this->cache->set('product.blog.reviews.' . (int) $this->config->get('config_language_id') . '.' . (int) $this->config->get('config_store_id') . '.' . (int) $customer_group_id . '.' . $hash, $this->data);
     } else {
         $this->data = $row;
     }
     return $this->data;
 }
开发者ID:archweb,项目名称:nprotein,代码行数:101,代码来源:blog.php



注:本文中的


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP BCGBarcode1D类代码示例发布时间:2022-05-23
下一篇:
PHP BASE_MenuItem类代码示例发布时间: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