get_it('SELECT * FROM `'.$db_prefix.'sites` ORDER by p_id,priority ASC')) { $lines = build_structure($kids,$list,$lines,0,0); $tpl->assign("sites",$lines); $tpl->assign("kids",$kids); } if (isset($_GET['s'])) { if ($list = $db->get_it('SELECT * FROM `'.$db_prefix.'sites` where titel="'. mysql_real_escape_string($_GET['s']) . '"')) { $_GET['site'] = $list[0]['id']; $tpl->assign("p_id",$list[0]['id']); } } if (isset($_GET['site'])) { $menusite = $_GET['site']; for ($i = 0;$i < count($lines);$i++) { if ($lines[$i]["id"] == $_GET['site']) { $depth = $lines[$i]["depth"]; while ($depth >= 1) { $depth = $lines[--$i]["depth"]; } $menusite = $lines[$i]["id"]; break; } } $tpl->assign("menu_start",$menusite); if (isset($_GET['preview'])) { if ($list = $db->get_it('SELECT * FROM `'.$db_prefix.'site_changes` where s_id="'. mysql_real_escape_string($_GET['site']) .'" AND id="'. mysql_real_escape_string($_GET['preview']) .'" order by last_changed DESC LIMIT 1')) { dyncontent(mysql_real_escape_string($_GET['site']),$db,$tpl); $tpl->assign("content",$list[0]["content"]); if ($list[0]["titel"] != "") { $tpl->assign("title",$list[0]["titel"]); } } } else { if ($list = $db->get_it('SELECT * FROM `'.$db_prefix.'site_changes` where s_id="'. mysql_real_escape_string($_GET['site']) .'" order by last_changed DESC LIMIT 1')) { dyncontent(mysql_real_escape_string($_GET['site']),$db,$tpl); $tpl->assign("content",$list[0]["content"]); if ($list[0]["titel"] != "") { $tpl->assign("title",$list[0]["titel"]); } } } if ($list = $db->get_it('SELECT * FROM `'.$db_prefix.'sites` where id="'. mysql_real_escape_string($_GET['site']) .'" LIMIT 1')) { $tpl->assign("p_id",$list[0]["id"]); } } else { if ($list = $db->get_it('SELECT home FROM `'.$db_prefix.'options` where id="1"')) { if ($list2 = $db->get_it('SELECT * FROM `'.$db_prefix.'site_changes` where s_id="'. $list[0]['home'] .'" order by last_changed DESC LIMIT 1')) dyncontent(mysql_real_escape_string($list[0]['home']),$db,$tpl); $tpl->assign("content",$list2[0]["content"]); $tpl->assign("p_id",$list[0]['home']); } } if ($list = $db->get_it('SELECT id FROM `'.$db_prefix.'assoc_class` where name="farben"')) { if ($list2 = $db->get_it('SELECT * FROM `'.$db_prefix.'assoc` where c_id="'. $list[0]['id'].'"')) $tpl->assign("farben",$list2); } if ($list = $db->get_it('SELECT id FROM `'.$db_prefix.'assoc_class` where name="logos"')) { if ($list2 = $db->get_it('SELECT * FROM `'.$db_prefix.'assoc` where c_id="'. $list[0]['id'].'"')) $tpl->assign("logo",$list2); } if ($list = $db->get_it('SELECT id FROM `'.$db_prefix.'assoc_class` where name="logo_rechts"')) { if ($list2 = $db->get_it('SELECT * FROM `'.$db_prefix.'assoc` where c_id="'. $list[0]['id'].'"')) $tpl->assign("rlogos",$list2); } $tpl->display("index.htm"); ?>