1 (edited by GoglGourd 2007-09-03 20:54)

Topic: YouTube BB Mod 1.0.0

##
##
##        Mod title:  YouTube BB Mod
##
##      Mod version:  1.0.0
##   Works on PunBB: 1.2.1, ?
##     Release date:  2005-02-06
##           Author:  GoglGourd (myLBFH.co.uk)
##
##      Description:  This mod allows users to wrap youtube links in [youtube]
##                    then embeds the player on the forum
##
##   Affected files:  include/parser.php
##                   
##
##       Affects DB:  No
##
##            Notes:   Only began using punBB 30mins ago, really enjoying it! Hope
##                    this is of use to someone! Enjoy!
##                    to use, find your youtube link eg.
##                    http://youtube.com/watch?v=pJM39EytAYU
##                    and place [youtube][/youtube] tags around it.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Sorry if it's rubbish or been done before: this is my first mod, I only discovered PunBB about 30 minutes ago and just thought I'd have a try.

http://www.goglgourd.co.uk/punbb/youtube.txt

Re: YouTube BB Mod 1.0.0

http://www.punres.org/desc.php?pid=288
Already created wink

Welcome though big_smile

3 (edited by GoglGourd 2006-12-02 17:02)

Re: YouTube BB Mod 1.0.0

lol ah well, ty ;)

..found a slight problem with the one already created

"#\[youtube\]http://www.youtube.com/watch\?v=(.*?)\[/youtube\]#s"

would mean the user has to have visited via www. mine offers that optionally. Hmm, will try to think of something original then :P

Re: YouTube BB Mod 1.0.0

GoglGourd wrote:

..found a slight problem with the one already created

Among many. tongue

My mod works, but I haven't gone to much effort to make it go beyond that.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: YouTube BB Mod 1.0.0

Does the youtube mod make the forum load any slower?
I mean...it's not the same if you had just a link posted than if you had an embeded video. Or is it?

If you do what you've always done, you'll get what you've always gotten.

Re: YouTube BB Mod 1.0.0

well if you do it that way it'll be a pain for your users when there are such easy alternatives. to be honest 2 lines of code is going to have a tiny effect and if your forum is popular enough/uses a lot of youtube videos you'll save some space - but again, tiny amounts..

Re: YouTube BB Mod 1.0.0

Hmm..So is that "use it", or "not use it"? "Makes it load slower" or "not"? smile

If you do what you've always done, you'll get what you've always gotten.

Re: YouTube BB Mod 1.0.0

Makes it load slower but use it; it'll be too small to notice. While I can't deny it does make it load slower, I can assure you won't notice a difference unless you have some very, very, VERY accurate timing methods tongue. It's just not worth fussing/worrying about. Try it and I'll bet you don't notice a thing.

Re: YouTube BB Mod 1.0.0

Alright, thanks for your answer smile.

If you do what you've always done, you'll get what you've always gotten.

Re: YouTube BB Mod 1.0.0

No problem, hope you find it of use (if you decide to use it that is tongue).

Re: YouTube BB Mod 1.0.0

Yep, pretty useful.
Thanks smile.

If you do what you've always done, you'll get what you've always gotten.

Re: YouTube BB Mod 1.0.0

Great hack. Thanks!

13

Re: YouTube BB Mod 1.0.0

I do not understand. There is written:

##   Affected files:  include/parser.php
##                    edit.php

But changes which is made are only in parser.php...

Re: YouTube BB Mod 1.0.0

Ahmed wrote:

I do not understand. There is written:

##   Affected files:  include/parser.php
##                    edit.php

But changes which is made are only in parser.php...

Sometimes the readme files have some mistakes, or are not updated after many changes. Just follow the steps, it's a pretty easy mod smile.

If you do what you've always done, you'll get what you've always gotten.

Re: YouTube BB Mod 1.0.0

muhahaha! thanks, sorted.

16

Re: YouTube BB Mod 1.0.0

Papillon wrote:
Ahmed wrote:

I do not understand. There is written:

##   Affected files:  include/parser.php
##                    edit.php

But changes which is made are only in parser.php...

Sometimes the readme files have some mistakes, or are not updated after many changes. Just follow the steps, it's a pretty easy mod smile.

Doesnt work for me. Maybe becouse I use russian modification?
:-(

I got this:

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

Re: YouTube BB Mod 1.0.0

if you email your source for parser.php i'll be happy to install it for you? goglgourd <at> gmail.com wink

18

Re: YouTube BB Mod 1.0.0

I went step-by-step but I get this:

Parse error: syntax error, unexpected T_VARIABLE in /var/www/forum/include/parser.php on line 324

(when i try to access the topic and when i click reply)

Re: YouTube BB Mod 1.0.0

I installed this mod before, and it worked just fine when I had the puntoolbar 1.4.
Then, I updated to puntoolbar to 1.5, and all youtube links became broken ( [youtube]video's url[/youtube])
I tried to reinstall the youtube mod, but I couldn't find this line in parser/php:

'<span class="bbu">$1</span>',

Any ideas?
Thank you.

If you do what you've always done, you'll get what you've always gotten.

Re: YouTube BB Mod 1.0.0

Sorry mate, I've not used PunBB for more than an hour in total and i've not coded in it since i posted this mod so not quite sure about the puntoolbar stuff.. just to clarify, why are you looking for

'<span class="bbu">$1</span>',

when my mod says look for

<span style="color: $1">$2</span>

??

Re: YouTube BB Mod 1.0.0

Well well, it seems that I mixed up two mods, so when I wanted to fix that, I just couldn't.
But I still can not find your line in my parser. This is odd, because all the videos in my forum now gave places to aweful links.

If you do what you've always done, you'll get what you've always gotten.

Re: YouTube BB Mod 1.0.0

haha intriguing... i will have a look at this punbar for you and see if i can make any sense of what's going on

23

Re: YouTube BB Mod 1.0.0

this is a tutorial on how to create a video mod for ur site.
http://www.onlamp.com/pub/a/php/2007/05 … tml?page=4

can someone please design this for punbb?


Q

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: YouTube BB Mod 1.0.0

Can these be used as flash tags?

Re: YouTube BB Mod 1.0.0

no, it only works for youtube.. you could modify the code to make it work with flash though, would be a very simple modification