$v) { $$k = $v; } } /* if (ereg("trahos.de", $_SERVER[SERVER_NAME]) && empty($URL)) { $URL = "liw-trahos_de.html"; } elseif (ereg("liw-bt.de", $_SERVER[SERVER_NAME]) && empty($URL)) { $URL = "liw-bt_de.html"; } elseif (ereg("ggbb-rheinsieg.de", $_SERVER[SERVER_NAME]) && empty($URL)) { $URL = "home-1.html"; } if (empty($URL)) { $res = mysql_query("SELECT * FROM red_navigation ORDER BY group_id LIMIT 1"); $data = mysql_fetch_array($res); $URL = $data[dateiname]; } */ if (empty($URL)) { $server = str_replace('www.','',$_SERVER[SERVER_NAME]); $URL = str_replace('.','_',$server).'.html'; } if (isset($_GET[nav_id])) $res = mysql_query("SELECT * FROM red_navigation WHERE id='$_GET[nav_id]'"); else $res = mysql_query("SELECT * FROM red_navigation WHERE dateiname='$URL'"); if(mysql_num_rows($res) == 0) $res = mysql_query("SELECT * FROM red_navigation WHERE name='$server'"); $datasave = $data = mysql_fetch_array($res); $VERWEIS = $data[verweis]; $EXT_URL = $data[ext_url]; $NAV_ID = $data[id]; $META_ID = $data[meta_id]; $BILDER_REIHE = $data[styles]; if (!empty($_GET[verweis])) $VERWEIS = $_GET[verweis]; if(substr($data[group_id], 0, 3) == "100"){ // Ist LIW $vars[FOOTER] = "LIW-NewsSitemapImpressumAGB"; $vars[PIXEL] = "230"; $vars[bread] = $data[group_id]; }else{ $vars[FOOTER] = ""; $vars[SITEMAP] = ""; $vars[PIXEL] = "970"; $vars[bread] = $data[group_id]; } $content = load_content($PHPSESSID, $VERWEIS, $EXT_URL, $NAV_ID, $_GET[preview], $BILDER_REIHE); /* Verlinken */ while ( preg_match_all("/href=\"([0-9]+)\"/", $content, $matches) ) { foreach ( $matches[1] as $link ) { $sql = "SELECT * FROM red_navigation WHERE id='$link'"; $res = db_query($sql); $data = mysql_fetch_array($res); unset($a_cats); $katname = ""; $max = (strlen($data[group_id]) / 3) - 1; for($i = $max; $i > 0; $i--) { $g_id = substr($data[group_id], 0, $i * 3); $res_cat = db_query("SELECT * FROM red_navigation WHERE group_id='$g_id'"); $data_cat = mysql_fetch_array($res_cat); $a_cats[] = make_utf($data_cat[name]); } if (!empty($a_cats)) { $new_cats = array_reverse($a_cats); $katname = implode("/", $new_cats); $katname .= "/"; } $new_link = "/$katname$data[dateiname]"; $content = str_replace("href=\"" . $link . "\"", "href=\"$new_link\"", $content); } } while ( preg_match_all("/href=\"media:(.*)\"/", $content, $matches) ) { foreach ( $matches[1] as $link ) { $content = str_replace("href=\"media:" . $link . "\"", "href=\"/files/documents/$link\"", $content); } } $vars[print_cat] = "nav_id=" . $NAV_ID; $vars[TOP_CONTENT] = $content; $vars[PHPSESSID] = $PHPSESSID; /* META-Tags */ $res = db_query("SELECT * FROM red_meta WHERE id='$META_ID'"); $data_meta = mysql_fetch_array($res); if (!empty($data_meta)) { foreach ( $data_meta as $key => $value ) { $key = "META_" . strtoupper($key); $vars[$key] = $value; } } $content = parse_vars($vars, "./templates/red_header_main.tpl"); echo $content; function load_content($PHPSESSID, $VERWEIS, $EXT_URL, $NAV_ID, $PREVIEW, $BILDER_REIHE) { $SN = new SiteNavi(); $sql = "SELECT * FROM red_navigation n, red_templates t WHERE n.id='$NAV_ID' AND t.id=n.header_template_id"; $res = db_query($sql); $data = mysql_fetch_array($res); $group_id = $data[group_id]; /* Header-Template */ if (empty($data[path])) $header_template = "./templates/red_header.tpl"; else $header_template = "./files/templates/$data[path]"; $input_template = load_template($header_template); /* Anzahl der Contentbereiche ermitteln */ $max_contents = substr_count($input_template, "interncontent"); /* Seite mit Content füllen */ for($i = 1; $i <= $max_contents; $i++) { $sql = "SELECT *,c.id AS c_id FROM red_content_nav n, red_content c, red_typen_content t WHERE c.id=n.content_id AND n.nav_id='$NAV_ID' AND n.bereich='$i' AND t.id=c.typ ORDER BY n.sortierung"; $res = mysql_query($sql); while ( $data = mysql_fetch_array($res) ) { $MOD_TEMPLATE = "./templates/$data[show_template]"; $MOD_TYPE = $data[c_type]; $MOD_BILD = $data[bild]; $MOD_INHALT = $data[inhalt]; $MOD_PATH = $data[path]; $MOD_CONTENT_ID = $data[c_id]; $MOD_PARAMETER = $data[parameter]; $MOD_URL_WIDTH = $data[url_width]; $MOD_URL_HEIGHT = $data[url_height]; $MOD_URL_BLANK = $data[url_blank]; $MOD_VORSCHAU = 0; $MOD_HOME = "."; $MOD_IMAGE_HOME = "."; $MOD_MAIL_TO = $data[mail_to]; $MOD_TPL_1 = $data[template_1]; $MOD_TPL_2 = $data[template_2]; $MOD_TPL_3 = $data[template_3]; $MOD_TPL_4 = $data[template_4]; unset($mod_vars); if (!empty($MOD_PARAMETER)) { $a_param = explode("&", $MOD_PARAMETER); foreach ( $a_param as $p_key => $p_value ) { if (!empty($p_value)) { $a_param2 = explode("=", $p_value); $PARAMETER["$a_param2[0]"] = $a_param2[1]; } } } include ("./scripts/$data[show_script]"); $MOD_CONTENT = str_replace("./images/content", "/images/content", $MOD_CONTENT); $vars["interncontent_$i"] .= $MOD_CONTENT; $vars["interncontent_$i"] .= ""; } } if (!empty($EXT_URL)) { $vars["interncontent_1"] = "\n"; } elseif (!empty($VERWEIS)) { /* Wegen SUMA 'cat' umwandlen */ $res = db_query("SELECT * FROM red_navigation WHERE dateiname='" . basename($_SERVER[PHP_SELF]) . "'"); $data = mysql_fetch_array($res); $_GET[cat] = $data[id]; if (!ereg("verweis", $_SERVER[QUERY_STRING])) $_SERVER[QUERY_STRING] = "&verweis=$VERWEIS"; $VERWEIS = str_replace("|", "&", $VERWEIS); $query = str_replace("verweis", "kategorie", $_SERVER[QUERY_STRING]); $file = "http://www.hymer.ag/de/index.php?$query"; $handle = fopen($file, "r"); while ( !feof($handle) ) { $content .= fgets($handle, 4096); } fclose($handle); $content = str_replace("\n", "", $content); /* JavaScript-Links umwandeln */ preg_match("|go\('(.*)'|U", $content, $preg_matches); $tmp = $preg_matches[1]; $tmp = str_replace("kategorie", "verweis", $tmp); $tmp = str_replace("/de/index.php?", "./index.php?cat=$_GET[cat]&nav=$_GET[nav]&", $tmp); $content = str_replace($preg_matches[1], "$tmp", $content); $content = str_replace("$preg_matches[1]", "./index.php?cat=$_GET[cat]&nav=$_GET[nav]", $content); preg_match("|(.*)|U", $content, $preg_matches); $content = $preg_matches[1]; /* Links ersetzen */ preg_match_all("|href=\"(.*)\"|U", $content, $matches); foreach ( $matches[1] as $link ) { if ($link == "javascript:history.back()") continue; if ($link == "#") continue; if (ereg("\.wmv$", $link)) continue; if (ereg("mailto", $link)) continue; if (ereg("php?", $link)) { preg_match("|php\?(.*)$|U", $link, $preg_matches); $content = str_replace("$link", "./index.php?$preg_matches[1]&cat=$_GET[cat]&nav=$_GET[nav]", $content); $content = str_replace("kategorie", "verweis", $content); } elseif (preg_match("|([0-9]+)_|U", $link, $preg_matches)) { echo "1"; $content = str_replace("$link", "./index.php?verweis=$preg_matches[1]", $content); } } $vars["interncontent_1"] = $content; } /* Navigation laden */ if (!empty($BILDER_REIHE)) { $vars[bilder_reihe] = show_bilder_reihe($BILDER_REIHE); } elseif ($BILDER_REIHE == '0') { $vars[bilder_reihe] = show_bilder_reihe('13'); } else { $vars[bilder_reihe] = show_bilder_reihe('13'); } $vars[navi_1] = navi($NAV_ID, $PHPSESSID, ".", 1); $vars[navi_2] = navi($NAV_ID, $PHPSESSID, ".", 2); $vars[headline] = navi_rootline($NAV_ID); $vars[bread] = breadcrump($NAV_ID); $html = parse_vars($vars, $header_template); /* Platzhalter ersetzen */ while ( preg_match_all("|%%([-A-Za-z0-9&._]*)%%|U", $html, $matches_2) ) { foreach ( $matches_2[1] as $link ) { //$html = str_replace("%%".$link."%%", $SCRIPT_VARS[$link], $html); $html = str_replace("%%" . $link . "%%", $$link, $html); } } return $html; } function show_bilder_reihe($ID_REIHE) { /* Slide-Bilder anzeigen */ $sql = "SELECT * FROM mod_bilder_einzeln WHERE id_reihe='$ID_REIHE' ORDER BY id_bild"; $res = mysql_query($sql); while ( $data = mysql_fetch_array($res) ) { $slidebilder .= "\"\""; $count++; } return $slidebilder; } ?>