$y) $$x=$y;
function Umlaut($text) {
$text=preg_replace('/ä/','ä',$text);
$text=preg_replace('/ö/','ö',$text);
$text=preg_replace('/Ä/','Ä',$text);
$text=preg_replace('/Ö/','Ö',$text);
return $text;
}
function Content($table,$id,$lang,$menu,$submenu) {
global $database;
$query_a="SELECT content FROM ".$table." WHERE `id`='".$id."' ";
foreach(array('lang','menu','submenu') as $x) {
if(!$$x) continue;
$query_b="SELECT content FROM ".$table." WHERE `id`='".$id."' AND `".$x."`='".$$x."' LIMIT 1;";
$result_b=$database->query($query_b);
if($result_b->numRows()) $query_a.="AND `".$x."`='".$$x."' ";
}
$query_a.="LIMIT 1;";
$result_a=$database->query($query_a);
$tmp_a=$result_a->fetchRow(DB_FETCHMODE_ASSOC,0);
return Umlaut($tmp_a['content']);
}
function Menulist($menu) {
global $database;
$query="SELECT menu FROM data WHERE `submenu`='".$menu."' AND `position`='' ORDER BY `order` ASC;";
$result=$database->query($query);
$menus=array();
for($i=0;$i<$result->numRows();$i++) {
$tmp=$result->fetchRow(DB_FETCHMODE_ASSOC,$i);
array_push($menus,$tmp['menu']);
}
return $menus;
}
function Menutext($menu,$lang) {
global $database;
$query="SELECT content FROM menus WHERE `menu`='".$menu."' AND `lang`='".$lang."' LIMIT 1;";
$result=$database->query($query);
$tmp=$result->fetchRow(DB_FETCHMODE_ASSOC,0);
if(!$tmp['content']) {
$query="SELECT content FROM menus WHERE `menu`='".$menu."' AND `lang`='' LIMIT 1;";
$result=$database->query($query);
$tmp=$result->fetchRow(DB_FETCHMODE_ASSOC,0);
}
return $tmp['content'];
}
function Datatext($menu,$submenu,$lang) {
global $database;
$query="SELECT content FROM data WHERE `lang`='".$lang."' AND `menu`='".$menu."' AND `submenu`='".$submenu."' LIMIT 1;";
$result=$database->query($query);
if($result->numRows()) $tmp=$result->fetchRow(DB_FETCHMODE_ASSOC,0);
if(!$tmp['content']) {
$query="SELECT content FROM data WHERE `lang`='".$lang."' AND `menu`='".$menu."' AND `submenu`='' LIMIT 1;";
$result=$database->query($query);
if($result->numRows()) $tmp=$result->fetchRow(DB_FETCHMODE_ASSOC,0);
}
$text=preg_replace('/^$/','
',$tmp['content']);
return Umlaut($text);
}
function Datatextborder($position,$menu,$submenu,$lang) {
global $database;
$query="SELECT content,position,submenu FROM data WHERE `lang`='".$lang."' AND `menu`='".$menu."' AND `position`='".$position."' ORDER BY `order` ASC;";
$result=$database->query($query);
if($result->numRows()) for($i=0;$i<$result->numRows();$i++) {
$tmp=$result->fetchRow(DB_FETCHMODE_ASSOC,$i);
if($tmp['submenu']=='') {
print Umlaut($tmp['content']);
print '
';
}
}
print '
'."\n"; else print ' | '."\n";
print ''.Menutext($tmp['submenu'],$lang).' '; print " | \n";
}
print "
'."\n"; else print ' | '."\n"; print ''.Menutext($x,$lang)."\n"; print " | \n"; } print "
'."\n";
print ' '."\n";
print ' ';
print "'; print ' '; print Datatextborder('left',$menu,$submenu,$lang); print ' | \n";
print ''."\n";
print "
'; print ' '; print ' '."\n";
print Datatext($menu,$submenu,$lang);
print ' '."\n";
print ''; print " | \n";
print ''."\n";
print "
| \n";
print '|||||||
'."\n"; print ''."\n"; print " | \n"; print "|||||||||
'."\n";
print "
| \n";
print "