Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

trying to change this php into smarty

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-13-2010, 03:03 AM
 
7thdesire 7thdesire is offline
 

Senior Member
  
Join Date: Sep 2006
Posts: 115
 

Default 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
__________________
X-cart - 4.3.2 loads of mods and custom code
Reply With Quote
  #2  
Old 11-13-2010, 08:25 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default 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>
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #3  
Old 11-15-2010, 03:29 AM
 
7thdesire 7thdesire is offline
 

Senior Member
  
Join Date: Sep 2006
Posts: 115
 

Default 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 :->
__________________
X-cart - 4.3.2 loads of mods and custom code
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:13 PM.

   

 
X-Cart forums © 2001-2020