Jaxel |
01-20-2009 02:24 AM |
Hmm... Dismounted, thanks for the help... I didn't see your new post till now...
I got this working a few days ago, and this is the code I am using:
PHP Code:
if ($vbulletin->options['videodirectory_bbcode'])
{
// [VIDEO] [VIDEO=XXX]
$tag_list['no_option']['video'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 0,
'external_callback' => 'handle_bbcode_video'
);
$tag_list['option']['video'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 0,
'external_callback' => 'handle_bbcode_video'
);
}
function handle_bbcode_video(&$parser, $videoid, $videotitle)
{
global $vbulletin, $stylevar;
if (!$video = $vbulletin->db->query_first("SELECT video.*
FROM " . TABLE_PREFIX . "video AS video WHERE videoid = '" . $videoid . "'"))
{
$video['error'] = 'THIS VIDEO DOES NOT EXIST';
eval('$HTMLembed = "' . fetch_template('video_bbcode') . '";');
return $HTMLembed;
}
require_once(DIR . '/includes/functions_videodirectory.php');
require_once(DIR . '/includes/class_videosharingservice.php');
require_once(DIR . '/includes/videoserviceapi/class_' . strtolower($video['videoservice']) . '.php');
$classname = "vB_VideoSharingService_$video[videoservice]";
$obj = new $classname($vbulletin);
$showful = $vbulletin->options['videodirectory_showful'];
$showrel = $vbulletin->options['videodirectory_showrel'];
$showsta = $vbulletin->options['videodirectory_showsta'];
$video['embed'] = $obj->fetch_embedcode($video['videoidservice'], false, $showful, $showrel, $showsta);
$video['url'] = construct_video_url($video);
if (empty($videotitle)) { $videotitle = $video['title']; }
eval('$HTMLembed = "' . fetch_template('video_bbcode') . '";');
return $HTMLembed;
}
Do you mind looking it over so see if I am doing anything wrong? I'm doing this all in a SINGLE plugin; is that wrong?
|