<?
$imgpath = $row->image;
$std  = $imgpath;
if ($std=="") { $stdimage = "templates/".ADMINTHEME."/image/pixel.gif"; } else {
	$stdimage = "../" . $std; 
} 


$imgpath_top = $row->image_top;
$std_top  = $imgpath_top;
if ($std_top=="") { $stdimage_top = "templates/".ADMINTHEME."/image/pixel.gif"; } else {
	$stdimage_top = "../" . $std_top; 
} 


$dyn = '<img src="'.$stdimage.'" border="0" id="pic">';
$dyn_top = '<img src="'.$stdimage_top.'" border="0" id="pic_top">';


if($_COOKIE['fck']=="no"){
	$field_1 = '<input name="autobr1" type="checkbox" id="autobr1" value="1"> '.$langadmin['autobr'].'<br />';
	$field_1 .= '<textarea style="width:100%;height:250" name="text1" wrap="virtual">'.htmlspecialchars($row->text).'</textarea>';
	
	$field_2 = '<input name="autobr2" type="checkbox" id="autobr2" value="1"> '.$langadmin['autobr'].'<br />';
	$field_2 .= '<textarea style="width:100%;height:400" name="text2" wrap="virtual">'.htmlspecialchars($row->textmore).'</textarea>';
	
	$tmpl->assign("ed1", $field_1 );
	$tmpl->assign("ed2", $field_2 );
	
	}else{
	
	
	include(BASEDIR . "admin/fck2/fckeditor.php") ;
	
	$oFCKeditor->BasePath = BASEDIR . "admin/fck2/" ;
	$oFCKeditor = new FCKeditor('text1') ;
	$oFCKeditor->Height = 450 ; 
	$oFCKeditor->Value		= "$row->text";
	$tmpl->assign('ed1', $oFCKeditor->Create()) ;
	
	$oFCKeditor->BasePath = BASEDIR . "admin/fck2/" ;
	$oFCKeditor = new FCKeditor('text2') ;
	$oFCKeditor->Height = 450 ; 
	$oFCKeditor->Value		= "$row->textmore";
	$tmpl->assign('ed2', $oFCKeditor->Create()) ;

}

$news = array();
getNews(0, "", $news, $area);

$gallery = array();
getGallery(0, "", $gallery, $area, $dummy, $dummy, $dummy);

// ============================================================
// <<-- Galerieverknüpfungen -->>
// ============================================================
$r_navi = new dbc("SELECT galids,inline_screens FROM " . PREFIX . "_news WHERE newsid = '". $_REQUEST['id'] . "'" );
$row_linked_gals = $r_navi->fetchrow();

$row_linked_gals->gal_id = explode(",", $row_linked_gals->galids);
$tmpl->assign("linkedgals", $row_linked_gals);

if($row_linked_gals->inline_screens){
	$tmpl->assign("inlineshots", base64_encode(serialize($row_linked_gals->inline_screens)));
}

if($_REQUEST['action']=="edit") {
	$tmpl->assign("frameaction", "newsedit");
	$tmpl->assign("id", $_REQUEST['id']);
}

// <<-- PRODUKTE -->>
$sql = new dbc("SELECT title,id  FROM ".PREFIX."_products WHERE area='$area' order by title asc");
$products = array();
while( $row_pro=$sql->fetchrow()){
	array_push($products,$row_pro);
}

// <<-- LINKS -->>
$tmpl->assign("links", str_replace(";", "\n", $row->links));

// <<-- HERSTELLER -->>
$sql = new dbc("SELECT id,name FROM ".PREFIX."_manufacturer  WHERE area='$area'  order by name asc");
$items = array();
while( $row_mf=$sql->fetchrow()){
	array_push($items,$row_mf);
}
$tmpl->assign('products', $products);
$tmpl->assign('items', $items);
$tmpl->assign("gallery", $gallery);
$tmpl->assign("news", $news);
$tmpl->assign("uid", $UID);
$tmpl->assign("row", $row);
$tmpl->assign("dyn", $dyn);
$tmpl->assign("dyn_top", $dyn_top);
$tmpl->assign("actform", $actform);
$tmpl->assign("action", $_REQUEST['action']);
$tmpl->assign("jslang", substr($pref['lang'],0,-3));
$tmpl->assign("text", htmlspecialchars($row->text));
$tmpl->assign("textmore", htmlspecialchars($row->textmore));
$tmpl->assign("parent_id", $row->newscat);
$tmpl->assign("galid", $row->galid);
$tmpl->assign("galid2", $row->galid2);
$tmpl->assign("galid3", $row->galid3);
$tmpl->display("newsform.tpl");

?>