⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 goodsall.php

📁 推荐的一本书!!!!建议看 !!!!!!!!!
💻 PHP
字号:
<?php

/*
	[插件名称] 全部商品 - 替换模版的{#modGoodsAll#}
	[适用范围] 会员全部商品页
	[文 件 名] GoodsAll.php
	[更新时间] 2007/2/24
*/


function GoodsAll(){

	global $fsql,$msql,$charset,$tbl_shop_con,$tbl_hb,$tbl_member_fav,$PagesInfo,$ShowPages,$htmlstr,$CatchOpen;
	global $NowCatid,$NowMenuid,$NowFold,$tbl_goodsprop,$MenuInfo,$CONF;


	$PSET=PlusSet("modGoodsAll");
	
	$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_goodsall.htm");

	$hangnums=1;

	$page=$_GET["page"];

	//默认货币单位
	$hbname=$CONF["hbname"];
	$hbdanwei=$CONF["hbdanwei"];
	$hbcode=$CONF["hbcode"];

	$htmlstr=$catid.".html";

	$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' ";

	include(ROOTPATH."includes/func/memberpages.inc.php");
	$pages=new pages;

	$totalnums=TblCount($tbl_shop_con,"id",$scl);
	
	$pages->setvar(array("key" => $key));

	$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');
		$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;

		//简介
		$memo=str_replace("\n","<br>",$memo);

		//标题截取
		if($cutword!="0"){$title=csubstr($title,0,$cutword,$charset);}

		if($kk==1){

			$str.=$TempArr["rowstrat"];
		}

		$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);
		
		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 + -