?? giftsquery.php
字號:
<?php
/*
[插件名稱] 積分贈品檢索 - 替換模版的{#modGiftsQuery#}
[適用范圍] 分類檢索頁
[文 件 名] GiftsQuery.php
[更新時間] 2007/1/10
*/
function GiftsQuery(){
global $fsql,$msql,$charset,$tbl_shop_con,$tbl_hb,$PagesInfo,$ShowPages,$htmlstr,$CatchOpen;
global $NowCatid,$NowMenuid,$NowFold,$tbl_goodsprop,$MenuInfo,$CONF;
$catid=$NowCatid;
$PSET=PlusSet("modGiftsQuery");
$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_shopquery_gifts.htm");
$key=$_GET["key"];
$showtj=$_GET["showtj"];
$showremai=$_GET["showremai"];
$shownew=$_GET["shownew"];
$showtejia=$_GET["showtejia"];
$page=$_GET["page"];
$prop1=$_GET["prop1"];
$prop2=$_GET["prop2"];
$prop3=$_GET["prop3"];
$prop4=$_GET["prop4"];
$prop5=$_GET["prop5"];
//默認貨幣單位
$hbname=$CONF["hbname"];
$hbdanwei=$CONF["hbdanwei"];
$hbcode=$CONF["hbcode"];
$htmlstr=$catid.".html";
//模版解釋
$Temp=LoadTemp(ROOTPATH."templates/".$MenuInfo["skin"]."/".$tempname);
$TempArr=SplitTblTemp($Temp);
$str=$TempArr["start"];
$scl=" menuid='$NowMenuid' and iffb='1' ";
if($catid!="0" && $catid!=""){
$fmdpath=fmpath($catid);
$scl.=" and catpath regexp '$fmdpath' ";
}
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' ";
}
if($prop1!=""){
$scl.=" and prop1 regexp '$prop1' ";
}
if($prop2!=""){
$scl.=" and prop2 regexp '$prop2' ";
}
if($prop3!=""){
$scl.=" and prop3 regexp '$prop3' ";
}
if($prop4!=""){
$scl.=" and prop4 regexp '$prop4' ";
}
if($prop5!=""){
$scl.=" and prop5 regexp '$prop5' ";
}
if($showremai=="1"){
$ord="cl";
}
if($key!=""){
$scl.=" and (title regexp '$key' or body regexp '$key') ";
}
include(ROOTPATH."includes/func/pages.inc.php");
$pages=new pages;
$totalnums=TblCount($tbl_shop_con,"id",$scl);
$pages->setvar(array(
"showtj" => $showtj,
"showremai" => $showremai,
"shownew" => $shownew,
"showtejia" => $showtejia,
"prop1" => $prop1,
"prop2" => $prop2,
"prop3" => $prop3,
"prop4" => $prop4,
"prop5" => $prop5,
"key" => $key
));
$pages->set($shownums,$totalnums);
$pagelimit=$pages->limit();
$fsql->query("select * from $tbl_shop_con where $scl order by $ord $sc limit $pagelimit");
while($fsql->next_record()){
$id=$fsql->f('id');
$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');
$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');
$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);
if($CatchOpen=="1" && file_exists("../html/".$id.".html")){
$link="../html/".$id.".html";
}else{
$link="../html/?".$id.".html";
}
//購物車鏈接
$cartlink=ROOTPATH."member_gifts.php?step=add&nums=1&gid=".$id;
//簡介
if($cutword!="0"){$memo=csubstr($memo,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,
'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);
}
$str.=$TempArr["end"];
$PagesInfo=$pages->ShowNow();
$ShowPages=$pages->output(1);
return $str;
}
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -