sql_query("select * from page where id='welcome_short'"); $text = $db->fetched_array(); $smarty->assign("welcome",$text[0]); $db->sql_query("select * from cats order by position limit 3"); $cats=$db->fetched_array(); $smarty->assign('cats', $cats); //diseases $db->sql_query("select * from diseases where new='1' order by position"); $diseases = $db->fetched_array(); foreach($diseases as $key=>$value){ if(is_array($value)){ foreach ($value as $subkey=>$subvalue){ if($subkey=='name_rus'){ $diseases[$key]['name_rus_ch']= mb_substr($subvalue,0,1,'utf-8'); } } } } $smarty->assign("diseases",$diseases); //solutions $db->sql_query("select * from solutions where new='1' order by position"); $solutions = $db->fetched_array(); foreach($solutions as $key=>$value){ if(is_array($value)){ foreach ($value as $subkey=>$subvalue){ if($subkey=='name_rus'){ $solutions[$key]['name_rus_ch']= mb_substr($subvalue,0,1,'utf-8'); } } } } $smarty->assign("solutions",$solutions); $smarty->display("index.html"); ?>