?? goodssearch.php
字號:
<?php
/*
[插件名稱] 商品搜索 - 替換模版的{#modGoodsSearch#}
[適用范圍] 商品搜索頁
[文 件 名] GoodsSearch.php
[更新時間] 2007/2/16
*/
function GoodsSearch(){
global $fsql,$msql,$charset,$tbl_shop_con,$tbl_hb,$PagesInfo,$ShowPages,$htmlstr,$CatchOpen;
global $NowFold,$tbl_goodsprop,$MenuInfo,$tbl_member_rights,$CONF;
$PSET=PlusSet("modGoodsSearch");
$hangnums=1;
$shownums=PlusDef($PSET["shownums"],"10");
$ord=PlusDef($PSET["ord"],"id");
$sc=PlusDef($PSET["sc"],"desc");
$cutword=PlusDef($PSET["cutword"],"0");
$target=PlusDef($PSET["target"],"_self");
$tempname=PlusDef($PSET["tempname"],"tpl_goodssearch.htm");
$key=$_GET["key"];
$showtj=$_GET["showtj"];
$showremai=$_GET["showremai"];
$shownew=$_GET["shownew"];
$showtejia=$_GET["showtejia"];
$page=$_GET["page"];
$catid=$_GET["catid"];
$goodstype=$_GET["goodstype"];
$fromprice=$_GET["fromprice"];
$toprice=$_GET["toprice"];
$bn=$_GET["bn"];
$brand=$_GET["brand"];
$prop1=$_GET["prop1"];
$prop2=$_GET["prop2"];
$prop3=$_GET["prop3"];
$prop4=$_GET["prop4"];
$prop5=$_GET["prop5"];
$prop6=$_GET["prop6"];
$prop7=$_GET["prop7"];
$prop8=$_GET["prop8"];
$prop9=$_GET["prop9"];
$prop10=$_GET["prop10"];
$prop11=$_GET["prop11"];
$prop12=$_GET["prop12"];
$prop13=$_GET["prop13"];
$prop14=$_GET["prop14"];
$prop15=$_GET["prop15"];
$prop16=$_GET["prop16"];
$prop17=$_GET["prop17"];
$prop18=$_GET["prop18"];
$prop19=$_GET["prop19"];
$prop20=$_GET["prop20"];
//默認貨幣單位
$hbname=$CONF["hbname"];
$hbdanwei=$CONF["hbdanwei"];
$hbcode=$CONF["hbcode"];
$tdwidth=ceil(100/$hangnums);
//模版解釋
$Temp=LoadTemp(ROOTPATH."templates/".$MenuInfo["skin"]."/".$tempname);
$TempArr=SplitTblTemp($Temp);
$propstr=$TempArr["list"];
$str=$TempArr["start"];
$scl=" iffb='1' and goodstype!='cent' and goodstype!='flowerdiy' and goodstype!='fushu' ";
if($catid!="0" && $catid!=""){
$fmdpath=fmpath($catid);
$scl.=" and catpath regexp '$fmdpath' ";
}
if($bn!=""){
$scl.=" and bn regexp '$bn' ";
}
if($brand!="0" && $brand!=""){
$scl.=" and brand='$brand' ";
}
if($goodstype!="0" && $goodstype!=""){
$scl.=" and goodstype='$goodstype' ";
}
if($showtj!="" && $showtj!="all"){
$scl.=" and tj='$showtj' ";
}
if($shownew!="" && $shownew!="all"){
$scl.=" and ifnew='1' ";
}
if($showremai!="" && $showremai!="all"){
$scl.=" and remai='$showremai' ";
}
if($showtejia!="" && $showtejia!="all"){
$scl.=" and tejia='$showtejia' ";
}
for($t=1;$t<=20;$t++){
$ppn="prop".$t;
if($$ppn!=""){
$scl.=" and ".$ppn." regexp '".$$ppn."' ";
}
}
if($showremai=="1"){
$ord="cl";
}
if($key!=""){
$scl.=" and (title regexp '$key' or memo regexp '$key' or body regexp '$key') ";
}
//會員價
if(isset($_COOKIE["MEMBERID"])){
$memberid=$_COOKIE["MEMBERID"];
$fsql->query("select secureset from $tbl_member_rights where memberid='$memberid' and securetype='price'");
if($fsql->next_record()){
$secureset=$fsql->f('secureset');
$pricestr="price".$secureset;
}else{
$pricestr="price1";
}
}else{
$pricestr="price1";
}
if($fromprice!=""){
$scl.=" and ".$pricestr.">=".$fromprice." ";
}
if($toprice!=""){
$scl.=" and ".$pricestr."<=".$toprice." ";
}
include(ROOTPATH."includes/func/memberpages.inc.php");
$pages=new pages;
$totalnums=TblCount($tbl_shop_con,"id",$scl);
$pages->setvar(array(
"showtj" => $showtj,
"shownew" => $shownew,
"showremai" => $showremai,
"showtejia" => $showtejia,
"catid" => $catid,
"goodstype" => $goodstype,
"fromprice" => $fromprice,
"toprice" => $toprice,
"bn" => $bn,
"key" => $key,
"brand" => $brand,
"prop1" => $prop1,
"prop2" => $prop2,
"prop3" => $prop3,
"prop4" => $prop4,
"prop5" => $prop5,
"prop6" => $prop6,
"prop7" => $prop7,
"prop8" => $prop8,
"prop9" => $prop9,
"prop10" => $prop10,
"prop11" => $prop11,
"prop12" => $prop12,
"prop13" => $prop13,
"prop14" => $prop14,
"prop15" => $prop15,
"prop16" => $prop16,
"prop17" => $prop17,
"prop18" => $prop18,
"prop19" => $prop19,
"prop20" => $prop20,
));
$pages->set($shownums,$totalnums);
$pagelimit=$pages->limit();
$kk=1;
$fsql->query("select * from $tbl_shop_con where $scl order by $ord $sc limit $pagelimit");
while($fsql->next_record()){
$id=$fsql->f('id');
$menuid=$fsql->f('menuid');
$catid=$fsql->f('catid');
$catpath=$fsql->f('catpath');
$goodstype=$fsql->f('goodstype');
$body=$fsql->f('body');
$dtime=$fsql->f('dtime');
$title=$fsql->f('title');
$memo=$fsql->f('memo');
$intro=$fsql->f('body');
$cl=$fsql->f('cl');
$secure=$fsql->f('secure');
$src=$fsql->f('picsmall');
$xtmod=$fsql->f('xtmod');
$stmod=$fsql->f('stmod');
$bn=$fsql->f('bn');
$brand=$fsql->f('brand');
$danwei=$fsql->f('danwei');
$kucun=$fsql->f('kucun');
$cent=$fsql->f('cent');
$pj=$fsql->f('pj');
$kg=$fsql->f('kg');
$price0=$fsql->f('price0');
$price1=$fsql->f('price1');
$price2=$fsql->f('price2');
$price3=$fsql->f('price3');
$price4=$fsql->f('price4');
$price5=$fsql->f('price5');
$price6=$fsql->f('price6');
$price7=$fsql->f('price7');
$price8=$fsql->f('price8');
$price9=$fsql->f('price9');
$price10=$fsql->f('price10');
$price11=$fsql->f('price11');
$price12=$fsql->f('price12');
$prop1=$fsql->f('prop1');
$prop2=$fsql->f('prop2');
$prop3=$fsql->f('prop3');
$prop4=$fsql->f('prop4');
$prop5=$fsql->f('prop5');
$prop6=$fsql->f('prop6');
$prop7=$fsql->f('prop7');
$prop8=$fsql->f('prop8');
$prop9=$fsql->f('prop9');
$prop10=$fsql->f('prop10');
$prop11=$fsql->f('prop11');
$prop12=$fsql->f('prop12');
$prop13=$fsql->f('prop13');
$prop14=$fsql->f('prop14');
$prop15=$fsql->f('prop15');
$prop16=$fsql->f('prop16');
$prop17=$fsql->f('prop17');
$prop18=$fsql->f('prop18');
$prop19=$fsql->f('prop19');
$prop20=$fsql->f('prop20');
$i=1;
$msql->query("select * from $tbl_goodsprop where goodstype='$goodstype' order by xuhao");
while($msql->next_record()){
$pn="propname".$i;
$$pn=$msql->f('propname');
$i++;
}
//圖片處理
$autosize="width";
if($src=="" || $src=="http://"){
$src=ROOTPATH."images/nopic.gif";
}else{
if($stmod=="upload"){
$src=ROOTPATH.$src;
$autosize=AutoPicSize($src);
}
}
//評分
$stars=ShowStar($pj);
//價格
$price=NowPrice($id,$goodstype,$price1,$price2,$price3,$price4,$price5,$price6,$price7,$price8,$price9,$price10,$price11,$price12);
$saving=$price0-$price;
//詳情鏈接
$fold=MenuFold($menuid);
if($CatchOpen=="1" && file_exists(ROOTPATH.$fold."/html/".$id.".html")){
$link=ROOTPATH.$fold."/html/".$id.".html";
}else{
$link=ROOTPATH.$fold."/html/?".$id.".html";
}
//購物車鏈接
$cartlink=ROOTPATH."cart.php?step=add&addnums=1&gid=".$id;
//收藏
$addfav=ROOTPATH."member_mygoods.php?step=add&gid=".$id;
//簡介
if($cutword!="0"){$memo=csubstr($memo,0,$cutword,$charset);}
$memo=str_replace("\n","<br>",$memo);
if($kk==1){
$str.=$TempArr["rowstrat"];
}
$var=array (
'tdwidth' => $tdwidth,
'title' => $title,
'memo' => $memo,
'intro' => $intro,
'dtime' => $dtime,
'src' => $src,
'autosize' => $autosize,
'cl' => $cl,
'link' => $link,
'cartlink' => $cartlink,
'addfav' => $addfav,
'target' => $target,
'bn' => $bn,
'kg' => $kg,
'brand' => $brand,
'danwei' => $danwei,
'hbcode' => $hbcode,
'hbdanwei' => $hbdanwei,
'hbname' => $hbname,
'kucun' => $kucun,
'cent' => $cent,
'pj' => $pj,
'stars' => $stars,
'price' => $price,
'price0' => $price0,
'price1' => $price1,
'price2' => $price2,
'price3' => $price3,
'price4' => $price4,
'price5' => $price5,
'price6' => $price6,
'price7' => $price7,
'price8' => $price8,
'price9' => $price9,
'price10' => $price10,
'price11' => $price11,
'price12' => $price12,
'saving' => $saving,
'prop1' => $prop1,
'prop2' => $prop2,
'prop3' => $prop3,
'prop4' => $prop4,
'prop5' => $prop5,
'prop6' => $prop6,
'prop7' => $prop7,
'prop8' => $prop8,
'prop9' => $prop9,
'prop10' => $prop10,
'prop11' => $prop11,
'prop12' => $prop12,
'prop13' => $prop13,
'prop14' => $prop14,
'prop15' => $prop15,
'prop16' => $prop16,
'prop17' => $prop17,
'prop18' => $prop18,
'prop19' => $prop19,
'prop20' => $prop20,
'propname1' => $propname1,
'propname2' => $propname2,
'propname3' => $propname3,
'propname4' => $propname4,
'propname5' => $propname5,
'propname6' => $propname6,
'propname7' => $propname7,
'propname8' => $propname8,
'propname9' => $propname9,
'propname10' => $propname10,
'propname11' => $propname11,
'propname12' => $propname12,
'propname13' => $propname13,
'propname14' => $propname14,
'propname15' => $propname15,
'propname16' => $propname16,
'propname17' => $propname17,
'propname18' => $propname18,
'propname19' => $propname19,
'propname20' => $propname20
);
$str.=ShowTplTemp($TempArr["menu"],$var);
if($kk==$hangnums){
$str.=str_replace("{#hangnums#}",$hangnums,$TempArr["rowend"]);
$kk=0;
}
$kstr="";
$kk++;
}
//補充空的td
if($kk!=1){
$needtd=$hangnums-$kk+1;
for($u=1;$u<=$needtd;$u++){
$str.=$TempArr["blank"];
}
$str.=$TempArr["rowend"];
}
$str.=$TempArr["end"];
$PagesInfo=$pages->ShowNow();
$ShowPages=$pages->output(1);
return $str;
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -