Youtube BBCode Question

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
deepbassex
Registered User
Posts: 7
Joined: Mon Dec 11, 2006 3:53 am

Youtube BBCode Question

Post by deepbassex » Fri Mar 30, 2007 12:36 am

I was able to find a copy of the youtube bbcode below.

Code: Select all


BBCode Usage:
[youtube={NUMBER1},{NUMBER2}]{TEXT}[/youtube]

HTML Replacement:
<object width="400" height="300"><param name="movie" 
value="http://www.youtube.com/v/{TEXT}"></param><param 
name="wmode" value="transparent"></param><embed 
src="http://www.youtube.com/v/{TEXT}" 
type="application/x-shockwave-flash" wmode="transparent" 
width="400" height="300"></embed></object>

]Help Line
[youtube] url [/youtube]
However, this code requires that you enter the dimensions of the player and only copy the id portion of the youtube url. For example, if I wanted to include a youtube video in a forum i would have to type the following:



I find this to be tedious. Is there anyway I can just make it that all you have to do is copy the url and paste it in?

I have spent hours attempting it on my own and searching for answers with no success. Any help would be appreciated.

User avatar
mikel_man
Registered User
Posts: 184
Joined: Wed Oct 20, 2004 12:56 am
Location: Missouri
Name: Barry Smith
Contact:

Re: Youtube BBCode Question

Post by mikel_man » Fri Mar 30, 2007 1:30 am

use the following for your bbcode

Code: Select all

[youtube]{TEXT}[/youtube]
HTML replace

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{TEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
All the user must do is enter the video id. "the alphanumeric code after teh v" between the opening an closing tag

User avatar
Eelke
QA Team
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Youtube BBCode Question

Post by Eelke » Fri Mar 30, 2007 6:54 am

deepbassex wrote: I find this to be tedious. Is there anyway I can just make it that all you have to do is copy the url and paste it in?

Well, I don't think there is, although I'd have to experiment. What you would need to do is define a BBcode that takes the HTML block, and just has that as its replacement text. I expect, though, that the board, for security and usability reasons, does a htmlencode on any text input from bbcode, so you'd just get a text representation of the HTML if you tried that. Also, even if that would work, I don't think the custom bbcode stuff let's you define validation rules, so it would mean that people could use your BBcode to enter any HTML, not just YouTube stuff.

I think mikel_man's suggestion is much more practical. Do not offer your users to define the size of the video, they'd just abuse it. Set a fixed size that is practical for your board layout and just explain to them they should only get the id from the code, not the entire block of HTML. In the end, I think that will be less error-prone.

Raul Duke
Registered User
Posts: 194
Joined: Sat Jun 25, 2005 9:03 am

Re: Youtube BBCode Question

Post by Raul Duke » Fri Mar 30, 2007 5:11 pm

BBCode usage

Code: Select all

[youtube]http://www.youtube.com/watch?v={TEXT}[/youtube]
HTML replacement

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{TEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
I use that. You just put the whole URL in the tags.
I got into forum administration for the ladies.

deepbassex
Registered User
Posts: 7
Joined: Mon Dec 11, 2006 3:53 am

Re: Youtube BBCode Question

Post by deepbassex » Sun Apr 01, 2007 1:33 am

Great!! Thank you guys!! Raul your code worked like a charm!!! Thank you!!

I appreciate you guys taking the time to check out my post. I am sure this will be a great help to many people!!

User avatar
Eelke
QA Team
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Youtube BBCode Question

Post by Eelke » Sun Apr 01, 2007 7:42 am

I'm surprised it works, but great it does.

User avatar
vishakh369
Registered User
Posts: 99
Joined: Fri Jun 23, 2006 7:52 pm

Re: Youtube BBCode Question

Post by vishakh369 » Sun Apr 01, 2007 6:26 pm

Mr.Raul Duke 500 cheers to you..
i have been searching for this code for decades..But no code worked...atlast the code that you posted worked in the way i wanted...
All will prefer posting the whole link instead of the ID..It is dificult...
and also we can watch the video in the same site..[better than popups]
Thanks very much Raul..
Thank you very much!!!!!
Need any help with phpBB 2 or 3? Ask me!!!

abyss1
Registered User
Posts: 1
Joined: Mon Apr 02, 2007 6:54 am
Location: Holland
Contact:

Re: Youtube BBCode Question

Post by abyss1 » Mon Apr 02, 2007 6:55 am

Actually by slightly modifying the url protion you cn use this pretty much on every online video site I use it with google video now to in the same way.

biocandy
Registered User
Posts: 4
Joined: Mon Jan 08, 2007 7:13 pm

Re: Youtube BBCode Question

Post by biocandy » Fri Apr 06, 2007 10:37 pm

well i have exactly what you guys all posted and it doesnt work. it just shows the bbcode not the replacement html. im using the April 5th CVS

code usage:

Code: Select all

[YOUTUBE]http://www.youtube.com/watch?v={TEXT}[/YOUTUBE]
html replacement:

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{TEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
output:

Code: Select all

[YOUTUBE]http://www.youtube.com/watch?v=dfh349djb[/YOUTUBE]

User avatar
Eelke
QA Team
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Youtube BBCode Question

Post by Eelke » Sat Apr 07, 2007 8:34 am

Versions/CVS dates of the software where it does and doesn't work? Remember, we're still in a a rather volatile state with phpBB 3.0, what works one day may stop working the next.

User avatar
TimJBart
Registered User
Posts: 279
Joined: Mon Jan 28, 2002 8:24 pm

Re: Youtube BBCode Question

Post by TimJBart » Sun May 20, 2007 9:30 pm

I cannot get this code to work no matter what I try in the release candidate.

I have a spoiler BBcode tag working fine, but this youtube one does nothing. It just displays:

[youtube]http://www.youtube.com/watch?v=p0iSdqac7-Q[/youtube]

Do I need to enable html or flash in the admin control panel. This bbcode just doesn't do anything for me!

User avatar
Eelke
QA Team
Posts: 2903
Joined: Thu Dec 20, 2001 8:00 am
Location: NL, Bussum
Name: Eelke Blok
Contact:

Re: Youtube BBCode Question

Post by Eelke » Mon May 21, 2007 6:33 am

Hmm... Don't think you need to enable anything, apart from defining the actual bbcode.

Maybe bbcode parsing has changed since this worked? (It did surprise me somewhat this was possible).

User avatar
christhatsme
Registered User
Posts: 1811
Joined: Sun Jan 16, 2005 10:42 am
Location: London, UK

Re: Youtube BBCode Question

Post by christhatsme » Mon May 21, 2007 7:13 am

This is what you need:

To enter URL

Code: Select all

[youtube]{TEXT}[/youtube]

Code: Select all

<object width="425" height="350"><param name="movie" value="{TEXT}"></param><param name="wmode" value="transparent"></param><embed src="{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
ID Only

Code: Select all

[youtube]{TEXT}[/youtube]

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{TEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/watch?v={{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
Last edited by christhatsme on Tue May 22, 2007 5:19 pm, edited 1 time in total.
All MOD downloads should be back now - Sorry for that and serious lack of support! - If anyone wants to take over or help with any of my MODs the offer would be apreciated as I have little time for phpBB Modding recently!

Again very sorry for not supporting these MODs recently.

User avatar
TimJBart
Registered User
Posts: 279
Joined: Mon Jan 28, 2002 8:24 pm

Re: Youtube BBCode Question

Post by TimJBart » Mon May 21, 2007 10:38 am

I take it your URL code is meant to have http://www.youtube.com/watch?v= in it?

The bbcode using the youtube ID works fine!

the bbcode using the youtube address (http://www.youtube.com/watch?v=) does NOT work.


Is this just me or is everyone getting this problem?

niuck
Registered User
Posts: 6
Joined: Tue Jul 05, 2005 12:52 pm

Re: Youtube BBCode Question

Post by niuck » Mon May 21, 2007 11:17 am

I am having no luck with the URL code either. Trying to get my current ones already posted to work.

Like this one:

Code: Select all

[youtube]http://www.youtube.com/watch?v=PzlcnZ7pmAU[/youtube] 

Locked

Return to “[3.0.x] Support Forum”