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)
-   -   substr help (https://forum.x-cart.com/showthread.php?t=32593)

hrothbeorht 07-16-2007 10:55 AM

substr help
 
Hey there,

I need to take a chunk out of this:
{$product.tmbn_url}

diaplays as: http://www.thewebbbsite.ca/shop/images/P/fl_00001.swf
I need: fl_00001

substr('{$product.tmbn_url}', 41, -4)

I figure it might look something like this?
I've been trying lots of stuff and I can't seem to work this out..

?? help ~!

-hroth

nevets1219 07-16-2007 02:22 PM

Re: substr help
 
Are you in a TPL or a PHP file? It looks like you are trying to call PHP functions from TPL (Smarty). If that's the case, you need to do something like:
Code:

{$foo|substr:0:3}
Source. You might have to code it to handle both HTTPS and HTTP and non-WWW with WWW in case those scenarios ever come up for you.


All times are GMT -8. The time now is 06:35 PM.

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