YouTube Mod

Get help developing custom BBCodes or request one.
User avatar
Jens Gutzeit
Registered User
Posts: 3
Joined: Wed Dec 13, 2006 9:25 pm
Location: Krefeld (Germany)
Contact:

Re: YouTube Mod

Post by Jens Gutzeit »

Hello,

I've written a mod for embedding flash-videos of several sites (youtube, google video, sevenload, many more), too. You can test it and download the source on my test forum:

http://www.gutzeit.gooba.de/index.php

For the next version I'll cleanup the code a bit and add support for a direct conversion from urls to bbcode, just like the magic-url thing.

Currently the URL based video insertion works with:
Parsing of embed-code works with (nearly) any page which produces non-javascript-based embed codes with more or less valid HTML (the script fixes the most common HTML problems before trying to parse it).
custmguru®
Registered User
Posts: 233
Joined: Wed Apr 10, 2002 6:06 pm
Location: Somewhere, Over the rainbow
Contact:

Re: YouTube Mod

Post by custmguru® »

Jens Gutzeit wrote:Hello,

I've written a mod for embedding flash-videos of several sites (youtube, google video, sevenload, many more), too. You can test it and download the source on my test forum:

http://www.gutzeit.gooba.de/index.php

For the next version I'll cleanup the code a bit and add support for a direct conversion from urls to bbcode, just like the magic-url thing.

Currently the URL based video insertion works with:
Parsing of embed-code works with (nearly) any page which produces non-javascript-based embed codes with more or less valid HTML (the script fixes the most common HTML problems before trying to parse it).
I like this one. it may not be the url submission everyone is asking for but it's clear on what it's asking for. I do understand though, some people are stupid and will not pay attention and there will be dead videos...
User avatar
Jens Gutzeit
Registered User
Posts: 3
Joined: Wed Dec 13, 2006 9:25 pm
Location: Krefeld (Germany)
Contact:

Re: YouTube Mod

Post by Jens Gutzeit »

custmguru® wrote: I like this one. it may not be the url submission everyone is asking for but it's clear on what it's asking for. I do understand though, some people are stupid and will not pay attention and there will be dead videos...
URL-submission just like the magic URL thing is planned for the next release as an add-on. But there is one general problem with URL based flash-link-creation: Some sites (SiamTube as example, but better known ones, too) where you can't create the flash-link by the URL itself. Which would result in a scenario where you can use one method for s.th. around 80% of the pages and have to tell your users, they need to use a different method for the other pages. I do not think this is good usability. This is the reason for my mod being as it is: One box where you can enter both variants. If one doesn't work, try the other, but the task for the user, is the same and not 2 totaly different.
User avatar
stewaia
Registered User
Posts: 113
Joined: Tue Nov 06, 2007 7:42 pm
Contact:

Re: YouTube Mod

Post by stewaia »

jorge89 wrote:I have obtained that it leaves mod youtube:

BBCode:

Code: Select all

[youtube]{TEXT}[/youtube]
Html:

Code: Select all

<object width="425" height="350">
   <param name="movie" value="http://www.youtube.com/v/{TEXT}"></param>
   <embed src="http://www.youtube.com/v/{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed>
</object><br />
<a href="http://youtube.com/watch?v={TEXT}" target="_blank">Youtube</a><br />
Post:

Code: Select all

[youtube]FWOsbGP5Ox4[/youtube]
:D
I just wanted to say that out of all the codes I tried..This was the one that worked perfectly!!
-Alex
The Stock Talk.net - Stock Picks, Analysis, and Discussion

"The eyes are the groin of the head." -Dwight Schrute
User avatar
yexusbeliever
Registered User
Posts: 586
Joined: Mon Dec 08, 2003 8:49 pm
Location: Olympus phpBB3

Re: YouTube Mod

Post by yexusbeliever »

Is there one that can just allow us to use the full youtube link?
njharley
Registered User
Posts: 33
Joined: Thu Jul 12, 2007 3:35 pm

Re: YouTube Mod

Post by njharley »

Code: Select all

[youtube]http://{TEXT1}youtube.com/watch?v={TEXT2}[/youtube]

Code: Select all

<object width="425" height="350"><param name="movie" value="http://{TEXT1}youtube.com/v/{TEXT2}"></param><param name="wmode" value="transparent"></param><embed src="http://{TEXT1}youtube.com/v/{TEXT2}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
This worked for me
User avatar
gowron
Registered User
Posts: 3
Joined: Tue Apr 01, 2008 9:44 pm

Re: YouTube Mod

Post by gowron »

this one by njharley is perfect !

Thanks njharley !
KennyF
Registered User
Posts: 102
Joined: Sun Oct 15, 2006 11:51 am
Contact:

Re: YouTube Mod

Post by KennyF »

Yup! That worked for me too.

Thanks man! 8-)
Liphtier
Registered User
Posts: 8
Joined: Sun Dec 30, 2007 12:19 am

Re: YouTube Mod

Post by Liphtier »

njharley wrote:

Code: Select all

[youtube]http://{TEXT1}youtube.com/watch?v={TEXT2}[/youtube]

Code: Select all

<object width="425" height="350"><param name="movie" value="http://{TEXT1}youtube.com/v/{TEXT2}"></param><param name="wmode" value="transparent"></param><embed src="http://{TEXT1}youtube.com/v/{TEXT2}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
This worked for me
I tried and it didn't work. Actually I don't even understand how should it work.. :roll:
Meanwhile what I did is

Youtube:

BBCODE:

Code: Select all

[youtube]{URL}[/youtube]
HTML REPLACEMENT:

Code: Select all

<object width="425" height="350"><param name="movie" value="{URL}"></param><param name="wmode" value="transparent"></param><embed src="{URL}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
with this modification:
in "includes/bbcode.php" before lines 112 where:

Code: Select all

$message = preg_replace($preg['search'], $preg['replace'], $message);
put this:

Code: Select all

foreach($preg['search'] as $search) {
	if(strpos($search, 'youtube')) {
		$message = preg_replace_callback(
					$preg['search'],
					create_function(
						'$matches',
						'return str_replace("watch?v=", "v/", $matches[0]);'
					),
					$message
		);
	}
}
AcuteAngel
Registered User
Posts: 26
Joined: Wed Jan 14, 2009 7:24 pm

Re: YouTube Mod

Post by AcuteAngel »

If you need to feed the URL of the video movie... try this MOD
http://www.phpbb.com/community/viewtopi ... 0&t=695525

That is for PhpBB3 board
Liphtier
Registered User
Posts: 8
Joined: Sun Dec 30, 2007 12:19 am

Re: YouTube Mod

Post by Liphtier »

Really coool :)
User avatar
hleV
Registered User
Posts: 2
Joined: Sun Dec 27, 2009 4:14 pm

Re: YouTube Mod

Post by hleV »

Here's the simple YouTube BBCode I just written.
Supports full address until the & symbol after the identifier, so people having such link:
http://youtube.com/watch?v=PABdx5Fjd7U&feature=related
must remove the &feature=related part.

Code: Select all

[youtube]{URL}={IDENTIFIER}[/youtube]

Code: Select all

<object type="application/x-shockwave-flash" data="http://youtube.com/v/{IDENTIFIER}" width="425" height="350">
<param name="movie" value="http://youtube.com/v/{IDENTIFIER}" />
<param name="wmode" value="transparent" />
</object>
abcEzy
Registered User
Posts: 232
Joined: Mon May 09, 2005 6:48 pm

Re: YouTube Mod

Post by abcEzy »

You's guys are all using the wrong embed code...

youtube have changed the way they do their embedding now.

just click on their embed link... COPY IT.

Code: Select all

<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/ZqhKzMNTdZ4" frameborder="0" allowfullscreen></iframe>
ok.. now take out this ZqhKzMNTdZ4 from above, and change it to {TEXT} so it looks like this

Code: Select all

<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/{TEXT}" frameborder="0" allowfullscreen></iframe>
simple.
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: YouTube Mod

Post by 4_seven »

iframe is not the best code-practice. here an example without any bbcode: http://www.phpbb.com/community/viewtopi ... #p12271215
Current Mods | Mod Base | php(BB) programming | No help via PM
stevefoxnina
Registered User
Posts: 21
Joined: Mon Apr 18, 2011 6:06 am

Re: YouTube Mod

Post by stevefoxnina »

DualFusion wrote:I hope you know how to add bbcodes :P

Youtube:

BBCODE:

Code: Select all

[youtube]{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>
This method is currently working
http://d2lord.com/phpbb/viewtopic.php?f ... dd60676779

1)login to admin control panel
2) Click Posting,
3) Add New BB code
4) BBCode usage
[youtube]{SIMPLETEXT}[/youtube]
5)HTML replacement
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{SIMPLETEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

6)Display on posting page (Tick)
7) go to your youtube video e.g.
http://www.youtube.com/watch?v=aM5rhOjBB_0
or
http://www.youtube.com/watch?v=VWdpH0Bd ... re=related

8) During posting click youtube button and copy and paste the video code after "=" and before "&"

or
Post Reply

Return to “Custom BBCode Development and Requests”