Should this be possible ?

Get help developing custom BBCodes or request one.
Post Reply
User avatar
DoYouSpeakWak
Registered User
Posts: 2307
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Name: Hans Lassen
Contact:

Should this be possible ?

Post by DoYouSpeakWak » Sun Sep 07, 2014 9:50 am

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 ?
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid phpBB help and System administrator services.

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Should this be possible ?

Post by Oyabun1 » Sun Sep 07, 2014 10:05 am

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.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Should this be possible ?

Post by RMcGirr83 » Sun Sep 07, 2014 11:20 am

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 400 times
this is what shows when clicked on
Noname1.jpg
Noname1.jpg (37.86 KiB) Viewed 400 times
All that is required is that the poster simply post a youtube link.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Lumpy Burgertushie
Registered User
Posts: 66470
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Should this be possible ?

Post by Lumpy Burgertushie » Sun Sep 07, 2014 1:21 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
DoYouSpeakWak
Registered User
Posts: 2307
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Name: Hans Lassen
Contact:

Re: Should this be possible ?

Post by DoYouSpeakWak » Sun Sep 07, 2014 4:32 pm

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.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid phpBB help and System administrator services.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66470
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Should this be possible ?

Post by Lumpy Burgertushie » Sun Sep 07, 2014 4:42 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Post Reply

Return to “Custom BBCode Development and Requests”