MINI_SHL
Current Path : D:/wwwroot/wangmei148/wwwroot/module/
Upload File :
Current File : D:/wwwroot/wangmei148/wwwroot/module/CommentList.php

<?php

/*
	[²å¼þÃû³Æ] ×îÐÂÆÀÂÛ - Ì滻ģ°æ±êÇ©{#modCommentList#}
	[ÊÊÓ÷¶Î§] È«Õ¾
	[ÎÄ ¼þ Ãû] CommentList.php
	[¸üÐÂʱ¼ä] 2006/8/11
*/

function CommentList(){

	global $fsql,$charset,$tbl_comment,$CatchOpen;
	global $strMore,$NowMenuid,$MenuInfo;

		$PSET=PlusSet("modCommentList");

		$shownums=PlusDef($PSET["shownums"],"5");
		$ord=PlusDef($PSET["ord"],"id");
		$sc=PlusDef($PSET["sc"],"desc");
		$showtime=PlusDef($PSET["showtime"],"Y-m-d");
		$cutword=PlusDef($PSET["cutword"],"0");
		$target=PlusDef($PSET["target"],"_self");
		$onlytj=PlusDef($PSET["onlytj"],"0");
		$more=PlusDef($PSET["showmore"],$strMore);
		$tempname=PlusDef($PSET["tempname"],"tpl_list.htm");


		$morelink=ROOTPATH."comment.php";
		
		$scl=" fabu='1' and pid='0' ";

		if($onlytj=="1"){
			$scl.=" and tuijian='1' ";
		}

		//Ä£°æ½âÊÍ
		$Temp=LoadTemp(ROOTPATH."templates/".$MenuInfo["skin"]."/".$tempname);
		$TempArr=SplitTblTemp($Temp);

		$str=$TempArr["start"];

		$kk=0;
		$fsql->query("select * from $tbl_comment where $scl order by $ord $sc limit 0,$shownums");

		while($fsql->next_record()){
			
			$id=$fsql->f('id');
			$rid=$fsql->f('rid');
			$title=$fsql->f('title');
			$menuid=$fsql->f('menuid');
			$dtime=$fsql->f('uptime');
			$author=$fsql->f('name');
			$cl=$fsql->f('cl');

					
			$dtime=date($showtime,$dtime);
			if($cutword!="0"){$title=csubstr($title,0,$cutword,$charset);}

			$link=ROOTPATH."comment_detail.php?commentid=$id";

			$var=array (
			'title' => $title, 
			'dtime' => $dtime, 
			'author' => $author, 
			'cl' => $cl, 
			'link' => $link,
			'target' => $target
			);
			$str.=ShowTplTemp($TempArr["list"],$var);


		$kk++;

		}

		$str.=$TempArr["end"];

		$morestr=str_replace("{#more#}",$more,$TempArr["more"]);
		$morestr=str_replace("{#morelink#}",$morelink,$morestr);
		
		$str.=$morestr;


		return $str;

}

?>