📄 shopgoodsremai.php
字号:
<?php
/*
[插件名称] 热卖商品 - 替换模版标签{#modShopGoodsRemai#}
[适用范围] 全站
[文 件 名] ShopGoodsRemai.php
[更新时间] 2007/2/11
*/
function ShopGoodsRemai(){
global $msql,$fsql,$charset,$tbl_shop_con,$tbl_goodsprop,$CatchOpen,$MenuInfo;
global $strMore,$NowMenuid,$CONF;
$PSET=PlusSet("modShopGoodsRemai");
$shownums=PlusDef($PSET["shownums"],"1");
$ord=PlusDef($PSET["ord"],"id");
$sc=PlusDef($PSET["sc"],"desc");
$cutword=PlusDef($PSET["cutword"],"10");
$target=PlusDef($PSET["target"],"_self");
$catid=PlusDef($PSET["catid"],"0");
$showmenuid=PlusDef($PSET["showmenuid"],MenuDef("shop",$NowMenuid));
$more=PlusDef($PSET["showmore"],$strMore);
$tempname=PlusDef($PSET["tempname"],"tpl_goods.htm");
//默认货币单位
$hbname=$CONF["hbname"];
$hbdanwei=$CONF["hbdanwei"];
$hbcode=$CONF["hbcode"];
$scl=" iffb='1' and remai='1' and goodstype!='cent' and goodstype!='flowerdiy' and goodstype!='fushu' ";
if($showmenuid!="0" && $showmenuid!=""){
$scl.=" and menuid='$showmenuid' ";
$fold=MenuFold($showmenuid);
$morelink=ROOTPATH.$fold."/class/?".$catid.".html&showremai=1";
}else{
$morelink=ROOTPATH."goodssearch.php?seltype=supersearch.php&goodstype=&catid=0&brand=0&bn=&fromprice=&toprice=&showremai=1&key=&tp=search";
}
if($catid!=0 && $catid!=""){
$catid=fmpath($catid);
$scl.=" and catpath regexp '$catid' ";
}
//模版解释
$Temp=LoadTemp(ROOTPATH."templates/".$MenuInfo["skin"]."/".$tempname);
$TempArr=SplitTblTemp($Temp);
$str=$TempArr["start"];
$havepic=0;
$fsql->query("select * from $tbl_shop_con where $scl order by $ord $sc limit 0,$shownums");
while($fsql->next_record()){
$id=$fsql->f('id');
$catid=$fsql->f('catid');
$menuid=$fsql->f('menuid');
$catpath=$fsql->f('catpath');
$goodstype=$fsql->f('goodstype');
$body=$fsql->f('body');
$dtime=$fsql->f('dtime');
$title=$fsql->f('title');
$memo=$fsql->f('memo');
$cl=$fsql->f('cl');
$secure=$fsql->f('secure');
$src=$fsql->f('picsmall');
$xtmod=$fsql->f('xtmod');
$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($xtmod=="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"){$title=csubstr($title,0,$cutword,$charset);}
//简介
$memo=str_replace("\n","<br>",$memo);
$var=array (
'tdwidth' => $tdwidth,
'title' => $title,
'memo' => $memo,
'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["list"],$var);
$havepic++;
}
$str.=$TempArr["end"];
$morestr=str_replace("{#more#}",$more,$TempArr["more"]);
$morestr=str_replace("{#morelink#}",$morelink,$morestr);
$str.=$morestr;
return $str;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -