當前位置: 首頁>>代碼示例>>PHP>>正文


PHP bbcode::bbcode_tpl方法代碼示例

本文整理匯總了PHP中bbcode::bbcode_tpl方法的典型用法代碼示例。如果您正苦於以下問題:PHP bbcode::bbcode_tpl方法的具體用法?PHP bbcode::bbcode_tpl怎麽用?PHP bbcode::bbcode_tpl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bbcode的用法示例。


在下文中一共展示了bbcode::bbcode_tpl方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

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

示例2: bbcode_cache_init_end

 /**
  * Changes the regex replacement for second pass
  *
  * Based on phpBB.de - External Image as Link from Christian Schnegelberger<blackhawk87@phpbb.de> and Oliver Schramm <elsensee@phpbb.de>
  *
  * @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

示例3: replace_hide_bbcode_wrapper

 public function replace_hide_bbcode_wrapper($user_id, $bbcode_uid, &$message, $decoded)
 {
     $this->current_row['user_id'] = $user_id;
     $this->current_row['regex']['open_tag'] = "@\\[hide(|\\=(|[0-9,]+)(|\\|([0-9,]+)))(|:" . $bbcode_uid . ")\\]@is";
     $this->current_row['regex']['close_tag'] = "@\\[/hide(|:" . $bbcode_uid . ")\\]@is";
     if (preg_match_all($this->current_row['regex']['open_tag'], $message, $open_matches, PREG_OFFSET_CAPTURE) && preg_match_all($this->current_row['regex']['close_tag'], $message, $close_matches, PREG_OFFSET_CAPTURE)) {
         $result = $this->find_pairs($open_matches, $close_matches);
         $matches = $result[0];
         $tree = $result[1];
         //var_dump("-----------TREE------------\n");
         //var_dump($tree);
         //var_dump($matches);
         //var_dump($open_matches);
         if (!$decoded) {
             $this->template->set_style(array('styles', 'ext/koutogima/hide/styles'));
             $bbcode = new \bbcode();
             $bbcode->template_filename = $this->template->get_source_file_for_handle('hide_bbcode.html');
             $unhide_open = $bbcode->bbcode_tpl('unhide_open');
             $unhide_close = $bbcode->bbcode_tpl('unhide_close');
             $hide = $bbcode->bbcode_tpl('hide');
         } else {
             $unhide_open = "[hide]";
             $unhide_close = "[/hide]";
             $hide = "[hide][/hide]";
         }
         $message = $this->replace_hide_bbcode($message, $tree, $matches, $open_matches, $close_matches, $unhide_open, $unhide_close, $hide);
     }
 }
開發者ID:ntvy95,項目名稱:koutogima,代碼行數:28,代碼來源:listener.php

示例4: hidden_pass_topicPreview

 /**
  * Convert Hidden BBCode into its final appearance
  *
  * @param array $matches
  * @return string HTML render of hidden bbcode
  */
 protected function hidden_pass_topicPreview($matches)
 {
     $this->template->set_style(array('styles', 'ext/marcovo/hideBBcode/styles'));
     $bbcode = new \bbcode();
     $bbcode->template_filename = $this->template->get_source_file_for_handle('hide_bbcode.html');
     return $bbcode->bbcode_tpl('unhide_open') . $matches[1] . $bbcode->bbcode_tpl('unhide_close');
 }
開發者ID:andares-phpBB-Es,項目名稱:phpbb_hidebbcode,代碼行數:13,代碼來源:listener.php


注:本文中的bbcode::bbcode_tpl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。