Do you mind actually explaining what needs to be done?
You've done a lot of work - and it shows, because you're nearly there. I'm going to give you the rest of it, because unlike a lot of people, you've actually tried doing it yourself.
function handle_bbcode_video(&$parser, $value, $option) { global $vbulletin;
// clean video id $videoid = intval($value);
// fetch video information -- this is costly, it is run every time the bb code tag is used $videoinfo = $vbulletin->db->query_first(" SELECT * FROM " . TABLE_PREFIX . "video WHERE video.videoid = " . $videoid . " LIMIT 1 ");
// check video exists if (empty($videoinfo)) { // this will show up on posts -- make sure this is what you want return 'This video does not exist.'; }
// instantiate our video class require_once(DIR . '/includes/videoserviceapi/class_' . strtolower($videoinfo['videoservice']) . '.php'); $classname = 'vB_VideoSharingService_' . $videoinfo['videoservice']; $obj = new $classname($vbulletin);