get_var("SELECT html FROM company_news WHERE id=$id"); if($news && file_exists("./cache/news/".$news)) { header("Location: ./cache/news/".$news); exit; } } ##### $qry="SELECT * FROM company_news WHERE id=$id"; $news=$db->get_results($qry,ARRAY_A); $news=$news[0]; $news[date]=date("m/d/Y",$news[date]); $tpl->assign("news",$news); $news_id=$news[id]; unset($news); //Categories List Data $cachesorts = cachesorts(); $rows=get_categories(); $tpl->assign("category_rows",$rows); unset($cachesorts,$rows); ############### //Newest Products List Data $qry="SELECT id,name,addtime,image,tradeprice FROM product ORDER BY addtime DESC LIMIT 0,10"; $id=$db->get_col($qry,0); $name=$db->get_col(null,1); $addtime=$db->get_col(null,2); $image=$db->get_col(null,3); $tradeprice=$db->get_col(null,4); if(is_array($comments)) foreach($comments as $key=>$result) $comments[$key]=substr($result,0,30); if(is_array($addtime)) foreach($addtime as $key=>$result) $addtime[$key]=date("m/d/Y",$result); if(is_array($image)) foreach($image as $key=>$result) { if($result) resizeimg($product_img_dir.$result,$thumb_dir.$result,75,75); } $tpl->assign("N_product_id",$id); $tpl->assign("N_product_name",$name); $tpl->assign("N_addtime",$addtime); $tpl->assign("N_product_image",$image); $tpl->assign("N_tradeprice",$tradeprice); unset($id,$cateid,$name,$comments,$addtime,$image,$tradeprice,$result); ############## //ad right_col(); $output=$tpl->fetch("show_news_,ahp2004.htm"); $output=str_replace($tpl_imgdir_name, $tpl->template_dir.$tpl_imgdir_name,$output); ####Module: If output cache news if($is_cache_news) { $date=date("mdy"); $cachefile=$news_id."_".$date.".htm"; $handle=@fopen("./cache/news/".$cachefile,"w"); if(fwrite($handle,$output)) { $db->query("UPDATE company_news SET html='".addslashes($cachefile)."' WHERE id='".$news_id."'"); } } #### echo $output; ?>