Quote:
Originally Posted by Zachery
You can't use PHP in the bbcode templates, or any templates for that matter.
|
Yeah i see and i figure out things with Tutorials and template system and i came too close.
I created a Plugin with this code
PHP Code:
function video_api_thumb($vid){
$id = $vid;
$thumbnail_720_url='https://api.dailymotion.com/video/'.$id.'?fields=thumbnail_720_url';
$json_thumbnail = file_get_contents($thumbnail_720_url);
$get_thumbnail = json_decode($json_thumbnail, TRUE);
$thumb=$get_thumbnail['thumbnail_720_url'];
}
$thumb_url = video_api_thumb('x17r8h7');
$templater = vB_Template::create('dailymotion_video_api');
$templater->render();
vB_Template::preRegister('bbcode_video',array('video_thumb_url' => $thumb_url));
and used this in my bbcode_video
PHP Code:
Thumbnail : {vb:raw video_thumb_url}
Now its printing Thumbnail URL in my thread view but i want to use dynamic video id instead of hard coded one i function (
$thumb_url = video_api_thumb('x17r8h7');). how can i pass a video id to that plugin function so it will return fresh thumbnail ??