UseBB Community

The official board for UseBB help and discussion

UseBB Community » Resources & Customization » YouTube embed reactivated!

YouTube embed reactivated!

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: Aug 2008
Posts: 5
Location: Poland
Hi there,

Some time ago i decided to use UseBB as my Warrock gaminig squad forum platform, mostly for it's simplicity, elegance and speed... But then i noticed that gamers like YouTube movies and UseBB did not provide any real-world solution for embedding them.

I've found this topic and used it as a base for what i did.

My version of the YouTube video embed mod actually has few good and bad sides of the medal. (Apart from the fact it was written in a rush, without taking too much care of the possible bugs).

Let me start from the good ones:
- it embeds the movie directly from the browser URL and does not need any "difficult" youtube.com/v/ID translations. just paste the URL address where you see the movie on youtube
- it produces valid XHTML 1.0 Strict flash embed code :mrgreen:
- it provides a YouTube button on the BBCode toolbar (when editing/posting new post)
- it adds external function for translating the youtube www url to youtube video embed url; a function that can be easily debugged or enhaced by third parties

Now the bad ones:
- it breaks the beautiful idea of having all the BBCode as regexp replacements in a singular array and adds a nasty, maybe a bit redundant function at the end of BBCode parsing function :(
- the YouTube button on BBCode toolbar is small-capsed and it does not use the language files (i really wrote it only for my gaming squad usage... anyway those things should not be hard to change)
- i guess it won't be supported by the official usebb releases
- some variable/function names are really stupid :P


There are pretty much of changes in source/functions.php so i decided to publish GNU patch (diff) file instead of posting the quoted code here.

So, there you go

usebb-1.0.9-youtube1.diff.gz

Download the file, put it in your main UseBB directory, log on to shell and run:

$ gzip -dc usebb-1.0.9-youtube1.diff.gz|patch -p1


Cheers, hope you enjoy! 8)


PS.
Ooops.. I almost forgot about the users without *NIX experience :)

functions.php-usebb-1.0.9-youtube1.zip

Download this file, unzip and place it in your usebb's sources/ directory.

And in both cases:
Don't forget to backup the original file!
Member
Registered: Aug 2008
Posts: 5
Location: Poland
Something i forgot to post in the "bad things" above. The youtubize() function should be rewritten by some regex hacker which i am not... lol

Page: 1

UseBB Community » Resources & Customization » YouTube embed reactivated!

UseBB Community is powered by UseBB 1 Forum Software