www.gusucode.com > 数码公司网站源码程序 > 数码公司网站源码程序/product/module/ProductShiftdolphin.php

    <?php

/*
	[插件名称] 产品检索
	[适用范围] 分类检索页
*/ 


function ProductShiftdolphin(){

		global $fsql,$msql;
		
		$coltitle=$GLOBALS["PLUSVARS"]["coltitle"];
		$shownums=$GLOBALS["PLUSVARS"]["shownums"];
		$ord=$GLOBALS["PLUSVARS"]["ord"];
		$sc=$GLOBALS["PLUSVARS"]["sc"];
		$showtj=$GLOBALS["PLUSVARS"]["showtj"];
		$cutword=$GLOBALS["PLUSVARS"]["cutword"];
		$cutbody=$GLOBALS["PLUSVARS"]["cutbody"];
		$target=$GLOBALS["PLUSVARS"]["target"];
		$catid=$GLOBALS["PLUSVARS"]["catid"];
		$tags=$GLOBALS["PLUSVARS"]["tags"];
		$pagename=$GLOBALS["PLUSVARS"]["pagename"];
		$tempname=$GLOBALS["PLUSVARS"]["tempname"];
		$picw=$GLOBALS["PLUSVARS"]["picw"];
		$pich=$GLOBALS["PLUSVARS"]["pich"];
		$fittype=$GLOBALS["PLUSVARS"]["fittype"];
		
		if($_GET["catid"]>0){
			$nowcatid=$_GET["catid"];
		}else{
			$nowcatid=0;
		}

		$scl=" iffb='1' and catid!='0' ";
		
		if($showtj!="" && $showtj!="0"){
			$scl.=" and tj='1' ";
		}
		
		//显示分类规则:如果后台不指定分类,则显示当前所在分类,否则不限分类
		if($catid!=0 && $catid!=""){
			$catid=fmpath($catid);
			$scl.=" and catpath regexp '$catid' ";
		}elseif($nowcatid!=0 && $nowcatid!=""){
			$catid=fmpath($nowcatid);
			$scl.=" and catpath regexp '$catid' ";
		}

		$pos=strrpos($catid,'0');
		$str=substr($catid,$pos+1);
		$n=intval($str)*20;
		$m=$n+1;
		//模版解释
		$Temp=LoadTemp($tempname);
		$TempArr=SplitTblTemp($Temp);

		$var=array(
			'coltitle' => $coltitle,
			'morelink' => $morelink,
			'm' => $m
		);
		
		
		$str=ShowTplTemp($TempArr["start"],$var);
		
		
		$picnum=1;
		
		$fsql->query("select * from {P}_product_con where $scl order by $ord $sc limit 0,$shownums");

		while($fsql->next_record()){
			
			$id=$fsql->f('id');
			$title=$fsql->f('title');
			$catpath=$fsql->f('catpath');
			$dtime=$fsql->f('dtime');
			$nowcatid=$fsql->f('catid');
			$ifnew=$fsql->f('ifnew');
			$ifred=$fsql->f('ifred');
			$ifbold=$fsql->f('ifbold');
			$author=$fsql->f('author');
			$source=$fsql->f('source');
			$cl=$fsql->f('cl');
			$src=$fsql->f('src');
			$cl=$fsql->f('cl');
			$memo=$fsql->f('memo');

			$n++;

			if($GLOBALS["CONF"]["CatchOpen"]=="1" && file_exists(ROOTPATH."product/html/".$id.".html")){
				$link=ROOTPATH."product/html/".$id.".html";
			}else{
				$link=ROOTPATH."product/html/?".$id.".html";
			}
	
			
			$dtime=date("Y-m-d",$dtime);

			if($cutword!="0"){$title=csubstr($title,0,$cutword);}
			if($cutbody!="0"){$memo=csubstr($memo,0,$cutbody);}

			if($src==""){$src="product/pics/nopic.gif";}
			
			$src=ROOTPATH.$src;

			//模版标签解释
			
			$var=array (
			'title' => $title, 
			'memo' => $memo,
			'propstr' => $propstr, 
			'dtime' => $dtime, 
			'link' => $link,
			'target' => $target,
			'author' => $author, 
			'source' => $source,
			'cat' => $cat,
			'catid'  => $catid,
			'src' => $src, 
			'picw' => $picw,
			'pich' => $pich,
			'cl' => $cl,
			'n' => $n
			);
			$str.=ShowTplTemp($TempArr["list"],$var);
		
		$picnum++;
		}
		$var=array(
			'fittype' => $fittype
		);
		$str.=ShowTplTemp($TempArr["end"],$var);

	return $str;


}
?>