get_results($qry,ARRAY_A); $ad=$ad[0]; //If the Interrelated URL is no null,go to the URL. if($ad[ref_url]) { header("Location: ".$ad[ref_url]); exit; } $ad[addtime]=date("m/d/Y",$ad[addtime]); $tpl->assign("ad",$ad); unset($ad); //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,8"; $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_ad_,ahp2004.htm"); echo str_replace($tpl_imgdir_name, $tpl->template_dir.$tpl_imgdir_name,$output); ?>