X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   trying to change this php into smarty (https://forum.x-cart.com/showthread.php?t=56551)

7thdesire 11-13-2010 03:03 AM

trying to change this php into smarty
 
hi okay

i am trying to add vids useing bitsontherun

but i would like to secure them i have the following which works but its missing a key issue

{php}
function get_signed_player($videokey,$playerkey) {
$path = "players/".$videokey."-".$playerkey.".js";
$expires = round((time()+3600)/60)*60;
$secret = "XQk1AIiCdNSBY57g5WlHpKcs";
$signature = md5($path.':'.$expires.':'.$secret);
$url = 'http://content.bitsontherun.com/'.$path.'?exp='.$expires.'&sig='.$signature;
return $url;
};

echo "<p>Watch this cool video:</p>";
echo "<script type='text/javascript' src='".get_signed_player('Yg1KVjze','byzWRkIQ')."'></script>";
{/php}

this part in the php Yg1KVjze i would like to set useing {$v.field_value} ie extra field

it i could get the above into smarty rather than direct php i think it would work better

any help on this would be great thanks in advance

geckoday 11-13-2010 08:25 AM

Re: trying to change this php into smarty
 
Try this:

Code:

{assign var="bitpath" value="players/`$v.field_value`-byzWRkIQ.js"}
{assign var="bitexpires" value=$smarty.now+3600}
{assign var="bitexpires" value=$bitexpires/60}
{assign var="bitexpires" value=$bitexpires|round}
{assign var="bitexpires" value=$bitexpires*60}
{assign var="bitsig" value="`$bitpath`:`$bitexpires`:XQk1AIiCdNSBY57g5WlHpKcs"|md5}

<p>Watch this cool video:</p>
<script type='text/javascript' src='http://content.bitsontherun.com/{$bitpath}?exp={$bitexpires}&sig={$bitsig}'></script>


7thdesire 11-15-2010 03:29 AM

Re: trying to change this php into smarty
 
thanks i will give that a try i will update you soon in case you are interested :->


All times are GMT -8. The time now is 04:50 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.