Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: nikan on June 02, 2011, 07:29:55 PM

Title: Embed BBCode
Post by: nikan on June 02, 2011, 07:29:55 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3034)

Introduction
This mod allows you to insert media embed code from known websites without any hassle.
Just copy the embed code like <object ... , <embed ... , <iframe ... , short/long url youtube and paste it inside the embed tag and the media will be displayed in your post.

Features
* Creates a bbcode button that inserts streaming media in the post.
* If you uncheck 'Embed flash into posts' from 'Post Settings' you disable the embed as well.

Languages
english
english-utf8
greek
greek-utf8

History
2.0 - Fixed the regex for non http, https on dailymotion and vimeo urls
1.9 - Added wmode parameter to avoid video overlay
1.8 - Fixed the regex for non http, https on youtube url
1.7 - Added slashes on regex for special characters
1.6 - Minor fixes
1.5 - Added HTTPS and privacy-enhanced mode for youtube
1.4 - Added support for SMF 1.1.x
1.3 - Added security checks
      - Now accepts embed code only from: megavideo, metacafe, dailymotion, veoh, vimeo, youtube
1.2 - Reworked and added dailymotion iframe embed code
1.1 - Removed iframe code creation on post and replaced with embed code
      - Added old youtube link insertion
1.0 - Initial release
Title: Re: Embed BBCode
Post by: !RFAN on June 03, 2011, 12:02:40 AM
very nice.. thanks :)
Title: Re: Embed BBCode
Post by: OCJ on June 04, 2011, 02:07:52 AM
Worked like a treat but when I tried to embed more than one in a single topic the iframe just enclosed a link to the main index page - cms portal page. I use SMF  embedded in Joomla, perhaps the problem is there.

domain.com/smf  displayed  domain.com/index.php

Useing embed once on a page was ok though.

Title: Re: Embed BBCode
Post by: Eudemon on June 18, 2011, 10:12:24 AM
i kinda like the idea using embed code instead of just the url like the other embed mod does

in reality we don't have to update the pattern when there is a code change and also url embed mod has limited patterns to the video sites

anyway i haven't test this mod yet, still upgrading my site, but doesn't this sorta give member the ability to use html in post?
Title: Re: Embed BBCode
Post by: Adam_Jack on June 20, 2011, 01:59:24 PM
i downloaded the MOD, but, how do i install it please ?
am using SMF_v2.0 RC5
Title: Re: Embed BBCode
Post by: nikan on June 26, 2011, 05:39:37 AM
Quotei kinda like the idea using embed code instead of just the url like the other embed mod does
There 're mods that don't even have a button to insert the url. Members aren't admins nor psychics to know about it.

Quotein reality we don't have to update the pattern when there is a code change and also url embed mod has limited patterns to the video sites
True.

Quoteanyway i haven't test this mod yet, still upgrading my site, but doesn't this sorta give member the ability to use html in post?
Doesn't flash button do the same?


Quotei downloaded the MOD, but, how do i install it please ?
am using SMF_v2.0 RC5
From Admin -> Package Manager -> Download Packages -> Upload a Package
Title: Re: Embed BBCode
Post by: blacktux on July 08, 2011, 10:49:11 AM
For some reason after I embed the code into a post, it just shows up on the post as plain text. It does not process the code. I have html and flash enabled on the forum.
I am using SMF version 2.0
I can PM you with a link if you want to see what I am referring too.

Update:
It works with Youtube but not Umapper (a custom map website).
Title: Re: Embed BBCode
Post by: nikan on July 09, 2011, 01:02:56 AM
The attachment mod includes the umapper embed code.
Thanks for using it.
Title: Re: Embed BBCode
Post by: k12onos on July 17, 2011, 09:40:08 PM
Will enabling flash really pose a security risk for the forum?

SMF seems to put much emphasize on how enabling flash will create security risks, and I surely don't want that :(

But, this mod is great, I tried different kinds of code including the "youtu.be" link and it still works :D that's why I want to keep it while still understanding the risks. :)

What is the worst thing people could do by exploiting the enabled flash?
Title: Re: Embed BBCode
Post by: k12onos on July 24, 2011, 06:01:19 AM
Anyone knows anything about this? any answer is much appreciated, thank you in advance :)
Title: Re: Embed BBCode
Post by: Tupsi on August 22, 2011, 07:03:09 AM
I am having problems getting this to work. It says that it has installed successfully, the .gif for the button is in the correct place, the changes in sub and sub-editor are all there, but still I neither see the new button in my editor nor are [embed] tags processed. Totally no clue why. I tested this on 2 different smf boards (both 2.0), one has already some extra stuff installed which maybe could cause a problem, but the other one is a completly vanilla install.

Anyone has an idea where I could log into to find the problem?
Title: Re: Embed BBCode
Post by: nikan on August 22, 2011, 08:42:21 AM
Quote from: Tupsi on August 22, 2011, 07:03:09 AM
I am having problems getting this to work. It says that it has installed successfully, the .gif for the button is in the correct place, the changes in sub and sub-editor are all there, but still I neither see the new button in my editor nor are [embed] tags processed. Totally no clue why. I tested this on 2 different smf boards (both 2.0), one has already some extra stuff installed which maybe could cause a problem, but the other one is a completly vanilla install.

Anyone has an idea where I could log into to find the problem?

You have unchecked 'Embed flash into posts' for 'Post Settings'. You must check it to enable both embedded flash and embedded code in to posts.
Title: Re: Embed BBCode
Post by: Tomy Tran on October 02, 2011, 06:30:07 PM
You should update file into mod site on Link to mod, or should notify members download new one on Topic support ;)
Title: Re: Embed BBCode
Post by: Tomy Tran on October 03, 2011, 04:41:40 AM
I did not have this mod successfully on my localhost smf 2.0.1. All other mod is OK, but this mod is successful installed, show button, added code [embed=425,349][/embed] in post (flash enabled) but when save it show as plant text and disappear your code. Any advice, author?
Title: Re: Embed BBCode
Post by: krash661 on October 18, 2011, 12:54:34 PM
does this work for regular members and subscribers also?
Title: Re: Embed BBCode
Post by: krash661 on October 18, 2011, 03:22:35 PM
Quote from: Tomy Tran © 2012 on October 03, 2011, 04:41:40 AM
I did not have this mod successfully on my localhost smf 2.0.1. All other mod is OK, but this mod is successful installed, show button, added code [embed=425,349][/embed] in post (flash enabled) but when save it show as plant text and disappear your code. Any advice, author?
yeah,im having the same problem. it does not work as a admin or member or subscriber.
Title: Re: Embed BBCode
Post by: 5p00f3r on October 22, 2011, 10:17:33 PM
I installed the Mod and for some reason the Embed button its not showing..I had to Fix The Language file thats the only manual Mod i made.. any help?
Title: Re: Embed BBCode
Post by: nikan on October 26, 2011, 02:53:11 PM
Quote from: krash661 on October 18, 2011, 03:22:35 PM
Quote from: Tomy Tran © 2012 on October 03, 2011, 04:41:40 AM
I did not have this mod successfully on my localhost smf 2.0.1. All other mod is OK, but this mod is successful installed, show button, added code [embed=425,349][/embed] in post (flash enabled) but when save it show as plant text and disappear your code. Any advice, author?
yeah,im having the same problem. it does not work as a admin or member or subscriber.
Is your video embed code from megavideo, metacafe, dailymotion, veoh, vimeo, youtube?

Quote from: 5p00f3r on October 22, 2011, 10:17:33 PM
I installed the Mod and for some reason the Embed button its not showing..I had to Fix The Language file thats the only manual Mod i made.. any help?
Double check the installation.
Title: Re: Embed BBCode
Post by: Tomy Tran on October 26, 2011, 04:57:27 PM
From youtube. I had un-installed it then (sorry for bad news but it doesn't work).

Using SMF 2.0+, I can add youtube via flash button by change youtube url from

http://www.youtube.com/watch?v=iTA463bLJsw

to

http://www.youtube.com/v/iTA463bLJsw

(change = to / and remove watch?) and it work very good, not test other media channel.
Title: Re: Embed BBCode
Post by: nikan on October 27, 2011, 12:55:04 AM
You used the shorturl or the embed code of youtube video for this mod?
Title: Re: Embed BBCode
Post by: Tomy Tran on October 27, 2011, 04:52:00 AM
Nope, I used normal link with your mod look like: http://www.youtube.com/watch?v=iTA463bLJsw

After failed with your mod, I has played around with code of SMF 2.0.1 and discovered I can do shorturl with flash button without any mod and it still works fine.
Title: Re: Embed BBCode
Post by: nikan on October 27, 2011, 01:18:57 PM
OK, then.
Thanks for trying my mod.
Title: Re: Embed BBCode
Post by: nikan on October 27, 2011, 01:29:16 PM
Just to be sure for others i tested your youtube link on my test site and works fine.
So, there is no problem with my mod.
Title: Re: Embed BBCode
Post by: MtnDon on October 31, 2011, 11:48:40 PM
I installed this mod last night. The only problem I has was locating the BBC button the first time I tried it. But moving the cursor around over the buttons revealed it.

It worked fine of the couple of YouTube videos I tried.
Title: Re: Embed BBCode
Post by: ~DS~ on November 18, 2011, 03:56:18 PM
Doesn't embed when I tried this video: http://www.bbc.co.uk/doctorwho/dw/news/bulletin_111119_02/The_Christmas_Special_The_Doctor_The_Widow_and_The_Wardrobe
Title: Re: Embed BBCode
Post by: nikan on November 21, 2011, 03:25:48 AM
That's because bbc.co.uk uses an external player.
Title: Re: Embed BBCode
Post by: jimbouk1977 on December 15, 2011, 12:26:59 AM
I just get text show of the embed code with youtube

with iframe code & old embed code e>G: <object>  any ideas

Code (just shows text) Select
<iframe width="640" height="360" src="http://www.youtube-nocookie.com/embed/wMbVJPNxvzo?hd=1" frameborder="0" allowfullscreen></iframe>  (wont work)

Code (Doesnt work) Select
<object width="640" height="360"><param name="movie" value="http://www.youtube-nocookie.com/v/wMbVJPNxvzo?version=3&amp;hl=en_US&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/wMbVJPNxvzo?version=3&amp;hl=en_US&amp;hd=1" type="application/x-shockwave-flash" width="640" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></object>

& i did wrap it with [embed=640,360][/embed]
Title: Re: Embed BBCode
Post by: nikan on December 15, 2011, 02:16:28 AM
hxxp://www.youtube-nocookie.com is not the youtube domain.
Title: Re: Embed BBCode
Post by: jimbouk1977 on December 15, 2011, 03:50:01 PM
So i cant embed using the no tracking cookie option   ?.

can this be added to or not (I don't know coding so asking if possible) as I hate tracking cookies  :P


Will try without & reply or update this post. thanks for the quick reply.

UPDATE:

Yes can confirm works when the tracking cookie is left on !. (can you still answer about the tracking cookie if it can be added to or not please)
Title: Re: Embed BBCode
Post by: nikan on December 16, 2011, 02:22:59 AM
Updated to support HTTPS and privacy-enhanced mode for youtube.
Title: Re: Embed BBCode
Post by: Apllicmz on December 27, 2011, 04:19:32 AM
Done
portuguese files

    <file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end" />           
            <add><![CDATA[
$txt['embed'] = 'Inserir v&iacute;deo C&oacute;digo Embed';
]]></add>
        </operation>
    </file>
   
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end" />           
            <add><![CDATA[
$txt['embed'] = 'Inserir v&iacute;deo C&oacute;digo Embed';
]]></add>
        </operation>
    </file>
   
    <file name="$languagedir/Modifications.portuguese_brazilian.php" error="skip">
        <operation>
            <search position="end" />           
            <add><![CDATA[
$txt['embed'] = 'Inserir v&iacute;deo C&oacute;digo Embed';
]]></add>
        </operation>
    </file>
   
    <file name="$languagedir/Modifications.portuguese_brazilian-utf8.php" error="skip">
        <operation>
            <search position="end" />           
            <add><![CDATA[
$txt['embed'] = 'Inserir v&iacute;deo C&oacute;digo Embed';
]]></add>
        </operation>
    </file>

Title: Re: Embed BBCode
Post by: gumboy on January 26, 2012, 02:59:44 AM
hi... i installed this mod and i want to add embed code in my post but not working.. only code is apearing..
i wnt to add below code,

<object id="mpl" style="" width="600" height="480" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://sakitvs.com/player/play.swf" /><param name="quality" value="high" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="wmode" value="opaque" /><param name="menu" value="false" /><param name="flashvars" value="streamer=rtmp://210.210.27.37:1935/live&amp;file=livestream1&amp;autostart=true&amp;menu=false&amp;image=/player/logo.png&amp;&amp;logo.hide=false&amp;logo.position=bottom-right&amp;logo.link=http://www.sakitv.com&amp;logo.out=1&amp;logo.margin=-1&amp;stretching=exactfit" /><embed id="mpl" style="" width="600" height="480" type="application/x-shockwave-flash" src="http://sakitvs.com/player/play.swf" quality="high" allowfullscreen="true" allowscriptaccess="always" wmode="opaque" menu="false" flashvars="streamer=rtmp://210.210.27.37:1935/live&amp;file=livestream1&amp;autostart=true&amp;menu=false&amp;image=/player/logo.png&amp;&amp;logo.hide=false&amp;logo.position=bottom-right&amp;logo.link=http://www.sakitv.com&amp;logo.out=1&amp;logo.margin=-1&amp;stretching=exactfit" /></object>

how i can do this??? whats the problem?
plz help me.
Title: Re: Embed BBCode
Post by: nikan on January 26, 2012, 07:23:37 AM
Did you read the first post?
Quote1.3 - Added security checks
      - Now accepts embed code only from: megavideo, metacafe, dailymotion, veoh, vimeo, youtube
Title: Re: Embed BBCode
Post by: SKOTINOS_AGELOS on January 30, 2012, 05:32:21 AM
Good job, works perfectly :)
Title: Re: Embed BBCode
Post by: larsenroed on March 30, 2012, 04:34:53 AM
Doesn't work with Vimeo. I get the message: "Sorry. This video does not exist."

Fix?
Title: Re: Embed BBCode
Post by: nikan on March 30, 2012, 05:15:02 AM
Quote from: larsenroed on March 30, 2012, 04:34:53 AM
Doesn't work with Vimeo. I get the message: "Sorry. This video does not exist."

Fix?

Fixed and updated the package.

Thanks larsenroed.
Title: Re: Embed BBCode
Post by: larsenroed on March 30, 2012, 05:38:14 AM
Quote from: nikan on March 30, 2012, 05:15:02 AM
Quote from: larsenroed on March 30, 2012, 04:34:53 AM
Doesn't work with Vimeo. I get the message: "Sorry. This video does not exist."

Fix?

Fixed and updated the package.

Thanks larsenroed.
Haha, that's quick! Thanks.
Title: Re: Embed BBCode
Post by: bruno2012 on May 02, 2012, 07:58:29 AM
could you give me an example of how to use the bbc?

I'm having trouble, not yet able to use it right  :(
Title: Re: Embed BBCode
Post by: nikan on May 02, 2012, 11:00:28 AM
This mod was made to make easier the posting of a video from video hosting sites.
As i wrote at first post:
Just copy the embed code like <object ... , <embed ... , <iframe ... , short/long url youtube and paste it inside the embed tag and the media will be displayed in your post.
Title: Re: Embed BBCode
Post by: bruno2012 on May 03, 2012, 12:59:12 PM
Quote from: nikan on May 02, 2012, 11:00:28 AM
This mod was made to make easier the posting of a video from video hosting sites.
As i wrote at first post:
Just copy the embed code like <object ... , <embed ... , <iframe ... , short/long url youtube and paste it inside the embed tag and the media will be displayed in your post.

I know that part, but it looks like when I was testing: See Attachment
Title: Re: Embed BBCode
Post by: nikan on May 03, 2012, 01:36:52 PM
Since version 1.3 this mod accepts embed code only from: megavideo, metacafe, dailymotion, veoh, vimeo, youtube
Title: Re: Embed BBCode
Post by: Babyfacemagee on July 07, 2012, 02:15:28 PM
Can this mod be used to embed youtube videos that will show in Chrome for Android and other similar mobile device html5/non-flash browsers?   

Thanks in advance.

BFM.
Title: Re: Embed BBCode
Post by: median on July 18, 2012, 11:20:38 PM
I am having trouble with this mod. On my site, the .gif button does not show up. So I cannot embed videos. Can you help? Where exactly do I go to fix this? I am running the Curve Steel theme.

UPDATE: I fixed it!

Title: Re: Embed BBCode
Post by: Babyfacemagee on July 23, 2012, 03:47:01 PM
This mod does not seem to work with viddler videos from sites such as Engadget.com.  Any chance of making this compatible with viddler vids?
Title: Re: Embed BBCode
Post by: nikan on July 24, 2012, 04:35:49 AM
For iframe and legacy share of viddler videos

Find
elseif (preg_match(\'~embed.+src=(?:&quot;|[\\\'"])((?:http|https)://(?:www.)?(?:youtube|youtube-nocookie|dailymotion|vimeo|metacafe|megavideo|veoh).com/.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = $matches[1];


Add bellow
elseif (preg_match(\'~(?:iframe|embed).+src=(?:&quot;|[\\\'"])//www.viddler.com/(?:embed|player)/([a-z0-9]+)/.+(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.viddler.com/simple/\' . $matches[1];
Title: Re: Embed BBCode
Post by: hellboy78 on July 29, 2012, 06:48:46 AM
is it support videobam videos???
Title: Re: Embed BBCode
Post by: weerforum on October 29, 2012, 10:34:40 AM
I onely see [embed=425,349]

And not [embed=425,349][/embed]
Title: Re: Embed BBCode
Post by: nikan on October 29, 2012, 10:49:38 AM
Press the 'Toggle View' button.
Title: Re: Embed BBCode
Post by: weerforum on October 29, 2012, 10:59:14 AM
Thnx nikan that works.
Shame that this don`t work  :(

<script src="http://player.ooyala.com/player.js?height=315&embedCode=1zdWhlNTq2LLA8gBRzX_IZo65ozA2BaH&video_pcode=RvbGU6Z74XE_a3bj4QwRGByhq9h2&deepLinkEmbedCode=1zdWhlNTq2LLA8gBRzX_IZo65ozA2BaH&width=560"></script>
Title: Re: Embed BBCode
Post by: bukharifaran on October 31, 2012, 04:28:27 PM
I have installed this mod on SMF 2.0.2 and made my first post with a video code from MetaCafe. Post was visible in the video. But only after one day, there was no video in my post. Just embedded code was visible. Till then I am not able to show any video on the forum. Flash is still on in the post options. Mod is still installed. And I am not sure, but I think that I did't installed any mod after this one.

One more thing, when I tried to uninstall this mod, it gives three errors.


Code: (Find) [Select]
if (empty($modSettings['enableEmbeddedFlash'])) {
$disabled['flash'] = true;
$disabled['embed'] = true;
}


Code: (Replace) [Select]
if (empty($modSettings['enableEmbeddedFlash']))
$disabled['flash'] = true;





Code: (Find) [Select]
array(
'tag' => 'flash',
'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" width="$2" height="$3"><param name="movie" value="$1" /><param name="play" value="true" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';
elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0)
$data[0] = \'http://\' . $data[0];
'),
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
),
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" width="$2" height="$3"><param name="movie" value="$1" /><param name="AllowScriptAccess" value="always" /><param name="AllowFullScreen" value="true" /><embed src="$1" width="$2" height="$3" AllowScriptAccess="always" AllowFullScreen="true" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" AllowScriptAccess="always" AllowFullScreen="true" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'embed\']))
$tag[\'content\'] = \'$1\';
  global $context;
if (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])(?:http|https)://www.(?:youtube|youtube-nocookie).com/embed/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1];
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] . \'&fs=1\';
elseif (preg_match(\'~http://youtu.be/(.+)~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.youtube.com/v/\' . $matches[1] . \'&fs=1\';
elseif (preg_match(\'~embed.+src=(?:&quot;|[\\\'"])((?:http|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>',
),


Code: (Replace) [Select]
array(
'tag' => 'flash',
'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" width="$2" height="$3"><param name="movie" value="$1" /><param name="play" value="true" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed></object>' : '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never" /><noembed><a href="$1" target="_blank" class="new_win">$1</a></noembed>'),
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';
elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0)
$data[0] = \'http://\' . $data[0];
'),
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
),




Code: (Find) [Select]
// Links are useless on paper... just show the link.
$disabled['embed'] = true;


Code: (Replace) [Select]
// Links are useless on paper... just show the link.

Title: Re: Embed BBCode
Post by: nikan on October 31, 2012, 06:54:30 PM
These errors mean that the mod can't find the necessary code to replace.
Title: Re: Embed BBCode
Post by: bukharifaran on November 03, 2012, 06:23:39 AM
I know, but my main question is above these lines. These lines to show that I have problems when uninstalling the mod.
Title: Re: Embed BBCode
Post by: nikan on November 03, 2012, 11:05:47 AM
Mod is partially installed.
Title: Re: Embed BBCode
Post by: flash_os on January 03, 2013, 04:35:49 PM
Why "Embed BBCode" does not support CNBC embed code?

<object id="cnbcplayer" height="380" width="400" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" >
<param name="type" value="application/x-shockwave-flash"/>
<param name="allowfullscreen" value="true"/>
<param name="allowscriptaccess" value="always"/>
<param name="quality" value="best"/>
<param name="scale" value="noscale" />
<param name="wmode" value="transparent"/>
<param name="bgcolor" value="#000000"/>
<param name="salign" value="lt"/>
<param name="movie" value="http://plus.cnbc.com/rssvideosearch/action/player/id/3000138674/code/cnbcplayershare"/>
<embed name="cnbcplayer" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" allowfullscreen="true" allowscriptaccess="always" bgcolor="#000000" height="380" width="400" quality="best" wmode="transparent" scale="noscale" salign="lt" src="http://plus.cnbc.com/rssvideosearch/action/player/id/3000138674/code/cnbcplayershare" type="application/x-shockwave-flash" />
</object>


And also vimeo.com
<iframe src="http://player.vimeo.com/video/56599373" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
Title: Re: Embed BBCode
Post by: Arantor on January 03, 2013, 04:40:34 PM
Because if you go down that road, you get into the realms of something like Aeva which supports nearly 200 video and audio sites and it still isn't enough for some people.
Title: Re: Embed BBCode
Post by: Aaruni on February 15, 2013, 10:35:32 PM
Quote from: nikan on June 02, 2011, 07:29:55 PM
1.3 - Added security checks
      - Now accepts embed code only from: megavideo, metacafe, dailymotion, veoh, vimeo, youtube

Is there some way by which we can remove that security check? or modify it to include more websites ?
Title: Re: Embed BBCode
Post by: HusaBob on April 15, 2013, 01:59:26 PM
this mod doesn't work when viewing the forum on an iphone (Safari browser). Any ideas? It just shows a non-clickable link.
Title: Re: Embed BBCode
Post by: nikan on April 16, 2013, 04:03:08 AM
Quote from: HusaBob on April 15, 2013, 01:59:26 PM
this mod doesn't work when viewing the forum on an iphone (Safari browser). Any ideas? It just shows a non-clickable link.

This mod takes the link of the video from the embed code and play it with the same function that smf plays flash videos.
Probably the flash inside post is not enabled in smf.
Title: Re: Embed BBCode
Post by: HusaBob on April 16, 2013, 09:44:47 AM
it's enabled.
Title: Re: Embed BBCode
Post by: Arantor on April 16, 2013, 10:32:05 AM
Flash videos are not supported on iPhone/Mobile Safari...
Title: Re: Embed BBCode
Post by: HusaBob on April 16, 2013, 12:08:29 PM
Quote from: Arantor on April 16, 2013, 10:32:05 AM
Flash videos are not supported on iPhone/Mobile Safari...

So, all I'm trying to do is use the short YouTube link. This mod makes you use the <embed> tag. As I said, this makes it NOT appear on an iPhone Safari browser.

I can watch the normal long URL YouTube vids on the iPhone.
Title: Re: Embed BBCode
Post by: Arantor on April 16, 2013, 12:10:20 PM
Yes... because the embed tag forces it to use the Flash player which doesn't work on iPhones.
Title: Re: Embed BBCode
Post by: HusaBob on April 16, 2013, 08:19:56 PM
gotcha - thanks. So there's no way around this huh?
Title: Re: Embed BBCode
Post by: mcornetto on May 03, 2013, 06:41:31 PM
Is there a way to change the default sizes the embed tag comes up with?
Title: Re: Embed BBCode
Post by: akbora on May 19, 2013, 02:14:03 PM
I installed this mod but I can not where the post setting and no gif icon the post area
Title: Re: Embed BBCode
Post by: Bandicoot on May 31, 2013, 11:52:02 AM
This is a great mod. I tried another one and it didn't work for me. This one is simple and effective.

The only problem I have found so far is, if you edit a post, the embed code stops working. It looks the same, but you don't get the video - only the raw code.

I noticed that when editing, the code highlights the embedded hyperlinks. So I unticked the SMF option to automatically parse URL's and now I can edit posts without losing the video itself.

Just wondering if that was the problem or if there could have been another reason? It's fixed, but if there is a simpler solution I would like to get back my URL parsing if possible.
Title: Re: Embed BBCode
Post by: nikan on May 31, 2013, 02:02:01 PM
Thanks for using my mod Cobber.
I tried both enabled and disabled URLs parsing but i can't reproduce this problem.
Title: Re: Embed BBCode
Post by: Bandicoot on June 01, 2013, 03:28:39 AM
Ah well, such is the fickleness of computers and software.

I will continue to use your mod though, as it does its job which is the main thing.
Title: Re: Embed BBCode
Post by: Zirkon on July 15, 2013, 09:10:18 PM
Hey Nikan any chance of being able to use this mod with www.imgur.com photo albums. They uses  iframe

<iframe class="imgur-album" width="100%" height="550" frameborder="0" src="http://imgur.com/a/albumserialnumberhere/embed"></iframe>

They look really nice when embedded in a post.
Thanks
Title: Re: Embed BBCode
Post by: sanax on October 18, 2013, 05:04:27 PM
Quote from: nikan on July 24, 2012, 04:35:49 AM
For iframe and legacy share of viddler videos

Find
elseif (preg_match(\'~embed.+src=(?:&quot;|[\\\'"])((?:http|https)://(?:www.)?(?:youtube|youtube-nocookie|dailymotion|vimeo|metacafe|megavideo|veoh).com/.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = $matches[1];


Add bellow
elseif (preg_match(\'~(?:iframe|embed).+src=(?:&quot;|[\\\'"])//www.viddler.com/(?:embed|player)/([a-z0-9]+)/.+(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$data[0] = \'http://www.viddler.com/simple/\' . $matches[1];


I still can't get this mod to work to embed <iframe>

I'm using smf 2.0.5 - In which file will I find the above code?
Title: Re: Embed BBCode
Post by: Divine27 on February 21, 2014, 01:02:23 PM
I love this mod, but can someone explain to me how to post vimeo videos? I've tried several times and just get the url or embed code to pop up. :( Also was wondering how to change the default size as well. Thanks. x
Title: Re: Embed BBCode
Post by: nikan on February 21, 2014, 01:09:30 PM
Enable flash on posts.

[ embed=640,480 ] or any values for width and height
Title: Re: Embed BBCode
Post by: Divine27 on February 21, 2014, 01:30:16 PM
Got it! Thank you so much! :D
Title: Re: Embed BBCode
Post by: ivanTW on March 29, 2014, 06:41:58 PM
Hello Forum,

I just downloaded this mod and everything went well, but I don't see the embed button and I'm not sure how to get it to work. I downloaded it, uploaded and installed it and it said everything worked. I went into a new post and looked for an "embed button" but I don't see one.

I also went into post settings and enabled flash posts and made sure in the bbc code section that the embed tag was active, but I still don't see how to use it.

1. I tried just posting a youtube embed script in a post but that didn't do anything. I also tried writing [embed][/embed] tags around my youtube script and that didn't work either.

Is there anyone that knows what I am doing wrong?????

Thanks a BUNCH!!!  :)
Title: Re: Embed BBCode
Post by: nikan on March 30, 2014, 03:38:48 AM
What version of SMF you're using and which theme.
What youtube script you are inserting, post it here inside code tag.

If you have enabled flash in posts you should see the button, try cleaning smf cache.

The script should work if you type the embed tag by hand as all smf tags.
You see the youtube embed code or nothing at all?
If you see nothing just give dimensions in embed tag like [embed=400,300]youtube embed code[/embed]
Title: Re: Embed BBCode
Post by: ivanTW on March 30, 2014, 05:33:53 PM
nikan

Thanks for the reply,

I just converted to 2.0.7 SMF
<iframe width="560" height="315" src="//www.youtube.com/embed/_o1E8K5WwWg" frameborder="0" allowfullscreen></iframe>

That is just a random video, but I assume I should use the embed code instead of the url? (I've tried using both.)

I attached the message I get when I use the embed tag you suggested ( [embed=400,300]youtube embed code[/embed] ). I am the owner and administrator of the forum so I should have all access, not sure what I need to change.

Currently NOTHING happens or I get the message that I attached below.

Thanks for your help.
Title: Re: Embed BBCode
Post by: nikan on March 30, 2014, 05:44:32 PM
I just tested your example code and i can see the video.
It must be a problem in your forum setup after the conversion.
Title: Re: Embed BBCode
Post by: ivanTW on March 30, 2014, 05:53:07 PM
QuoteI just tested your example code and i can see the video.
It must be a problem in your forum setup after the conversion.

What does the bbcode button look like? I'm not seeing it. I actually installed this mod in 2.0.6 and wasn't able to use the embed mod then, so I tried converting to 2.0.7 to see if that would work.

Oh, I forgot to tell you, I am using the NOVO theme by Diego Andres. I actually went to the SMF parser and looked in my php files to see the changes that the mod does and they are all there, any idea why the button is not showing or why I am getting the attached message?????

Other than installing the mod and making sure flash is allowed, are there any other needed admin changes?
Title: Re: Embed BBCode
Post by: nikan on March 30, 2014, 06:09:17 PM
So, you did an upgrade not convert your forum.

For different themes it only needs the image 'embed.gif' to be copied in Themes/YourThemeName/images/bbc folder.
There is an option at the installation to select in which theme will be installed.

Nothing else is needed.

Try the repair tool: http://download.simplemachines.org/index.php?thanks;filename=repair_settings.php
Title: Re: Embed BBCode
Post by: ivanTW on March 30, 2014, 06:32:08 PM
nikan!

It's solved NOW!!!

Thanks so much for your help and your replies. Much appreciated. I had to go through and deactivate flash and activate it again and that worked in my post settings and then the embed gif appeared as well.

Thanks a bunch!!!
Title: Re: Embed BBCode
Post by: Nucleorion on June 20, 2014, 12:59:29 PM
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
Title: Re: Embed BBCode
Post by: nikan on June 20, 2014, 01:42:18 PM
Sorry, from version 1.3 you can use embed code only from: megavideo, metacafe, dailymotion, veoh, vimeo, youtube.
Title: Re: Embed BBCode
Post by: 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.
Title: Re: Embed BBCode
Post by: nikan on July 02, 2014, 06:38:10 AM
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>',
),
Title: Re: Embed BBCode
Post by: mikejezz on August 27, 2014, 05:36:18 AM
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?
Title: Re: Embed BBCode
Post by: 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']
),
Title: Re: Embed BBCode
Post by: mikejezz on August 27, 2014, 06:00:05 AM
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 :)
Title: Re: Embed BBCode
Post by: assafk on December 29, 2014, 09:07:39 AM
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
Title: Re: Embed BBCode
Post by: nikan on December 29, 2014, 10:05:43 AM
Enable flash in posts
Title: Re: Embed BBCode
Post by: assafk on December 29, 2014, 10:08:37 AM
Hey
Where do i enable the flash on post?
Can you show me ? Print screen?

Please...
Title: Re: Embed BBCode
Post by: Steve on December 29, 2014, 11:22:28 AM
Admin -> Posts and Topics -> Post Settings
Title: Re: Embed BBCode
Post by: thananit on January 03, 2015, 01:21:39 AM
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;

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fupic.me%2Fi%2Frg%2F44untitled-1.jpg&hash=1d60893536ff67ba87f2193d6789b6493ffbcd97)

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

Thank you
Thananit
Title: Re: Embed BBCode
Post by: margarett on January 03, 2015, 08:17:17 AM
Try to replace your single quotes with double quotes
Title: Re: Embed BBCode
Post by: thananit on January 03, 2015, 08:35:05 AM
I try it but still don't show the VDO.
Title: Re: Embed BBCode
Post by: Arantor on January 03, 2015, 08:37:51 AM
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.
Title: Re: Embed BBCode
Post by: halpaslan on February 25, 2015, 03:32:38 AM
Is it possible to use this mod with onedrive embedded links?
Title: Re: Embed BBCode
Post by: ivanTW on February 27, 2015, 05:09:53 PM
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.
Title: Re: Embed BBCode
Post by: nikan on February 28, 2015, 09:01:35 AM
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)
Title: Re: Embed BBCode
Post by: ivanTW on February 28, 2015, 11:18:11 PM
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.
Title: Re: Embed BBCode
Post by: nikan on March 01, 2015, 01:32:20 AM
You need to update your forum and embed mod.
Do your tests with one mod at a time, not both mods enabled.
Title: Re: Embed BBCode
Post by: ivanTW on March 02, 2015, 06:34:23 PM
Thanks for the help Nikan. Will do!
Title: Re: Embed BBCode
Post by: halpaslan on March 12, 2015, 04:42:31 PM
Quote from: halpaslan on February 25, 2015, 03:32:38 AM
Is it possible to use this mod with onedrive embedded links?
Bump!
Title: Re: Embed BBCode
Post by: FragaCampos on October 31, 2015, 04:59:25 PM
Hi there.
What's the difference between this mod and using html tags?
Title: Re: Embed BBCode
Post by: PracticalLightning on August 31, 2018, 02:41:10 PM
I just got this running in SMF 2.1 Beta 3
I needed this to work because I was using it in a site that I upgraded when I changed servers.

Installing the MOD resulted in =>
    Execute Modification        ./Sources/Subs.php | successful | failed | successful |
    Execute Modification        ./Sources/Subs-Editor.php | successful | failed | successful |

So I had to manually do the following:

in ./Sources/Subs.php
Code (Find)
array(
'tag' => 'flash',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',
'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">',
'validate' => function (&$tag, &$data, $disabled)
{
if (isset($disabled['url']))
$tag['content'] = '$1';
$scheme = parse_url($data[0], PHP_URL_SCHEME);
if (empty($scheme))
$data[0] = '//' . ltrim($data[0], ':/');
},
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
),


Code (Add After) (NOTE: This includes my own mods to embed Archive.org streams and Real.video iframes)
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;|[\\\'"])(?:https?\:)?\/\/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;|[\\\'"])(?:https?\:)?\/\/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];
// begin masodos MOD to embed Archive.org iFrames
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])(?:https?\:)?\/\/archive.org\/stream\/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$tag[\'content\'] = \'<iframe src=https://archive.org/stream/\' . $matches[1] . \' width=$2 height=$3 frameborder=0  allowfullscreen></iframe>\';
// end masodos MOD to embed Archive.org iFrames
// begin masodos MOD to embed real.video iFrames
elseif (preg_match(\'~iframe.+src=(?:&quot;|[\\\'"])(?:https?\:)?\/\/www\.real\.video\/embed\/(.*?)(?:&quot;|[\\\'"])~i\'.($context[\'utf8\'] ? \'u\' : \'\'), $data[0], $matches))
$tag[\'content\'] = \'<iframe src=https://www.real.video/embed/\' . $matches[1] . \' width=$2 height=$3 frameborder=0  allowfullscreen></iframe>\';
// end masodos MOD to embed real.video iFrames

else
$tag[\'content\'] = \'$1\';
'),
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
),


~AND~

in ./Sources/Subs-Editor.php
Code (Find)
array(
'code' => 'table',
'description' => $editortxt['table']
),
array(
'code' => 'code',
'description' => $editortxt['bbc_code']
),


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


Last (and perhaps least) had to convert the "embed.gif" to "embed.png" so it shows on the toolbar in editor.

see in action: http://DeBurger.com/vestibule/
Title: Re: Embed BBCode
Post by: njtweb on August 31, 2018, 08:56:02 PM
I see you're running live. I have 32 mods on my 2.0.15 site. Did you have a lot of mods, if so was the transition successful for them, (besides this one) after upgrade?
Title: Re: Embed BBCode
Post by: Kellers on February 13, 2024, 12:05:33 PM
Does anyone know how to add Rumble to this mod list? Great mod but I need Rumble as well.