www.gusucode.com > 2028网博士成品网站管理系统 PHP网站源码程序 > 2028/hospital/module/HospitalList.php

    <?php

/*
	[插件名称] 门诊专家列表
	[适用范围] 全站
*/

function HospitalList(){

	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"];
		$pagename=$GLOBALS["PLUSVARS"]["pagename"];
		$tempname=$GLOBALS["PLUSVARS"]["tempname"];
		$picw=$GLOBALS["PLUSVARS"]["picw"];
		$pich=$GLOBALS["PLUSVARS"]["pich"];
		$fittype=$GLOBALS["PLUSVARS"]["fittype"];


		//地址栏参数

		if($pagename=="query" && strstr($_SERVER["QUERY_STRING"],".html")){
			$Arr=explode(".html",$_SERVER["QUERY_STRING"]);
			$nowcatid=$Arr[0];
		}elseif($_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' ";
		}


		//模版解释
		$Temp=LoadTemp($tempname);
		$TempArr=SplitTblTemp($Temp);

		$var=array(
			'coltitle' => $coltitle,
			'morelink' => $morelink
		);
		$str=ShowTplTemp($TempArr["start"],$var);
		

		$picnum=1;
		$fsql->query("select * from {P}_hospital_con where $scl order by $ord $sc limit 0,$shownums");

		while($fsql->next_record()){
			
			$id=$fsql->f('id');
			$name=$fsql->f('name');
			$specialty=$fsql->f('specialty');
			$zhicheng=$fsql->f('zhicheng');
			$body=$fsql->f('body');
			$dtime=$fsql->f('dtime');
			$uptime=$fsql->f('uptime');
			$iffb=$fsql->f('iffb');
			$cl=$fsql->f('cl');
			$src=$fsql->f('src');

			

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

			if($cutword!="0"){$name=csubstr($name,0,$cutword);}
			if($cutbody!="0"){$specialty=csubstr($specialty,0,$cutbody);}


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


			//模版标签解释

			$var=array (
				'id' => $id,
				'cat' => $cat,
				'name' => $name,
				'link' => $link,
				'specialty' => $specialty,
				'zhicheng' => $zhicheng,
				'strinfo' => $strInfo,
				'body' => $body,
				'src' => $src,
				'dtime' => $dtime,
				'iffb' => $iffb,
				'picw' => $picw,
				'pich' => $pich,
				'cl' => $cl
			);
			$str.=ShowTplTemp($TempArr["list"],$var);


		$picnum++;

		}

		$var=array(
			'fittype' => $fittype
		);
		$str.=ShowTplTemp($TempArr["end"],$var);


		return $str;

}

?>