2010-06-13 62 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