diff options
author | Friendika <info@friendika.com> | 2011-05-23 18:18:01 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-05-23 18:18:01 -0700 |
commit | 19ccd658ebcf13a7cc208a3e460e44d152dda32f (patch) | |
tree | a6cfc22e4e40fe00ef5aac27023ccbfa8789958a /include/bbcode.php | |
parent | 78b2db3a9840f551c951bf0a58a54cce08133bcf (diff) | |
parent | cde888f7f87449d4f5a281b8a23abcf3234ce9b9 (diff) | |
download | volse-hubzilla-19ccd658ebcf13a7cc208a3e460e44d152dda32f.tar.gz volse-hubzilla-19ccd658ebcf13a7cc208a3e460e44d152dda32f.tar.bz2 volse-hubzilla-19ccd658ebcf13a7cc208a3e460e44d152dda32f.zip |
Merge branch 'pull'
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index c2d932674..3caf2a6b1 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -92,17 +92,21 @@ function bbcode($Text,$preserve_nl = false) { // [img=widthxheight]image source[/img] $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '<img src="$3" style="height:{$2}px; width:{$1}px;" >', $Text); - // Youtube extensions + if (get_pconfig(local_user(), 'oembed', 'use_for_youtube' )==1){ + // use oembed for youtube links + $Text = preg_replace("/\[youtube\]/",'[embed]',$Text); + $Text = preg_replace("/\[\/youtube\]/",'[/embed]',$Text); + } else { + // Youtube extensions $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); - - $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '<br /><iframe style="width:425px;height:349px;padding:10px 0 10px 0;float:left;" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>', $Text); - -// $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '<br /><object style="width:425px;height:350px;" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" style="width:425px;height:350px;" /><![endif]--></object>', $Text); + $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '<iframe width="425" height="349" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>', $Text); + } +// $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text); // oembed tag $Text = oembed_bbcode2html($Text); - + call_hooks('bbcode',$Text); return $Text; |