Page 1 of 1

Should this be possible ?

Posted: Sun Sep 07, 2014 9:50 am
by DoYouSpeakWak
Yes a catchy title is it not. This is about bbcodes.

The other day i was trying to get youtube to work and i found out that youtube deploys an array of urls and url formats, making it hard for the users just to punch in any youtube url and still get away with it. I had to just demand the users specify the vid id and hence making them work a bit more.

This would not have been an issue if phpbb3 allowed more than one hit. For youtube you need quite a few entries.

Code: Select all

[youtube]http://www.youtube.com/watch?v={IDENTIFIER}[/youtube]
[youtube]http://www.youtu.be//watch?v={IDENTIFIER}[/youtube]
[youtube]https://www.youtube.com/watch?v={IDENTIFIER}[/youtube]
[youtube]https://www.youtu.be//watch?v={IDENTIFIER}[/youtube]
[youtube]http://www.youtu.be/{IDENTIFIER}[/youtube]
[youtube]https://www.youtu.be/{IDENTIFIER}[/youtube]
[youtube]http://youtube.com/watch?v={IDENTIFIER}[/youtube]
[youtube]http://youtu.be//watch?v={IDENTIFIER}[/youtube]
[youtube]https://youtube.com/watch?v={IDENTIFIER}[/youtube]
[youtube]https://youtu.be//watch?v={IDENTIFIER}[/youtube]
[youtube]http://youtu.be/{IDENTIFIER}[/youtube]
[youtube]https://youtu.be/{IDENTIFIER}[/youtube]
What do you guys say. Does it make sense to have more the option of more than one entry in the bbcode usage ?

Re: Should this be possible ?

Posted: Sun Sep 07, 2014 10:05 am
by Oyabun1
Please follow the rules here, including the one about descriptive subjects.

Feature requests should be made in the Development Discussion forums as a request for comments (RFC) or the phpBB Ideas forum.

Re: Should this be possible ?

Posted: Sun Sep 07, 2014 11:20 am
by RMcGirr83
I will post this here for you but will not provide any support for it. The following will extract the youtube_id from whichever link they post from youtube using jQuery and will place the youtube link into colorbox js.

Code: Select all

$("a.postlink").filter(function(){if($(this).attr("href").match("(http|https)://(www.|m.)?youtube|youtu.be")){youtube_id=$(this).attr("href").match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/)[2];$(this).html('<p style="text-align:center;"><img src="http://img.youtube.com/vi/'+youtube_id+'/2.jpg" /></p>'); var a=$(this).find("img");$.ajax({url:"http://gdata.youtube.com/feeds/api/videos/"+youtube_id+"?v=2&alt=jsonc",dataType:"json",success:function(b){$(a).after("<br />"+b.data.title+" - "+b.data.duration+" seconds")}});return $(this).attr("href","http://www.youtube.com/embed/"+youtube_id+"?autoplay=1")}}).colorbox({iframe:!0,innerWidth:640,innerHeight:425})
This is what shows in the topic
Noname.jpg
Noname.jpg (15.31 KiB) Viewed 406 times
this is what shows when clicked on
Noname1.jpg
Noname1.jpg (37.86 KiB) Viewed 406 times
All that is required is that the poster simply post a youtube link.

Re: Should this be possible ?

Posted: Sun Sep 07, 2014 1:21 pm
by Lumpy Burgertushie
youtube provides a simple embed link when you click on the share button.

it is the new iframe embed method.

if you inform your users how to use it, it works all the time and you only need one bbcode.

bbcode:

Code: Select all

[youtube]{TEXT}embed/{IDENTIFIER}{TEXT2}[/youtube]
html replacement:

Code: Select all

<iframe width="420" height="315" src="http://www.youtube.com/embed/{IDENTIFIER}" frameborder="2"></iframe>
help line:

Code: Select all

[youtube]copy and paste the iframe embed code here[/youtube]
robert

Re: Should this be possible ?

Posted: Sun Sep 07, 2014 4:32 pm
by DoYouSpeakWak
Lumpy Burgertushie wrote:youtube provides a simple embed link when you click on the share button.

it is the new iframe embed method.

if you inform your users how to use it, it works all the time and you only need one bbcode.

bbcode:

Code: Select all

[youtube]{TEXT}embed/{IDENTIFIER}{TEXT2}[/youtube]
html replacement:

Code: Select all

<iframe width="420" height="315" src="http://www.youtube.com/embed/{IDENTIFIER}" frameborder="2"></iframe>
help line:

Code: Select all

[youtube]copy and paste the iframe embed code here[/youtube]
robert
That would solve it. Thx very much Robert. Im sure it will come in handy.

I should have been more precise. This was not a bbcode request or a feature/function request but a discussion if more lines should be allowed in the html usage field in general.

Re: Should this be possible ?

Posted: Sun Sep 07, 2014 4:42 pm
by Lumpy Burgertushie
since I believe that anything is possible, I would assume that some type of MOD could be written that would allow multiple choice in one bbcode, but in the current code you can't have multiple choices for one bbcode.


robert