\n"; } } if(!empty($_GET[verweis])) $VERWEIS = $_GET[verweis]; $content = load_content($PHPSESSID, $VERWEIS, $EXT_URL, $NAV_ID, $_GET[preview]); /* 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[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; } } $vars[print_cat] = "nav_id=".$NAV_ID; $content = parse_vars($vars, "./templates/red_header_main_print.tpl"); echo $content; function load_content($PHPSESSID, $VERWEIS, $EXT_URL, $NAV_ID, $PREVIEW) { $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 */ $header_template = "./templates/red_header_print.tpl"; $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 */ $vars[navi_1] = navi($NAV_ID, $PHPSESSID, ".", 1); $vars[navi_2] = navi($NAV_ID, $PHPSESSID, ".", 2); $vars[headline] = navi_rootline($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); } } return $html; } ?>