Location: PHPKode > projects > Content*Builder > modules/article/overview.inc.php
<?php
$tpl->assign("ICONDIR", $path["cb"].$cbDirUploads."cgfx/icons/");
include_once($rel."libraries/BTPL_functions.inc.php");

if($archive == 1) { 
	$artAmount = 10000; 
} else { 
	if(!$cbOption->getSingleOption("artAmount")) {
		$artAmount = 10;
	} else {
		$artAmount = $cbOption->getSingleOption("artAmount");
	}
}

require_once($path['cb'].$cbDirLib.'CB_media.class.php');
$myMedia  = new MediaManagement();
$myMedia->setOptionObject($cbOption);
$myMedia->setBranchID($cbOption->getSingleOption("rpBranch"));
$rpBranch = $myMedia->getBranchDirectory();
	
/* Implementation of stage rules in module article */
$today = date( "Ymd", time() );
if($cbOption->getSingleOption("timepost")) {
	if(!$preview) {
		$stageStatement = "AND art.stage = '3' AND art.publishfrom <= '".$today."' AND (art.publishto >= '".$today."' OR art.publishto = '00000000')";
		$dateStatement = "art.publishfrom as datum";
	} else {
		$stageStatement = "";
		$dateStatement = "art.datum";
	}
} else {
	$stageStatement = "AND art.stage = '3'";
}

$results = mysql_query("SELECT art.ide, art.title, art.intro, art.content, $dateStatement, art.userid, art.iconID, art.template, usr.name, usr.fullname, usr.email, usr.initial, folder.fname, meta.x_keywords, meta.x_description
	FROM ".TABLE."_article AS art, ".TABLE."_user AS usr, ".TABLE."_columns AS folder, ".TABLE."_metainfo AS meta
	WHERE art.userid = usr.userid 
		AND folder.fid = art.folder
		AND meta.x_id = art.ide
		AND art.folder = '".$openfolder."' $stageStatement 
	ORDER BY datum DESC 
	LIMIT 0,$artAmount");

$counter = 1;
while($contentObject = mysql_fetch_object($results)) {
	/*
	* Template Finder
	*/
	
	$style = $contentObject->template;
	if(($style)&&(is_dir($tplLocation."/$style"))) {
		$thisStyle = &$style;
	} else {
		$thisStyle = "default";
	}
	
	/**
	*  Load Article settings 
	*  Try to load individual settings for article template 
	*  or general if there is no individual setting file
	*/
	if(is_file($tplLocation."/".$thisStyle."/settings.inc.php")) {
		include($tplLocation."/".$thisStyle."/settings.inc.php");
	} else {
		include($location."/settings.inc.php");
	}
	/* End Load Article Settings */
	
	/* 
	* Intro in Spalten aufbrechen 
	*/
	$intro = $contentObject->intro;
	$intro = stripslashes($intro);
	
	/********* REPLACEMENT START **********/
	$intro	= str_replace('[REPLACEDIR]', $path["cb"].'uploads/files/'.$rpBranch.'/', $intro);
	/********** REPLACEMENT END ***********/

	if(preg_match("/^[0-9]*$/i", $introWordRestriction) && $introWordRestriction != "noRestriction") {
		$intro = word_substr($intro, $introWordRestriction, "4", "3");
	}
	
	// CB Article Link ... Internal Link Hack
	$intro = preg_replace("/\[CBLINK articleID=([0-9a-f-]*)\](.*)\[\/CBLINK]/i", "<a href=".$PHP_SELF."?load=".$load."&sub=full&id=$1&openfolder=".$openfolder.">$2</a>", $intro);
	$intro = preg_replace("/\[CBLINK module=([0-9a-zA-Z-]*) id=([0-9a-f-]*) fid=([0-9a-f-]*)\](.*)\[\/CBLINK]/i", "<a href=\"".$PHP_SELF."?load=$1&sub=full&id=$2&openfolder=$3\">$4</a>", $intro);
	$intro = preg_replace("/\[CBLINK module=([0-9a-zA-Z-]*) id=([0-9a-f-]*)\](.*)\[\/CBLINK]/i", "<a href=\"".$PHP_SELF."?load=$1&sub=full&id=$2\">$3</a>", $intro);

	/*
	foreach($matches as $k => $v) {
		echo $k." => ".$v."<br>";
		foreach($v as $k2 => $v2) {
			echo "\t".$k2." => ".$v2."<br>";
		}
	}
	*/
	
	$ide = $contentObject->ide;

	$title = substr($contentObject->title, 0, 24);
	if(strlen($contentObject->title) > 24) {
		$title .= "...";
	}
	
	$content_all = explode("[--PAGEBREAK--]", $contentObject->content);
	$content = stripslashes($content_all[0]);
	##### getting page titles #####
	if((count($content_all) > 0) AND ($content != '') AND ($content != 'n/a')) {
		$page_title = array();
		$page_title['0'] = "Additional Info";
		for($t = 1; $t < count($content_all); $t++)
		{
			$ptitle = explode("[--TITLE--]", $content_all[$t]);
			$page_title[$t] = $ptitle[1];
		}
	}
	############# end #############

	if(($content != '') AND ($content != 'n/a')) {
		$more = "1";
	} else {
		$more = "0";
	}

	
	$article_initial[]	= $contentObject->initial;
	
	$tpl->assign(
		array ( "FOLDER_NAME"  => $contentObject->fname,
				"TITLE"		   => $title,
				"IDE"		   => $ide,
				"INTRO"        => $intro,
				"ICON"		   => "",
				"ICONBRANCH"   => "",
				"ICONSET"      => "0",
				"AUTHOR_FULL"  => $contentObject->fullname,
				"DATE"		   => getGermanDate($contentObject->datum),
				"TIME"		   => substr($contentObject->datum,11,8),
				"EMAIL"	       => unicode_encode($contentObject->email),
				"AID"	       => $contentObject->userid,
				"MORE"		   => $more,
				"OPENFOLDER"   => $openfolder
		)
	);
	
	$output[] = $tpl->fetch("$thisStyle/overview.template", null, "article");
	$BTPL_metaData['title']    .= " ".$title;
	$BTPL_metaData['keywords'] .= ", ".$contentObject->x_keywords;
	++$counter;
	
	$tpl->clear_assign( 
		array ( "FOLDER_NAME", "TITLE", "IDE", "INTRO", "ICON", "ICONBRANCH",
				"ICONSET", "AUTHOR_FULL", "DATE", "TIME", "EMAIL", "AID", "MORE"
		)
	);
}
/*
if(is_array($artIcon)) {
	foreach($artIcon as $k => $v) {
		$query  = mysql_query("SELECT filename, branchID FROM ".TABLE."_mm_files WHERE fileID = '".$v."'");
		if($query) {
			$result = mysql_fetch_array($query);
			$bQuery = mysql_fetch_array(mysql_query("SELECT branchName FROM ".TABLE."_mm_folder WHERE branchID = '".$result[branchID]."'"));
			if($result["filename"] != "") { $artIconSet[] = 1; } else { $artIconSet[] = 0; }
			$artIconName[] = $result["filename"];
			$artIconBranch[] = $bQuery["branchName"];
		} else {
			$artIconSet[] = 0;
			$artIconName[] = "";
			$artIconBranch[] = "";
		}
	}
}
*/
	
$tpl->assign("overviewContent", $output);
$tpl->display("overviewContent.template");

#$tpl->displayParsedTemplate("overviewContent");
#$tpl->clearTemplate("overviewContent");
?>
Return current item: Content*Builder