2010-06-13 42 views
0

有沒有人使用過PEAR HTML BBcode Package?Pear HTML BBcode Hyperlink

我不明白爲什麼超鏈接目標_blank不會在Firefox中打開一個新選項卡。

SQL插入代碼段(串)

[url=http://site.com t=_blank]Link[/url] 

PHP需要PEAR

require_once 'HTML/BBCodeParser.php'; 
$options = @parse_ini_file('BBCodeParser.ini'); 
$parser = new HTML_BBCodeParser($options); 
$parser->setText($text); 
$parser->parse(); 
echo $parser->getParsed(); 

BBCodeParser.ini

[HTML_BBCodeParser] 
; http://articles.sitepoint.com/article/bb-code-php-application/ 
; possible values: single|double 
; use single or double quotes for attributes 
quotestyle = double 

; possible values: all|nothing|strings 
; quote all attribute values, none, or only the strings 
quotewhat = all 

; the opening tag character 
open  = "[" 

; the closing tag character 
close  = "]" 

; possible values: true|false 
; use xml style closing tags for single html tags (<img> or <img />) 
xmlclose = true 

; possible values: a comma seperated list of filters 
; comma seperated list of filters to use 
filters  = Basic,Extended,Links,Images,Lists 
; filters  = Basic,Extended,Links,Images,Lists,Email,MyBB 

回答

0

看起來/filter/links.php的默認代碼不包含<a>標記中的目標屬性。如果您更改<a>標記代碼以添加t => 'target=_blank',則應該執行此操作。

我還不確定如何添加附加值,如_self,_top_parent