devoidfeast
09-10-2014, 04:04 PM
Hello Fellows,
I am trying to customize the "Search Widget" where i am replacing the user avatar with a thumbnail.the thumbnail is to be generated from any video or images attached to the post.i am able to write an api call which gets the thumbnail from any video attached but i am still not successful to do it for images and attachment.
{vb:data thumbnail, content_video, getVideoThumbnail, {vb:raw url}}
<vb:if condition="isset($thumbnail) AND $thumbnail">
<img src="{vb:raw thumbnail}" alt=""
<vb:if condition="isset($height) AND $height > 0"> height="{vb:raw height}"</vb:if>
<vb:if condition="isset($width) AND $width > 0"> width="{vb:raw width}"</vb:if>
/>
</vb:if>
getVideoThumbnail(url) is method i found in the "core/vb/api/content/video.php". i was successfully able to get the thumbnail from and video embeded.
Now i want to do some thing like the video with photos or [IMG] tag i found a method in the
"core/vb/api/content/text.php"
function autoPopulatePreviewImage($nodeId)
this function can reads all the post and search for images in it and populate the following array
$data = array(
'parentid' => $node['parentid'],
'previewimage' => $attachment['nodeid'],
'nodeoptions' => $node['nodeoptions'],
);
How can i call the above api function from a template?
Thank You.
I am trying to customize the "Search Widget" where i am replacing the user avatar with a thumbnail.the thumbnail is to be generated from any video or images attached to the post.i am able to write an api call which gets the thumbnail from any video attached but i am still not successful to do it for images and attachment.
{vb:data thumbnail, content_video, getVideoThumbnail, {vb:raw url}}
<vb:if condition="isset($thumbnail) AND $thumbnail">
<img src="{vb:raw thumbnail}" alt=""
<vb:if condition="isset($height) AND $height > 0"> height="{vb:raw height}"</vb:if>
<vb:if condition="isset($width) AND $width > 0"> width="{vb:raw width}"</vb:if>
/>
</vb:if>
getVideoThumbnail(url) is method i found in the "core/vb/api/content/video.php". i was successfully able to get the thumbnail from and video embeded.
Now i want to do some thing like the video with photos or [IMG] tag i found a method in the
"core/vb/api/content/text.php"
function autoPopulatePreviewImage($nodeId)
this function can reads all the post and search for images in it and populate the following array
$data = array(
'parentid' => $node['parentid'],
'previewimage' => $attachment['nodeid'],
'nodeoptions' => $node['nodeoptions'],
);
How can i call the above api function from a template?
Thank You.