PDA

View Full Version : bbcode video render on external page


derfelix
19 Dec 2009, 17:46
Hello, I have an external page.. on which a user can enter stuff in a textarea...
I activated bbcode, and used the picture comment editor as template as it was for me the clearest to use..
after adding the needed javascript and caching the bbcode templates.. it works like a charm...
Except the video bbcode.. (i managed to get the ajax working so it can be added in editor - that part works)

Only the video is parsed as a link.. not as inline video...
(on picture comments the same video works fine)

I managed to get it working by adding these 2 lines before i parse the bbcode..:
require_once(DIR . '/includes/functions_video.php');
$post['pagetext'] = parse_video_bbcode($post['pagetext']);

But it should parse the video without these 2 lines... (or am I wrong?)

so the total code.. that (at least I think should work - but it doesnt)
looks like this:

$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$post['message'] = $bbcode_parser->do_parse($post['pagetext'], 0, true, true, true);

( I alse tried:
$post['message'] = $bbcode_parser->parse($post['pagetext'], 'picturecomment', true);

But it didnt work either... gives the same result as the other one...


But I managed to get it working by doing this:

$bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
require_once(DIR . '/includes/functions_video.php');
$post['pagetext'] = parse_video_bbcode($post['pagetext']);
$post['message'] = $bbcode_parser->do_parse($post['pagetext'], 0, true, true, true);

It works, but I think it should work without the 2 extra lines...

QUESTION: what am I doing wrong so I would get the first method working?


thx for any suggestions

Felix