View Single Post
  #7  
Old 10-12-2009, 12:53 PM
 
thisclicks thisclicks is offline
 

Newbie
  
Join Date: Dec 2006
Posts: 7
 

Default Re: Using Smarty or PHP in cateogry descriptions to reference language strings

I figured it out. It's a bit more dynamic this way. This will work for current_category descriptions that have one var defined in them as ##VAR##. put this in the home.php along with the other smarty assigns. you'll need to change the smarty var reference in your tpl to this new one.

PHP Code:
$cat_desc $current_category['description'];

if (
strpos($cat_desc'##'0)) {
    
    
$cat_lng_str substr($cat_descstrpos($cat_desc'##'0), strpos($cat_desc'##'1));
    
    
$cat_lng_var str_replace("##"""$cat_lng_str);
    
    
$tmp_lng func_get_langvar_by_name("$cat_lng_var");
    
    
$smarty->assign("cat_desc"str_replace($cat_lng_str$tmp_lng$current_category['description']));

} else {

    
$smarty->assign("cat_desc"$current_category['description']);


__________________
-Chad
Reply With Quote