diff options
author | friendica <info@friendica.com> | 2011-11-13 19:32:05 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2011-11-13 19:32:05 -0800 |
commit | 973620a9e6f0fad140e9b6f9145dc5cd4f7bf2ca (patch) | |
tree | 5ae3e666fbcf83eb655984f48006b716be929ee8 /include | |
parent | ce7a3615b51ee3247cb5c15996337cadc8cf644e (diff) | |
download | volse-hubzilla-973620a9e6f0fad140e9b6f9145dc5cd4f7bf2ca.tar.gz volse-hubzilla-973620a9e6f0fad140e9b6f9145dc5cd4f7bf2ca.tar.bz2 volse-hubzilla-973620a9e6f0fad140e9b6f9145dc5cd4f7bf2ca.zip |
translate vimeo and youtube bbcode to naked links so D* will oembed them again
Diffstat (limited to 'include')
-rw-r--r-- | include/bb2diaspora.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 8110d3e75..036e6cdb8 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -180,17 +180,15 @@ function bb2diaspora($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); -// 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\]/", '<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); + $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/ism",'http://www.youtube.com/watch?v=$1',$Text); + $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", 'http://www.youtube.com/watch?v=$1', $Text); + + $Text = preg_replace("/\[vimeo\]https?:\/\/player.vimeo.com\/video\/([0-9]+)(.*?)\[\/vimeo\]/ism",'http://vimeo.com/$1',$Text); + $Text = preg_replace("/\[vimeo\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/vimeo\]/ism",'http://vimeo.com/$1',$Text); + $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", 'http://vimeo.com/$1',$Text); + |