Okay... lets say I want to make a bbcode...
[VIDEO]536[/VIDEO]
I want to parse some PHP code on this code. How would I handle this?
PHP Code:
function fetch_bbcode_video($videoid)
{
require_once(DIR . '/includes/class_videosharingservice.php');
global $vbphrase, $vbulletin, $show, $stylevar;
if (!$videoinfo = $vbulletin->db->query_first("
SELECT video.*
FROM " . TABLE_PREFIX . "video AS video
WHERE video.videoid = '" . $videoid . "'")
)
{
return false;
}
$classname = "vB_VideoSharingService_$video[videoservice]";
$obj = new $classname($vbulletin);
$embedcode = $obj->fetch_embedcode($videoinfo['videoidservice']);
$video['cattitle'] =& $vbulletin->videocats["$video[videocategoryid]"]['title'];
$video['caturl'] = construct_category_url($vbulletin->videocats["$video[videocategoryid]"]);
$video['url'] = construct_video_url($video);
$video['userurl'] = construct_user_url($video);
if ($video['timelength'] == 0)
{
$video['timelength'] = "???";
}
else
{
$duration = $video['timelength'];
$minutes = floor($duration / 60);
$seconds = $duration % 60;
$seconds = str_pad($seconds, 2, "0", STR_PAD_LEFT);
$video['timelength'] = "$minutes:$seconds";
}
eval('$html = "' . fetch_template('bbcode_video') . '";');
return $html;
}