1

Topic: Youtube tag.

Hi all,

I'm fairly new to Punbb and so far have only tried out Punbb 1.2.21, I'm not eager to upgrade it to 1.3.x as I've integrated the forum into my wordpress site and its already been built up.

I'm however trying out the youtube tag but that somehow doesn't seem to work.

Here's my parser.php

$pattern = array('#\[b\](.*?)\[/b\]#s',
                     '#\[i\](.*?)\[/i\]#s',
                     '#\[u\](.*?)\[/u\]#s',
                     '#\[url\]([^\[<]*?)\[/url\]#e',
                     '#\[url=([^\[<]*?)\](.*?)\[/url\]#e',
                     '#\[email\]([^\[<]*?)\[/email\]#',
                     '#\[email=([^\[<]*?)\](.*?)\[/email\]#',
                     '#\[item=([^\[]*?)\]#',
                     '#\[youtube\]http://www.youtube.com/watch\?v=(.*?)\[/youtube\]#s',
                     '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');

    $replace = array('<strong>$1</strong>',
                     '<em>$1</em>',
                     '<span class="bbu">$1</span>',
                     'handle_url_tag(\'$1\')',
                     'handle_url_tag(\'$1\', \'$2\')',
                     '<a href="mailto:$1">$1</a>',
                     '<a href="mailto:$1">$2</a>',
                     '<a href="http://www.wowhead.com/?item=$1">$1</a>',
                     '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>',
                     '<span style="color: $1">$2</span>');

Is there something wrong I'm doing here?

2

Re: Youtube tag.

Btw I tried with [youtube]videoid[/youtube] and it's full URL and that doesn't work either. Can anyone help me with this please? This is my site. Http://www.rebirth-saurfang.com/forum

Re: Youtube tag.

Your code works properly for me. I have tried this BBCode-tag:

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

4

Re: Youtube tag.

Hi Slavok,

Thanks for the reply, you mean you tried it with [youtbe]full url of youtube video[/youtube] on your own setup and it works?

Strange thing is that i tried that and it does work at all. I'm wondering if its because the <object cannot be embedded?

5

Re: Youtube tag.

Srut wrote:

Strange thing is that i tried that and it does work at all. I'm wondering if its because the <object cannot be embedded?

The object tag is the correct way to embed information in a page. What browser are you testing with?

6

Re: Youtube tag.

Hi MattF,

I'm using Safari and Firefox. I'm on a Mac. Anyways, on my work laptop, (Both IE7 & Firefox 3.0) it still doesn't display.

Could it be because of my parser.php file?

Re: Youtube tag.

Srut wrote:

Hi Slavok,

Thanks for the reply, you mean you tried it with [youtbe]full url of youtube video[/youtube] on your own setup and it works?

Yes, it is. I am in Windows XP, I have tested it in IE 7, Firefox 4, Opera 9.

Srut wrote:

Could it be because of my parser.php file?

Have you got any others changes in parser.php?

8

Re: Youtube tag.

Hi Slavok,

Other than the [youtube] tag, this was added too.

If you want to handle tags of this form: [item=Doombringer] then do the following:

Edit include/parser.php and change the following lines:

After this line:

'#\s*\[/email\]#i',

Add this line:

'#\[item=("|\'|)(.*?)\\1\]\s*#i',

After this line:

'[/email]',

Add this line:

'[item=$2]',

After this line:

'#\[email=([^\[]*?)\](.*?)\[/email\]#',

Add this line:

'#\[item=([^\[]*?)\]#',

After this line:

'<a href="mailto:$1">$2</a>',

Add this line:

'<a href="http://www.wowhead.com/?item=$1">$1</a>',