filter_id; } $_SESSION["filter_id"] = $filter_id; // Template und Login $template_file = "default.php"; // Standard-Template if ($filter_id) { $sql_filter = query("SELECT template_file, filter_address_id FROM sys_template, sys_filter WHERE (template_id = filter_template_id) AND (filter_id = $filter_id)"); if ($rs_filter = mysql_fetch_object($sql_filter)) { $template_file = $rs_filter->template_file; if ($rs_filter->filter_address_id != 0) { if (isset($_SESSION["session_address_id"])) { if (!is_user_category($_SESSION["session_address_id"],$rs_filter->filter_address_id)) { header("Location:login.php"); } } else { header("Location:login.php"); } } } } // Menü if (request("menu_id")) { $menu_id = request("menu_id"); } else { $sql_menu = query("SELECT sys_menu.menu_id AS menu_id FROM sys_menu, sys_menu_filter WHERE(menu_parent_id = 0) AND(menu_public = 1) AND(sys_menu.menu_id = sys_menu_filter.menu_id) AND(filter_id = $filter_id) ORDER BY menu_position LIMIT 1"); $rs_menu = mysql_fetch_object($sql_menu); $menu_id = $rs_menu->menu_id; } $_SESSION["menu_id"] = $menu_id; // Seite $page_id = request("page_id"); if ($page_id) { if ((isset($filter_id))AND($filter_id != 0)) { $rs = query("SELECT sys_page.page_id AS page_id FROM sys_page, sys_page_filter WHERE(page_menu_id = $menu_id) AND(page_public = 1) AND(sys_page.page_id = $page_id) AND(sys_page.page_id = sys_page_filter.page_id) AND(filter_id = $filter_id)"); } else { $rs = query("SELECT page_id FROM sys_page WHERE(page_menu_id = $menu_id) AND(page_public = 1) AND(sys_page.page_id = $page_id)"); } if (mysql_num_rows($rs) == 0) { $page_id = false; } if ($rs_data = mysql_fetch_object($rs)) { $page_id = $rs_data->page_id; } } if (!$page_id) { if ((isset($filter_id))AND($filter_id != 0)) { $sql_page = query("SELECT sys_page.page_id AS page_id FROM sys_page, sys_page_filter WHERE(page_menu_id = $menu_id) AND(page_public = 1) AND(sys_page.page_id = sys_page_filter.page_id) AND(filter_id = $filter_id) ORDER BY sys_page.page_position LIMIT 1"); } else { $sql_page = query("SELECT page_id FROM sys_page WHERE(page_menu_id = $menu_id) AND(page_public = 1) ORDER BY page_position LIMIT 1"); } if ($rs_page = mysql_fetch_object($sql_page)) { $page_id = $rs_page->page_id; } } $_SESSION["page_id"] = $page_id; //****************** //*** Funktionen *** //****************** // Menü anzeigen function show_menu() { global $PHP_SELF; global $conn; global $menu_id; global $filter_id; if ($menu_id) { include("admin/sys_templates/menu.inc.php"); } } // Seiten-Inhalt anzeigen function show_page() { global $PHP_SELF; global $root_page; global $root_path; global $root_web; global $admin_mode; global $conn; global $page_id; global $menu_id; global $filter_id; if ($page_id) { include("admin/sys_templates/page.inc.php"); } } // Filter (Auftritte) anzeigen function show_filter() { global $PHP_SELF; global $conn; global $menu_id; global $page_id; global $filter_id; if ($filter_id) { include("admin/sys_templates/filter.inc.php"); } } // Gehört der User zu einer gesuchten Adressen-Kategorie? function is_user_category($chk_cur_user_id, $chk_cur_user_category_id) { $sql_func = query("SELECT * FROM mdb_ad1_category_address WHERE (category_id = $chk_cur_user_category_id) AND (address_id = $chk_cur_user_id)"); if (mysql_num_rows($sql_func) == 0) { return false; } else { return true; } } // Druckansicht if (request("print_tec")) { $print_tec = request("print_tec"); } else { $print_tec = 0; } if ($print_tec == 1) { include("templates/print.php"); } else { include("templates/$template_file"); } mysql_close($conn); ?>