MyBB Community Forums

Full Version: youtube code is creating the link http://www.youtube.com/v/58;//www.youtube.com/watch
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm integrating myBB with the rest of my site (quite thoroughly)

One of the integration things that I'm doing, is using the wysiwyg editor on other sections of the site.

I've got most of the code to parse bb correctly, but the youtube video links seem to be always getting converted to:

http://www.youtube.com/v/58;//www.youtube.com/watch

(you can see what I mean here: rightsfortenants.co.uk/edittemplate.php?id=1)

In my php code, I've included:
define("IN_MYBB", 1);
require_once "forum/global.php";
require_once "forum/inc/class_parser.php";
$parser = new postParser;
	$rules_parser = array("allow_html" => 0,
		"allow_mycode" => 1,
		"allow_smilies" => 1,
		"allow_imgcode" => 1,
		"allow_videocode" => 1);
$displayedContent = $parser->parse_message($Content, $rules_parser)

The youtube link that I used was: http://www.youtube.com/watch?v=GhB_72yymEs, and on the forum it gets correctly coverted to:
<object data="http://www.youtube.com/v/GhB_72yymEs" style="width: 450px; height: 366px;" class="video_embed" type="application/x-shockwave-flash"><param value="http://www.youtube.com/v/GhB_72yymEs" name="movie"></object>

but on the other pages, it doesn't seem to be getting parse correctly, it gets parsed to:
<object data="http://www.youtube.com/v/58;//www.youtube.com/watch" style="width: 450px; height: 366px;" class="video_embed" type="application/x-shockwave-flash"><param value="http://www.youtube.com/v/58;//www.youtube.com/watch" name="movie"></object>
any idea why?

Bah, it was my own regex makesafe function... works fine with the method I've mentioned