0"; $rs=query($sql); if( BOF($rs) ) redirect(FOLDER."error.php?id=1"); $rows=fetch($rs); //---读取产品的其他图片以及 CSS相关的属性图片 $sql="select * from @@@otherimage where pid=$pid order by sort asc"; $ors=query($sql); $tmpcsspic = array(); $tmpcothervalue = array(); while($orows=fetch($ors)) { if( $orows["type"] == 1 ) { $orows["csspic"] = $config[61] . getImageURL($orows["pic"],5,"otherImage/",$urltype); $orows["bigpic"] = $config[61] . getImageURL($orows["pic"],2,"otherImage/",$urltype); $tmpcsspic[] = $orows["csspic"] . "|" . $orows["bigpic"] ; $tmpcothervalue[] = $orows["name"] ; } else { $orows["realpic"]= $config[61] . getImageURL($orows["pic"],0,"otherImage/",$urltype); $orows["realpic1"]=getImageURL($orows["pic"],2,"otherImage/",$urltype); $orows["bigpic"] = $config[61] . getImageURL($orows["pic"],-1,"otherImage/",$urltype); } $var["rs_o"][$orows["type"]][]=$orows; } free($rs); $rows["categoryName"] = $class[$rows["classid"]]["name"] ; $rows["categoryRewrite"] = getRewrite($class[$rows["classid"]]["name"],$rows["classid"],3,$cfg["rewrite"]) ; $var["title"] = $rows["name"] . " - " . $var["title"]; $rows["pic1"] = $config[61] . getImageURL($rows["pic"],-1,"uploadImage/",$urltype); $rows["smallpic"] = $config[61] . getImageURL($rows["pic"],0,"uploadImage/",$urltype); // $rows["addtime"] = formatDate(strtotime($rows["addtime"])); $rows["realpic"] = $config[61] . getImageURL($rows["pic"],2,"uploadImage/",$urltype); $rows["nowpic"] = getImageURL($rows["pic"],3,"uploadImage/",$urltype); //--- 计算批发价格的列表 以及 市场价格 $rows["arrnum"] =split( $cfg["split"] , $rows["pnum"] ); $rows["arrnum"]=array_filter($rows["arrnum"],callback_empty); $rows["arrremark"] =split( $cfg["split"] , $rows["premark"] ); $rows["arrprice"] =split( $cfg["split"] , $rows["pprice"] ); if( $rows["arrnum"] ) { $miniorder = dataDefault($rows["minnum"],1); $quantityprice_1 = $miniorder . " - " . $rows["arrnum"][0] ; $rows["wholesaleprice"][] = array("numitem"=>$quantityprice_1,"remark"=>$rows["arrremark"][0],"price"=>$rows["arrprice"][0]* $rate * $discount * $rows["price1"]/100); for($index=1;$index $rows["arrnum"][$index-1] . " - " . $rows["arrnum"][$index],"remark"=>$rows["arrremark"][$index],"price"=>$rows["arrprice"][$index] * $rate * $discount * $rows["price1"]/100); } $rows["wholesaleprice"][] = array("numitem"=> $rows["arrnum"][$index-1] . " - max","remark"=>$rows["lastremark"],"price"=>$rows["lastprice"] * $rate * $discount * $rows["price1"]/100); } $rows["price1"] = $rows["price1"] * $rate * $discount; $rows["price2"] = $rows["price2"] * $rate * $discount ; if(!$rows["price2"] && ($config[300]!="")) eval("\$rows['price2']={$rows['price1']} {$config[299]} {$config[300]};"); r2n( $rows["price1"] ); r2n( $rows["price2"] ); r2n( $rows["lastprice"] ); //--- 读取产品属性 以及 购物车的属性 $rows["pprice"] =split( $cfg["split"] , $rows["pprice"] ); $rows["pkey"] =split( $cfg["split"] , $rows["pkey"] ); $rows["pvalue"] =split( $cfg["split"] , $rows["pvalue"] ); $rows["ckey"] =split( $cfg["split"] , $rows["ckey"] ); $rows["cvalue"] =split( $cfg["split"] , $rows["cvalue"] ); $rows["ctype"] =split( $cfg["split"] , $rows["ctype"] ); $rows["cprice"] =split( $cfg["split"] , $rows["cprice"] ); for($index=0;$index$cfg["product"]["disp"][log($arrdisp[$index],2)],"rewrite"=>getRewrite($cfg["product"]["disp"][log($arrdisp[$index],2)],pow(2,$index),7))); } } //-- 读取 标题,路径,二级标题 $pclassid=$rows["classid"]; $arr_url=split( ',' , $class[$pclassid]["url"] ); $var["str_url"]="{$cfg['lg']['home']}"; for($index=0;$index

" . $class[$arr_url[$index]]["name"] . "

" ; } $var["str_url_2"]= $rows["name"] ; $var["pid"]=$pid; $var["statscript"][] = FOLDER."stat.php?action=stat&type=product&id=" . $pid; free($rs); //--- 读取商品详细页面的SEO模板并且设置title,descript,keywords $sql = "select * from `@@@seo` where id=3"; $rs = query($sql); while($seorows=fetch($rs)) { $tpl_seo_title = $seorows["title"]; $tpl_seo_keywords = $seorows["keywords"]; $tpl_seo_descript = $seorows["descript"]; } $arr_seo_key[0] = "{VAR_shopname}"; $arr_seo_value[0] = $config[63] ; $arr_seo_key[1] = "{VAR_pcatename}"; $arr_seo_value[1] = $class[$classid]["name"] ; $arr_seo_key[3] = "{VAR_pname}"; $arr_seo_value[3] = $rows["name"] ; $arr_seo_key[2] = "{VAR_pcatepath}"; for($index=0;$index=0 and classid=$pclassid limit 200"); $arrgrouporderp = split(',',$grouporderp) ; shuffle($arrgrouporderp); $rand_keys = array_slice ( $arrgrouporderp , 0 , 8); $sql="select * from @@@product where state>=0 and id in (".dataDefault(join(',',$rand_keys),0).")"; $rs=query($sql); $tmp=array(0); while($rows_relative=fetch($rs)) { $rows_relative["rewrite"]= getRewrite($rows_relative["name"],$rows_relative["id"],0,$cfg["rewrite"]); $rows_relative["realpic"]=getImageURL($rows_relative["pic"],1,"uploadImage/",$urltype); $rows_relative["price2"]=$rows_relative["price2"] * $rate * $discount; //$rows["bigpic"]=getImageURL($rows["pic"],2,"uploadImage/",$urltype); $rows_relative["price"]= $rows_relative["price1"] * $discount * $rate; r2n( $rows_relative["price"] ); $var["rs_relative"][]=$rows_relative; } //-------加载评论。。。 $sql="select * from @@@message where cid=1 and state>0 and pid=$pid order by id desc limit 5"; $rs=query($sql); while($srows=fetch($rs)) { $srows["content"]=nl2br($srows["content"]); $srows["addtime"] = date("M j,Y",strtotime($srows["addtime"])); $var["rs_comment"][]=$srows; } free($rs); //extendsUnlim($class,$classid,$proot,$class_html); //$var["class_html"]=$class_html; $var["p"]=$rows; //-------- 读取产品上一个,下一个产品的链接 $sql="select * from @@@product where id>$pid and classid = $pclassid and state>=0 order by id asc limit 1"; $pnrs=query($sql); if( BOF($pnrs) ) { $var["p"]["prev"]="javascript:alert('Has no');"; } else { $pnrows=fetch($pnrs); $var["p"]["prev"]= getRewrite($pnrows["name"],$pnrows["id"],0,$cfg["rewrite"]); $var["p"]["previmg"]= getImageURL($pnrows["pic"],3,"uploadImage/",$urltype); } free($pnrs); $sql="select * from @@@product where id<$pid and classid = $pclassid and state>=0 order by id desc limit 1"; $pnrs=query($sql); if( BOF($pnrs) ) { $var["p"]["next"]="javascript:alert('Has no');"; } else { $pnrows=fetch($pnrs); $var["p"]["next"]= getRewrite($pnrows["name"],$pnrows["id"],0,$cfg["rewrite"]); $var["p"]["nextimg"]= getImageURL($pnrows["pic"],3,"uploadImage/",$urltype); } $var['rating'] = getRating($pid); function getRating($pid = 0){ $ratNum = fetchValue("select count(*) as v from @@@message where cid=1 and state>0 and pid=$pid" , "0"); $ratSum = fetchValue("select sum(rating) as v from @@@message where cid=1 and state>0 and pid=$pid" , "0"); $arr[0] = sprintf("%.1f", $ratSum/$ratNum); $arr[6] = round($arr[0]); $arr[7] = fetchValue("select count(*) as v from @@@message where cid=1 and state>0 and pid=$pid" , "0"); $arr[1] = fetchValue("select count(*) as v from @@@message where cid=1 and state>0 and pid=$pid and rating = 1" , "0"); $arr[2] = fetchValue("select count(*) as v from @@@message where cid=1 and state>0 and pid=$pid and rating = 2" , "0"); $arr[3] = fetchValue("select count(*) as v from @@@message where cid=1 and state>0 and pid=$pid and rating = 3" , "0"); $arr[4] = fetchValue("select count(*) as v from @@@message where cid=1 and state>0 and pid=$pid and rating = 4" , "0"); $arr[5] = fetchValue("select count(*) as v from @@@message where cid=1 and state>0 and pid=$pid and rating = 5" , "0"); return $arr; } require("uio_bomdata.php"); ?>