assign("productimg",__dir_rel_web."uploadFiles/product/"); if(!empty($_GET["id"])){ $id=intval($_GET["id"]); $strSQL="select a.*,b.sort_name,c.brandname,d.compname as supplyname,e.compname from [#TAB]product as a left join [#TAB]product_sort as b on(a.sortid=b.id) left join [#TAB]brand as c on(a.brandid=c.id) left join [#TAB]supply as d on(a.supplyid=d.id) left join [#TAB]company as e on(a.compid=e.id) where a.id='$id' limit 1"; $mysql->do_query($strSQL); if($mysql->rownum==0){ page_redirect("未找到该信息!请正确输入!",__dir_rel_web); exit; } $mod=$mysql->do_fetch_row(1); $mysql->do_query("update [#TAB]product set viewtimes=viewtimes+1 where id='$id' limit 1"); $smarty->assign("mod",$mod); $header_title[] = $mod['sort_name']; $header_title[] = $mod['proname']; $header_keys[] = $mod['proname']; $header_keys[] = $mod['model']; if(!empty($mod['keywords']))$header_keys[] = $mod['keywords']; } else{ page_redirect($cfg_msg["err_request"],__dir_rel_web); exit; } /* //浏览记录 $cfg_product_pid=array(); //cookie保存浏览记录 if(!empty($_COOKIE[$cfg_front_cookie])){ $cfg_view_products=explode(",",$_COOKIE[$cfg_front_cookie]); $strSQL="select id,proname,mprice,price from [#TAB]product where id in(".implode(",",$cfg_view_products).")"; $mysql->do_query($strSQL); $cfg_product_list=$tmp=array(); for($i=0;$i<$mysql->rownum;$i++){ $row=$mysql->do_fetch_row(1); $row["cut_name"]=cnSubStr($row["proname"],10,true); $tmp[$row["id"]]=$row; if(!in_array($row["id"],$cfg_product_pid))$cfg_product_pid[]=$row["id"]; } $len=count($cfg_view_products); for($i=($len-1);$i>=0;$i--){ $proid=$cfg_view_products[$i]; if($tmp[$proid])$cfg_product_list[]=$tmp[$proid]; } $smarty->assign("cfg_product_list",$cfg_product_list); $key=array_search($id,$cfg_view_products); if($key===false){ if($len>=5){unset($cfg_view_products[0]);} } else{ unset($cfg_view_products[$key]); } } else{ $cfg_view_products=array(); } $cfg_view_products[]=$id; setcookie($cfg_front_cookie,count($cfg_view_products)>0?implode(",",$cfg_view_products):"",time()+3600*24*30); if(count($cfg_product_pid)){ $imgid=$cfg_product_pid; include("./getimg.php"); } //end */ //产品图片 $strSQL="select id,newname,imgname from [#TAB]image where pid='$id' and ptab='[#TAB]product' order by flag desc,pos asc"; $mysql->do_query($strSQL); $imagelist=array(); for($i=0;$i<$mysql->rownum;$i++){ $row=$mysql->do_fetch_row(1); $imagelist[]=$row; } $smarty->assign("imagelist",$imagelist); $smarty->assign("imagenum",$mysql->rownum); /* //评论信息 $perpage=5; $p_no=empty($_GET["p"])?1:(int)$_GET["p"]; if(empty($p_no))$p_no=1; $limit=" limit ".($p_no-1)*$perpage.",".$perpage; $where=" where productid='$id' "; $strSQL="select id,nickname,addtime,replay_desc,news_desc from [#TAB]guestbook {$where} order by id desc {$limit}"; $mysql->do_query($strSQL); $cfg_book_list=array(); for($i=0;$i<$mysql->rownum;$i++){ $row=$mysql->do_fetch_row(1); $cfg_book_list[]=$row; } $smarty->assign("bookNum",$mysql->rownum); $smarty->assign("cfg_book_list",$cfg_book_list); $page=new Page($perpage); $page->setPageSQL("select count(id) from [#TAB]guestbook $where"); $smarty->assign("page_html",$page->showPage($p_no,rebuild_query_string("p"),'p',true)); //end */ define("MY_PRO_SORT",true); include("./inc.php"); $smarty->assign("cfg_web_title",implode("_",array_reverse($header_title))); $smarty->assign("cfg_web_keys",implode(",",$header_keys)); smarty_end($smarty,$tpl,$cacheId); include("./include/footer.php"); ?>