Location: PHPKode > projects > Content*Builder > modules/artbox/artBox_multilanguage.php
<?php
	/*
	* artBox_multilanguage.php
	* Datei gibt ML Artikel aus. Die Datei gibt es, weil manchmal das 
	* Hauptmodul auf das einsprachige Artikel Management zeigt und man
	* trotzdem diese Artikel ausgeben will.
	* 
	* ist $artbox_template gesetzt, 
	* (per setModuleValue("moduleName", "artbox_template", "tplName"); )
	* wird dieses Template anstatt artbox.template gewählt
	* 
	* @version $Id: artBox_multilanguage.php,v 1.1 2004/02/14 10:33:34 cb_fog Exp $
	* @copyright 2003 C*B Development Team
	*/
	
	// Article Liste laden
	if($archive == 1) { 
		$artAmount = 10000; 
	} else { 
		if(!$cbOption->getSingleOption("artAmount")) {
			$artAmount = 10;
		} else {
			$artAmount = $cbOption->getSingleOption("artAmount");
		}
	}
	
	if(!is_object($artOption)) {
		//Ableitung des Article Option Objektes
		$artOption = new CBOption();
		$artOption->setModule("art");
		$artOption->getOptionList();
	}
	
	/* Implementation of stage rules in module article2 */
	$today = date( "Ymd", time() );
	if($cbOption->getSingleOption("timepost")) {
		if(!$preview) {
			$stageStatement = "AND general.stage = '3' AND general.publishfrom <= '".$today."' AND (general.publishto >= '".$today."' OR general.publishto = '00000000')";
		} else {
			$stageStatement = "";
		}
	} else {
		$stageStatement = "AND general.stage = '3'";
	}
	
	/*
	* Sortier Methode
	*/
	$sortMethod = $artOption->getSingleOption("sortMethod");
	switch($sortMethod){
		case ART_SORT_NUMERIC: 
			 $sortMethodString = "ORDER BY general.order_num ASC";
			 break;
		default:
			 $sortMethodString = "ORDER BY general.datetime DESC";
	} // switch
	
	$dlQuery = mysql_fetch_array(mysql_query("SELECT * FROM ".TABLE."_options WHERE name = 'default_lang' AND module = 'art'"));
	$defaultLanguage = $dlQuery[value];
	
	if(!empty($_COOKIE['main_language'])) {
		if(ereg("^[0-9]*$", $_COOKIE['main_language'])) {
			$defaultLanguage = $_COOKIE['main_language'];
		}
	}
	
	$contentWhere = "WHERE content.ide = general.ide $stageStatement AND content.language = '$defaultLanguage'";
	
	$query = "SELECT content.ide, content.language, content.title, general.datetime FROM ".TABLE."_art_content AS content, ".TABLE."_art_general AS general $contentWhere $sortMethodString LIMIT 0,$artAmount";
	$result = mysql_query($query);
	
	$noArticles = true;
	while($artData = mysql_fetch_object($result)) {
		$title = substr($artData->title, 0, 20);
		if(strlen($artData->title > 20)) {
			$title .= "...";
		}
		$artTitle[]		= $title;
		$artIde[]		= $artData->ide;
		$artFolderId[]	= $generalFolderID[$artData->ide];
		$noArticles = false;
	}
	
	$artType        = "article2";		
	
	
	if($noArticles) {
		$message[] = "No Articles in Folder";
		$tpl->assign("MESSAGE", $message);
		$tpl->assign("messageSet", "1");
		$tpl->assign("artListSet", "0");
	} else {
		$tpl->clear_assign("artListData");
		$tpl->assign("artListSet", "1");
		$artListData = array(  
			"NAV_FOLDER"	=> $artFolderId,
			"ARTICLE_TITLE" => $artTitle,
			"IDE"			=> $artIde
		);
		$tpl->assign("artListData", $artListData);
		$tpl->assign("OPENFOLDER", $openfolder);
	}
	
	/* 
	* Man kann für jede ArtikelBox ein anderes Template angeben
	*/
	if(!empty($artbox_template)) {
		$tpl->display($artbox_template);
	} else {
		$tpl->display("artBox.template");
	}
	
?>
Return current item: Content*Builder