I am trying to post this php code with a variable or if needed variables on my tpl file but I am having no luck.
$secret = "user_name";
$uri_prefix = "/dl/";
# filename
# please note file name starts with "/"
$f = /test/test1.mp4;
# current timestamp
$t = time();
$t_hex = sprintf("%08x", $t);
$m = md5($secret.$f.$t_hex);
# generate link
$vfn = "http://this_is_where_url_goes.com".sprintf('%s%s/%s%s', $uri_prefix, $m, $t_hex, $f);
This is my php file that already displays code correctly on my tpl file I just need to add the above code to it correctly.
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {getTrailerAttribs} function plugin
*
* Type: function<br>
* Name: getTrailerAttribs<br>
* Purpose: <br>
* @param array
* @param Smarty
* @return string
*/
function smarty_function_getTrailerAttribs($params, &$smarty)
{
if ( @$trailer = new ffmpeg_movie($params['trailerLocation']) ) {
$trailerAttribs = array( 'width' => $trailer->getFrameWidth(), 'height' => $trailer->getFrameHeight() );
$smarty->assign("trailerWidth", $trailerAttribs['width']);
$smarty->assign("trailerHeight", $trailerAttribs['height']);
}
}
Someone please help