Kyojii
04-06-2012, 05:50 AM
I'm parsing bbcode like so...
$bbcode_parser =& new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),false);
echo $bbcode_parser->do_parse($vbulletin->GPC['article']);
However this isn't working for all bbcode, for example the video code doesn't work. And custom bbcode in general don't work. Does anyone know why? I've been looking through the vB documentation but haven't found anything yet.
EDIT:
I found the answer for custom tags here: http://members.vbulletin.com/api/vBulletin/vB_BbCodeParser.html#append_custom_tags
$bbcode_parser->append_custom_tags(); and that's resolved, the video tag is still just returning a link though.
EDIT:
I've been messing around with the handle_bbcode_video() function but I haven't been able to get it to work yet. I've tried using regex to get the video url and pass that in, however that didn't work and I've tried giving it the whole post, however that didn't work either.
--------------- Added 1333747841 at 1333747841 ---------------
*sigh* not sure why but this function doesn't seem to work no matter what data I throw at it. I think I'm calling it wrong or something. I've tried...
$bbcode_parser = new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),false);
$bbcode_parser->handle_bbcode_video('http://www.youtube.com/watch?v=zTpsrqvGL2Q');
and
$bbcode_parser = new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),false);
$bbcode_parser->handle_bbcode_video('http://www.youtube.com/watch?v=zTpsrqvGL2Q');
Which is how the documentation says it should be used, however the same error always gets returned.
Fatal error: Call to a member function handle_bbcode_video() on a non-object
$bbcode_parser =& new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),false);
echo $bbcode_parser->do_parse($vbulletin->GPC['article']);
However this isn't working for all bbcode, for example the video code doesn't work. And custom bbcode in general don't work. Does anyone know why? I've been looking through the vB documentation but haven't found anything yet.
EDIT:
I found the answer for custom tags here: http://members.vbulletin.com/api/vBulletin/vB_BbCodeParser.html#append_custom_tags
$bbcode_parser->append_custom_tags(); and that's resolved, the video tag is still just returning a link though.
EDIT:
I've been messing around with the handle_bbcode_video() function but I haven't been able to get it to work yet. I've tried using regex to get the video url and pass that in, however that didn't work and I've tried giving it the whole post, however that didn't work either.
--------------- Added 1333747841 at 1333747841 ---------------
*sigh* not sure why but this function doesn't seem to work no matter what data I throw at it. I think I'm calling it wrong or something. I've tried...
$bbcode_parser = new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),false);
$bbcode_parser->handle_bbcode_video('http://www.youtube.com/watch?v=zTpsrqvGL2Q');
and
$bbcode_parser = new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),false);
$bbcode_parser->handle_bbcode_video('http://www.youtube.com/watch?v=zTpsrqvGL2Q');
Which is how the documentation says it should be used, however the same error always gets returned.
Fatal error: Call to a member function handle_bbcode_video() on a non-object