Location: PHPKode > projects > Content*Builder > libraries/comment/displayComments.php
<?php
	$commentsSet = 0;
	if(empty($outputOrder)) {
		$outputOrder = "ORDER BY datetime ASC";
	}
	$query = mysql_query("SELECT * FROM ".TABLE."_comment WHERE type = '$type' AND entryID = '$entryID' $outputOrder $outputLimit");
	
	$c_email  = array();
	$c_emailSet  = array();
	$c_homepage  = array();
	$c_homepageSet = array();
	$c_author = array();
	$c_text = array();
	$c_date = array();
	$c_time = array();
	$c_datetime = array();
	$c_title  = array();
	
	$commentsSet = 0;
	
	if($query) {
		while($get = mysql_fetch_array($query)) {
			// check ob Email gesetzt ist
			$_emailSet = 0;
			if(ereg("@",$get[email])) {
				$c_email[] = unicode_encode($get["email"]);
				$_emailSet = 1;
			}
			$c_emailSet[] = $_emailSet;
			
			// check ob HP gesetzt ist
			$_hpSet = 0;
			if($get["homepage"] != "") {
				$_hpSet = 1;
				$c_homepage[] = $get["homepage"];
			}
			$c_homepageSet[] = $_hpSet;
			
			$c_author[] = $get["author"];
			$c_text[] = stripslashes($get["text"]);
			$c_date[] = getGermanDate($get["datetime"]);
			$c_time[] = substr($get["datetime"],11,8);
			$c_datetime[] = $get["datetime"];
			$c_title[]  = stripslashes($get["title"]);
			$commentsSet = 1;
		}
		
		$tpl->clear_assign("comments");
		$tpl->assign("comments", 
			array(
				"COMMENTSSET" => $commentsSet,
				"AUTHOR"    => $c_author,
				"HP"        => $c_homepage,
				"HP_SET"    => $c_homepageSet,
				"EMAIL"     => $c_email,
				"EMAIL_SET" => $c_emailSet,
				"DATE"      => $c_date,
				"TIME"      => $c_time,
				"DATE_TIME" => $c_datetime,
				"TITLE"     => $c_title,
				"TEXT"      => $c_text
			)
		);
	}
?>
Return current item: Content*Builder