UseBB Community

The official board for UseBB help and discussion

UseBB Community » Resources & Customization » Youtube, google video embed bbcode..

Youtube, google video embed bbcode..

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: Oct 2006
Posts: 37
Dear Friends out there..
I just want to ask you about is it possible to make a bbcode to embed google videos and/or youtube videos in usebb forum.

Example of the bbcode will look like this:

Full Url:
[youtube]http://www.youtube.com/watch?v=WoE6J0IHauA[/youtube]


Or Video ID only:
[youtube]WoE6J0IHauA[/youtube]


The original html code looks like this by youtube:

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


When we run a new forum as new starter it is difficult to fill our forum with many content. Even when we start a new thread with questions or something like no one will use their time on a new forum because there already many forums with millions of content out there.

I thinks this the only way to cover many people.
Please help me to do this bbcode.

I believe it is easy.
« Last edit by Dietrich on Thu Oct 26, 2006 8:03 pm. »
Member
Registered: Apr 2006
Posts: 57
Location: Athens, Greece
Yes, it is easy. Just open "<root>/sources/functions.php" and seek this code:

// [google=keyword]text[/google]
"#\[google=(.*?)\](.*?)\[/google\]#is" => '<a href="http://www.google.com/search?q="'.$rel.'></a>',


When you find it (ignore whitespaces!) add after the code below:

// [youtube]text[/youtube]
"#\[youtube\](.*?)\[/youtube\]#is" => '<object width="425" height="350"><param name="movie" value="\\\\1"></param><param name="wmode" value="transparent"></param><embed src="\\\\1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>',


To use it, just type:

[youtube]http://www.youtube.com/v/WoE6J0IHauA[/youtube]


:)
« Last edit by Dietrich on Wed Oct 25, 2006 5:50 pm. »
Developer
Registered: Apr 2004
Posts: 2224
Location: Belgium
I changed your code, as it was missing some references. Also, it's a bit tricky to post code with backslashes over here, yet another issue that will be resolved with v2.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Oct 2006
Posts: 37
Hi again.. Thanks for the code hack..
I have tested it today and I am unable to play the video.. The video just showing in the forum and I cannot play it.. Play button is doesn`t work..

Please test it and tell me what the problem is.. Thank you.. ;)
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: Apr 2006
Posts: 57
Location: Athens, Greece
I have tested it before posting ;)

The code works OK, if you click the play button the video will load. At least that happened with my locally hosted retail usebb. Just refresh the page, it might work.
Member
Registered: Oct 2006
Posts: 37
Hi Next Step. It works perfectly in Internet Explorer. The problem is when I tried it on Firefox Browser.
Please check it on Firefox too.. Let me hear what is the problem.

Thank you so much..
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.
Member
Registered: Apr 2006
Posts: 57
Location: Athens, Greece
I don't know what's wrong here, sorry. I never use IE, I have tested it on Mozilla Firefox 2.

In fact, I wouldn't be surprised if there where any bugs with IE (crappy soft) but in FF it works for sure.

Could you please ask one of your forum users if it works for them? It might be your system configuration.
Member
Registered: Oct 2006
Posts: 37
Thank you for the idea Next Step. It works now.. I have asked all of my forum members to test it and no one have any problem only me who had the problem.

I now have found out that and solved. Thanks again.
_______________
"Three things cannot be long hidden: the sun, the moon, and the truth." - said by Buddha.

Page: 1

UseBB Community » Resources & Customization » Youtube, google video embed bbcode..

UseBB Community is powered by UseBB 1 Forum Software