News:

Join the Facebook Fan Page.

Main Menu

Embed BBCode

Started by nikan, June 02, 2011, 07:29:55 PM

Previous topic - Next topic

Nucleorion

Hi, thanks for this mod :)

I use 2.0.8 version and

<iframe width="560" height="315" src="//www.youtube.com/embed/_o1E8K5WwWg" frameborder="0" allowfullscreen></iframe>

Work fine, but can I embed a map?

<iframe frameBorder="0" src="http://es.wikiloc.com/wikiloc/spatialArtifacts.do?event=view&id=7121902&measures=off&title=off&near=off&images=off&maptype=S" width="500" height="400"></iframe>

Try also less http:

<iframe frameBorder="0" src="//es.wikiloc.com/wikiloc/spatialArtifacts.do?event=view&id=7121902&measures=off&title=off&near=off&images=off&maptype=S" width="500" height="400"></iframe>

But not work

nikan

Sorry, from version 1.3 you can use embed code only from: megavideo, metacafe, dailymotion, veoh, vimeo, youtube.

Sethv2

I am using SMF 2.0.8 with the 1.9 version of Embed BBCode. How would I go about embedding a soundcloud stream in an iframe? Adding the iframe code between the embed tags just results in text.

nikan

Quote from: Sethv2 on July 02, 2014, 02:39:11 AM
I am using SMF 2.0.8 with the 1.9 version of Embed BBCode. How would I go about embedding a soundcloud stream in an iframe? Adding the iframe code between the embed tags just results in text.
Try the following

Open Sources/Subs.php file and find
array(
'tag' => 'embed',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="$2" height="$3"><param name="movie" value="$1" /><param name="AllowScriptAccess" value="always" /><param name="AllowFullScreen" value="true" /><param name="wmode" value="transparent" /><a href="$1" target="_blank" class="new_win">$1</a></object>' : '<object type="application/x-shockwave-flash" data="$1" width="$2" height="$3"><param name="movie" value="$1" /><param name="AllowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="wmode" value="transparent" /><a href="$1" target="_blank" class="new_win">$1</a></object>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'embed\']))
$tag[\'content\'] = \'$1\';
  global $context;
if (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])(?:https?\:)?\/\/www\.(?:youtube|youtube\-nocookie)\.com\/embed\/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'?wmode=transparent\';
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])http\:\/\/www\.dailymotion\.com\/embed\/video\/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.dailymotion.com/swf/video/\' . $matches[1];
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])http\:\/\/player\.vimeo\.com\/video\/(.*?)\?.+(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://vimeo.com/moogaloop.swf?clip_id=\' . $matches[1];
elseif (preg_match(\'~http\:\/\/www.youtube.com\/watch[?]v=(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'&amp;fs=1&amp;wmode=transparent\';
elseif (preg_match(\'~http\:\/\/youtu\.be\/(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'&amp;fs=1&amp;wmode=transparent\';
elseif (preg_match(\'~embed.+src=(?:&quot;|[\\\'"])((?:https?\:)?\/\/(?:www\.)?(?:youtube|youtube-nocookie|dailymotion|vimeo|metacafe|megavideo|veoh)\.com\/.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = $matches[1];
else
$tag[\'content\'] = \'$1\';
'),
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
),


Replace it with
array(
'tag' => 'embed',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'] ? '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="$2" height="$3"><param name="movie" value="$1" /><param name="AllowScriptAccess" value="always" /><param name="AllowFullScreen" value="true" /><param name="wmode" value="transparent" /><a href="$1" target="_blank" class="new_win">$1</a></object>' : '<object type="application/x-shockwave-flash" data="$1" width="$2" height="$3"><param name="movie" value="$1" /><param name="AllowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="wmode" value="transparent" /><a href="$1" target="_blank" class="new_win">$1</a></object>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'embed\']))
$tag[\'content\'] = \'$1\';
  global $context;
if (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])(?:https?\:)?\/\/www\.(?:youtube|youtube\-nocookie)\.com\/embed\/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'?wmode=transparent\';
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])http\:\/\/www\.dailymotion\.com\/embed\/video\/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.dailymotion.com/swf/video/\' . $matches[1];
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])http\:\/\/player\.vimeo\.com\/video\/(.*?)\?.+(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://vimeo.com/moogaloop.swf?clip_id=\' . $matches[1];
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"]).+(https?\%3A\/\/api\.soundcloud.com\/tracks\/[0-9]+)\&.+(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches)) {
$data[0] = \'https://player.soundcloud.com/player.swf?url=\' . urlencode(urldecode($matches[1]));
$data[1] = \'100%\';
$data[2] = \'81\';
}
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"]).+(https?\%3A\/\/api\.soundcloud.com\/playlists\/[0-9]+)\&.+(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches)) {
$data[0] = \'https://player.soundcloud.com/player.swf?url=\' . urlencode(urldecode($matches[1]));
$data[1] = \'100%\';
$data[2] = \'255\';
}
elseif (preg_match(\'~http\:\/\/www.youtube.com\/watch[?]v=(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'&amp;fs=1&amp;wmode=transparent\';
elseif (preg_match(\'~http\:\/\/youtu\.be\/(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'&amp;fs=1&amp;wmode=transparent\';
elseif (preg_match(\'~embed.+src=(?:&quot;|[\\\'"])((?:https?\:)?\/\/(?:www\.)?(?:youtube|youtube-nocookie|dailymotion|vimeo|metacafe|megavideo|veoh)\.com\/.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = $matches[1];
else
$tag[\'content\'] = \'$1\';
'),
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
),

mikejezz

Thanks for the great plugin, however, there's a thing I want to change that I really can't see where to edit.

When I embed it says

[embed=425,349][/embed]

I would love to change the size 425,349 instead of always have to change it manually. How do I do this?

nikan

In file ./Sources/Subs-Editor.php

Find:
array(
'image' => 'embed',
'code' => 'embed',
'before' => '[embed=425,349]',
'after' => '[/embed]',
'description' => $txt['embed']
),

mikejezz

Quote from: nikan on August 27, 2014, 05:41:10 AM
In file ./Sources/Subs-Editor.php

Find:
array(
'image' => 'embed',
'code' => 'embed',
'before' => '[embed=425,349]',
'after' => '[/embed]',
'description' => $txt['embed']
),


That is exactly what I needed! Perfect mod! Thanks alot!

Would have been awesome if it was possible to change this in the admin panel, but this works too :)

assafk

Hey
I have installed the Mod Name: Embed BBCode (    EmbedBBCode20.zip - http://custom.simplemachines.org/mods/index.php?mod=3034)
I have version SMF 2.0.9

When i am adding a new post and put embed code of youtube in the post, i cant see the video, I see only the link.
Can someone tell me what is wrong?
This is the post https://forum.arabinstruments.com/index.php?topic=16.0

Can you help?

Thanks


assafk

Hey
Where do i enable the flash on post?
Can you show me ? Print screen?

Please...

Steve

Admin -> Posts and Topics -> Post Settings
DO NOT pm me for support!

thananit

#91
Hello,
I need your help.
I have installed the Mod (by manual) Name: Embed BBCode (EmbedBBCode20.zip - http://custom.simplemachines.org/mods/index.php?mod=3034)
I used SMF 2.0.9 and I enabled the flash in posts already.
I try to put the embed codes from many websites but the embed code show in my post only youtube code.
The other embed codes did not show, It show <iframe>..........</iframe> code
Example code is not work :
[embed=425,349]<iframe width='640' height='320' src='http://www.majortrailers.com/embed.php?tid=1606&w=640&h=320&sd=0' frameborder='0' allowfullscreen></iframe>[/embed]

Example youtube code, it's work:
[embed=425,349]<iframe width="560" height="315" src="//www.youtube.com/embed/XBPPHBu-WDs" frameborder="0" allowfullscreen></iframe>[/embed]

Please see a screenshot of my post;



I need to use all embed VDO.
Please suggest me.
How I can solve this issue?

Thank you
Thananit

margarett

Try to replace your single quotes with double quotes
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

thananit

I try it but still don't show the VDO.

Arantor

For security I don't think this mod does any and all iframes (which means it doesn't do random video sites for your users' security) - the main description suggests it does YouTube, DailyMotion and Vimeo.

halpaslan

Is it possible to use this mod with onedrive embedded links?

ivanTW

Hi,

I'm using the youtube short url for videos on my forum and it works on desktop, but not on my android phone, you only see the live link. It works to embed my vimeo videos on my phone and on desktop, but only youtube videos won't show on mobile. Is there a way to remedy this? I have already looked around the forum but didn't see a definitive answer.

Thanks.

nikan

I cannot reproduce your problem. Both youtube and vimeo videos plays on my desktop and on my android phone.

Please give the following information:
SMF version
Mod version
Installation method of the mod
Embed code you use (youtube and vimeo)

ivanTW

Thanks for your reply Nikan,

Version: SMF 2.0.7
Mod: Embed 1.8
Installation method: Download from SMF site and upload .zip file then install.

Here is an example of a youtube file that works on my desktop (firefox browser) but doesn't work on my android: http://youtu.be/x8d36hJes4w

I did notice my vimeo link that DOES show on my desktop and phone, I don't use the [embed][/embed] code. http://www.vimeo.com/76123849

I have simple A/V embedder and Embed BBC code installed. I assume since I have vimeo video playing without the [embed] code around it, it is being played by the simple a/v. When I DO put [embed] around the vimeo links they don't render, alternatively when I DON'T put [embed] around YouTube links they don't render anywhere. I thought for a minute that the two mods were conflicting with each other so I uninstalled embed BBC code and just tried to use simple a/v, but the Youtube links wouldn't render without [embed], so I know it is key to using youtube, but it doesn't actually work for vimeo right now.

Any ideas? Should I just uninstall simple a/v and see if I can get vimeo to run with the [embed] even though with them both installed it doesn't work?

Thanks.

nikan

You need to update your forum and embed mod.
Do your tests with one mod at a time, not both mods enabled.

Advertisement: