Should this be possible ?

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

Should this be possible ?

Post 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 ?
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid services. 10+ years of experience with phpBB3 and as System Administrator.
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 »

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: 21327
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Should this be possible ?

Post 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 442 times
this is what shows when clicked on
Noname1.jpg
Noname1.jpg (37.86 KiB) Viewed 442 times
All that is required is that the poster simply post a youtube link.
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
User avatar
Lumpy Burgertushie
Registered User
Posts: 68003
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Should this be possible ?

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

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
DoYouSpeakWak
Registered User
Posts: 2310
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Contact:

Re: Should this be possible ?

Post 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.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid services. 10+ years of experience with phpBB3 and as System Administrator.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68003
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Should this be possible ?

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

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
Post Reply

Return to “Custom BBCode Development and Requests”