caching = true; $smarty->cache_lifetime = 60*60*24*30; if(!$smarty->is_cached('service/helpcenter.htm')){ $help = new Help(); $smarty->register_modifier("sslash","stripslashes"); $smarty->assign('info_0001',$help->infocon(" Id,Title,Content,SpeUrl "," CommendFlag LIKE '%0001%' AND Flag > 0 "," ORDER BY OrderBy DESC,AddDate Desc ",10));//推荐信息 //左边类别列表开始 $arr = $help->category(); $i = 0; foreach($arr as $row){ if($row['Flag']>0){ $category[$i]['id'] = $row['Id']; $category[$i]['name'] = $row['Name']; $category[$i]['infolist'] = $help->infolist(" Id,Title,SpeUrl "," Sort = ".$row['Id']." AND Flag > 0 "); $i++; } } $smarty->assign('categorycount',count($category));//问题类别数量 $smarty->assign('category',$category);//问题类别 unset($category,$arr); //左边类别列表结束 } $smarty->display('service/helpcenter.htm'); ?>