<?php
//  Copyright (c) 2004-2006 randshop
//  http://www.randshop.com
//
//  Unter Lizenz von randshop
//	
//	Letzte Bearbeitung: 08.04.2006

	session_start();

	// SourceID = 1
	
	// Hauptkonfigurationsdatei
	include_once("../../conf/config.inc.php");
	include_once(DATEIPFAD . "conf/db.inc.php");
	include_once(DATEIPFAD . "includes/shopinitialize.inc.php");
	include_once(DATEIPFAD . "includes/functions.global.inc.php");
	include_once(DATEIPFAD . "includes/functions.artikel.inc.php");
	if(KUNDENGRUPPEN) {
		include_once(DATEIPFAD . "includes/functions.mod.kundengruppen.inc.php");
	} else {
		include_once(DATEIPFAD . "includes/functions.kundengruppen.inc.php");
	}
	include_once(DATEIPFAD . "includes/functions.kategorie.inc.php");
	include_once(DATEIPFAD . "includes/session_register.inc.php");
	include_once(DATEIPFAD . "includes/functions.newsletter.inc.php");
	include_once(DATEIPFAD . "includes/functions.news.inc.php");

	// Spracheninclude
	if (@fopen(DATEIPFAD . "includes/language/langu_" . $_SESSION["languageisocode"] . ".inc.php",r)) {
		include_once(DATEIPFAD . "includes/language/langu_" . $_SESSION["languageisocode"] . ".inc.php");
	} else {
		include_once(DATEIPFAD . "includes/language/langu_de.inc.php");
	}	


	// Header
	include_once(DATEIPFAD . "includes/header.inc.php");
	
	unset($_SESSION["kategorieid"]);
	$_SESSION['cs_referer'] = $_SERVER["HTTP_REFERER"];
	if ($_GET["id"]) {
	
		$NewsObject = GetNewsDetails($_GET["id"], $_SESSION["languageid"]);
	
		$datum = $NewsObject->datum;
		$tpl_newsHeadline = $NewsObject->headline;
		$tpl_newsBeitrag = nl2br(stripslashes($NewsObject->textEintrag));
		$newsImage = $NewsObject->imagestring;

		// Template
		$contentFile = DATEIPFAD . "templates/" . $rowTemp->name . "/website/news/news_detail.tpl";
	
	} else {
		
		if($rowFeat->news =="1") 	{

			$NewsArray = GetNewsList($_SESSION["languageid"], true);

			foreach ($NewsArray as $News) {

				$newsHeadline = "<a href=\"" . URLPFAD . "themes/news/index.php?id=" . $News["id"] . "\">" . $News["headline"] . "</a>";
				
				$news_uebersicht[] = array('id'=>$News["id"],
													'newsDatum'=>$News["datum"],
													'newsHeadline'=>$newsHeadline);
			}
		}

		// Templateaufruf fuer die Startseite
		$contentFile = DATEIPFAD . "templates/" . $rowTemp->name . "/website/news/uebersicht.tpl";

	}
	
	
	
// Letzte globale Zusammenfassung z.B. fuer Warenkorbanzeige, bevor das Template geladen wird.
include_once(DATEIPFAD . "includes/footer.inc.php");


// Template	
include_once(DATEIPFAD . "templates/" . $rowTemp->name . "/website/index.tpl");

	
@mysql_close($db);
?>
