\n"; } } if($_GET['debug']) echo ""; /* Inhalt laden */ if($data_cat[script] != "") { include_once("./scripts/$data_cat[script]"); $content = $interncontent; } else $content = load_content($PHPSESSID, $_GET[group_id], $data[id]); /* Verlinken */ while(preg_match_all("/href=\"([0-9]+)\"/",$content,$matches)) { foreach($matches[1] as $link) { $res_tmp = mysql_query("SELECT * FROM navigation WHERE id='$link'"); $data_tmp = mysql_fetch_array($res_tmp); $content = str_replace("href=\"".$link."\"", "href=\"./index.php?PHPSESSID=$PHPSESSID&cat=$_GET[cat]&group_id=$data_tmp[group_id]\"", $content); } } $vars[top_content] = $content; $vars[PHPSESSID] = $PHPSESSID; if(substr($_GET[group_id], 0, 3) == "106"){ $vars[META] = "Chancengleichheit, zweiwochendienst Bildung Wissenschaft Kulturpolitik, Gesellschaft Chancengleichheit e.V. "; $content = parse_vars($vars, "./templates/header_top_cg.tpl"); }else{ $banner_site = ""; if(substr($_GET[group_id], 0, 3) == "102"){ //BUP $vars[META] = " Bildung und Politik, Bildung, Bildungspolitik, Hochschulpolitik, zweiwochendienst Wissenschaft Kulturpolitik "; $banner_site = 'bp'; } if(substr($_GET[group_id], 0, 3) == "103"){ //FUP $vars[META] = " Frauenpolitik, Frauen und Politik, Familienpolitik, Frauenförderung, Gleichberechtigung, Gleichstellungspolitik, Gender, Bildung und Politik "; $banner_site = 'fp'; } if(substr($_GET[group_id], 0, 3) == "105"){ //gesundheit $vars[META] = " Gesundheit und Politik, Multimedia und eLearning "; $banner_site = 'fgp'; } if(substr($_GET[group_id], 0, 3) == "104"){ //ePunkt-KMP $vars[META] = " Multimedia und eLearning, zweiwochendienst Bildung Wissenschaft Kulturpolitik, Bildung und Politik "; $banner_site = 'ep'; } if(substr($_GET[group_id], 0, 3) == "100"){ //Startseite $vars[META] = " Bildung und Politik, Bildung, Bildungspolitik, Hochschulpolitik, Frauenpolitik, Frauen und Politik, Familienpolitik, zweiwochendienst Wissenschaft Kulturpolitik "; $banner_site = 'landing'; } if($CHANGETITLE !== NULL) { $vars[META] = ereg_replace('(\).*(\)',"\\1$CHANGETITLE\\2",$vars[META]); } $vars['banner_rotation'] = ""; if($banner_site != '' && is_array($banners = getBanners($banner_site)) && $_SESSION['testme']) { shuffle($banners); $banner = array_pop($banners); if(ereg("\.swf$",$banner['path'])) { $dimensions = getImageSize('images/banner/'.$banner['path']); $vars['banner_rotation'] .= " "; } elseif($banner['id'] != '') { $vars['banner_rotation'] .= ""; } mysql_query("UPDATE `mod_banner` SET `views` = `views` + 1 WHERE `id` = '{$banner['id']}'"); } if($_SESSION['testme']) $content = parse_vars($vars, "./templates/header_top_test.tpl"); else $content = parse_vars($vars, "./templates/header_top.tpl"); } echo $content; function load_content($PHPSESSID, $group_id, $nav_id) { global $HELP, $FORM, $DB; $sql = "SELECT * FROM navigation n, mod_files_link l WHERE group_id='$group_id' AND l.id=n.header_template_id"; $res = db_query($sql); $data = mysql_fetch_array($res); $portaltyp = $data[portaltyp]; //echo $sql; /* Header-Template */ if(empty($data[path])) $header_template = "./templates/header.tpl"; else $header_template = "./files/$data[path]"; $input_template = load_template($header_template); /* Anzahl der Contentbereiche ermitteln */ $max_contents = substr_count($input_template, "interncontent"); /* Vorschau mit Content füllen */ for($i=1; $i<=$max_contents; $i++) { $sql = "SELECT *, t.bezeichnung AS c_type, c.id AS c_id, c.name AS c_name FROM content_nav n, content c, 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_index = mysql_query($sql); while($data_index = mysql_fetch_array($res_index)) { $MOD_TEMPLATE = "./templates/$data_index[show_template]"; $MOD_TYPE = $data_index[c_type]; $MOD_BILD = $data_index[bild]; $MOD_INHALT = $data_index[inhalt]; $MOD_NAME = $data_index[c_name]; $MOD_PATH = $data_index[path]; $MOD_CONTENT_ID = $data_index[c_id]; $MOD_PARAMETER = $data_index[parameter]; $MOD_VORSCHAU = 0; $MOD_HOME = "."; $MOD_IMAGE_HOME = "."; $MOD_MAIL_TO = $data_index[mail_to]; $MOD_TPL_1 = $data_index[template_1]; $MOD_TPL_2 = $data_index[template_2]; $MOD_TPL_3 = $data_index[template_3]; $MOD_TPL_4 = $data_index[template_4]; $PORTALTYP = $portaltyp; $MOD_TOP = $data_index[top]; $MOD_TOP_HP = $data_index[top_meldung]; unset($mod_vars); unset($MOD_CONTENT); /* Suche */ if($_GET[search] == "l") $data_index[show_script] = "script_suche.php"; include("./scripts/$data_index[show_script]"); // if($_SERVER['REMOTE_ADDR'] == '87.79.200.125') echo('

'.$data_index[show_script].'

'); if(!empty($MOD_CONTENT)) { if($have_to_login == 1 ) { $header_template = "./files/header_login.tpl"; $vars["interncontent_1"] = $MOD_CONTENT; $have_to_login = 0; break; } else { $have_to_login = 0; $vars["interncontent_$i"] .= $MOD_CONTENT; } $vars["interncontent_$i"] .= ""; } } } if($_GET[action] == "profile") { $vars["interncontent_1"] = "Profil bearbeiten"; } /* Navigation laden */ $vars[NAVI] = navi($_GET[cat], $PHPSESSID); $vars_navi[PHPSESSID] = $PHPSESSID; if($_GET[action] == "logout") { $zeit = time(); $off_time = $zeit-6000; $clean_db = @mysql_query("DELETE FROM redstatus2 WHERE time<'$off_time'"); $zeit = time(); $temp = @mysql_query("DELETE FROM redstatus2 WHERE userid='$_SESSION[t_userid]'"); session_unregister(t_userid); @mysql_close(); if($_GET[portal] == "cg") header("Location:./index.php?cat=234&group_id=106010002"); else header("Location:./index.php"); return; } if($_SESSION[t_userid] != "") { $vars_navi[LOGIN_STRING] = ""; $vars_navi[loginid] = "ID: ".$_SESSION[t_userid]; } else { $vars_navi[LOGIN_STRING] = "&cat=5&group_id=102200006&fromstart=1&login=new')\">"; } $vars[NAVILEISTE_HORIZONTAL] = parse_vars($vars_navi, "./templates/navileiste.tpl"); $vars[PHPSESSID] = $PHPSESSID; //echo $portaltyp; $vars[FRAME_RIGHT] = load_frame_right($portaltyp); $vars[NAVI_LEFT] = load_navi_left($portaltyp, $PHPSESSID); //$whatthe = load_navi_left($portaltyp, $PHPSESSID); //echo $whatthe; $vars[NAVI_LEFT_START_1] = load_navi_left(102, $PHPSESSID); $vars[NAVI_LEFT_START_2] = load_navi_left(103, $PHPSESSID); $a_logos = array("102" => "header_bipo_ohne.jpg", "103" => "header_frauen_ohne.jpg", "104" => "header_kmp.gif", "105" => "header_fg_ohne.jpg"); $a_logos_bottom = array("102" => "header_unten2.jpg", "103" => "header_unten2.jpg", "104" => "header_kmp_left.gif", "105" => "header_unten2.jpg"); $vars[header_logo] = $a_logos[$portaltyp]; $vars[header_logo_bottom] = $a_logos_bottom[$portaltyp]; /* Chancengleichheit hat immer den gleichen Header */ if($portaltyp == "106") { if(!($_SESSION[t_userid] != "")) { //hier $vars[link_login] = ""; } else { $vars[link_login] = ""; } $header_template = "./files/header_chancengleichheit_start.tpl"; } if($header_template == "./files/header_spezial_ep.tpl") { $header_template = "./files/header_kmp.tpl"; } if($header_template == "./files/header_login.tpl") $header_template = "./files/header_login_".substr($_GET[group_id], 0, 3).".tpl"; $vorschau = parse_vars($vars, $header_template); //echo $vorschau; return $vorschau; } function load_frame_right($portaltyp) { $a_cat = array("102" => "10", "103" => "20", "104" => "40", "105" => "30"); $a_sub = array("102" => "98", "103" => "98", "104" => "101", "105" => "63"); $a_link_print = array("102" => "102201004", "103" => "103003004", "104" => "104003004", "105" => "105003004"); $a_link_print_a = array("102" => "102201003", "103" => "103003003", "104" => "104003003", "105" => "105003003"); $a_link_supplements = array("102" => "102201003001", "103" => "103003003001", "104" => "104003003001", "105" => "105003003001"); $a_link_newsletter = array("102" => "102201006", "103" => "103003006", "104" => "104004", "105" => "105003006"); $a_link_special = array("102" => "102201005", "103" => "103003005", "104" => "104003005", "105" => "105003005"); $a_zwd_links = array("102" => "102100006", "103" => "103001006", "104" => "104001006", "105" => "105001006"); $a_zwd_adressen = array("102" => "102100005", "103" => "103001005", "104" => "104001005", "105" => "105001005"); $a_zwd_termine = array("102" => "102100003001", "103" => "103001003001", "104" => "104001003001", "105" => "105001003001"); $a_zwd_artikel = array("102" => "102100001", "103" => "103001001", "104" => "104001001", "105" => "105001001"); $a_name_printausgabe= array("102" => "Aktuelle Printausgabe", "103" => "Aktuelle Printausgabe", "104" => "Aktuelle Printausgabe", "105" => "Aktuelle Printausgabe"); $vars[NAME_PRINTAUSGABE] = $a_name_printausgabe[$portaltyp]; /* Bei FP und FG keine Supplements */ if($portaltyp == "102" || $a_cat == "104") { $vars[supplements] = "
 Supplements
"; } $sql = "SELECT * FROM RedArtikel WHERE cat='$a_cat[$portaltyp]' AND subcat='$a_sub[$portaltyp]' AND online='1' ORDER BY time DESC"; $mod_res = mysql_query($sql); $data = mysql_fetch_array($mod_res); $vars[HEADER] = $data[header]; $vars[SPECIAL_ID] = $data[id]; $vars[GROUP_ID] = $a_link_print[$portaltyp]; $vars[GROUP_ID_ARCHIV] = $a_link_print_a[$portaltyp]; $vars[GROUP_ID_SUPPLEMENTS] = $a_link_supplements[$portaltyp]; $vars[GROUP_ID_NEWSLETTER] = $a_link_newsletter[$portaltyp]; $vars[GROUP_ID_SPECIAL] = $a_link_special[$portaltyp]; $vars[PHPSESSID] = $_GET[PHPSESSID]; //////// Aktuelle Printausgabe ////////////// $a_cat = array("102" => "10", "103" => "20", "104" => "40", "105" => "30"); $a_sub = array("102" => "6110", "103" => "6110", "104" => "74", "105" => "65"); $sql = "SELECT * FROM RedArtikel WHERE cat='$a_cat[$portaltyp]' AND subcat='$a_sub[$portaltyp]' AND online='1' ORDER BY time DESC"; $mod_res = mysql_query($sql); $data = mysql_fetch_array($mod_res); $sql = "SELECT *, k.name AS k_name, a.id AS a_id FROM RedArtikel a, RedKategorien k WHERE a.id='$data[id]' AND (a.cat=k.id AND a.subcat=k.subid) AND a.online='1'"; $mod_res = mysql_query($sql); $mod_data = mysql_fetch_array($mod_res, MYSQL_ASSOC); $res_img = db_query("SELECT bild FROM RedBilder WHERE articleid='$mod_data[a_id]' AND bildid='1'"); $data_img = mysql_fetch_array($res_img); $mod_text = ""; $bild = $mod_text; if(file_exists("../redweb/bilder/thumbs/".str_replace(".jpg", "-highres.jpg", $data_img[bild])) && !empty($data_img[bild])) $vars[PRINTAUSGABE_BILD] = $bild; else { /* Bild erstellen */ echo ""; if(!empty($data_img[bild])) { $IMAGE = new Image(); $IMAGE->make_thumb("../redweb/bilder/$data_img[bild]", str_replace(".jpg", "-highres.jpg", $data_img[bild]), 200, "../redweb/bilder/thumbs/"); $vars[PRINTAUSGABE_BILD] = $bild; } } /////////////////////////////////////////// $vars[PHPSESSID] = $_GET[PHPSESSID]; if($_SESSION[t_userid] != "") { $vars[MEIN_ZWD] = "
 
Mein ZWD  
 Mein Profil
 Eigene Artikel
 Eigene Termine
 Eigene Adressen
 Eigene Links
"; } $TEMPLATE = "./templates/frame_right.tpl"; return parse_vars($vars, $TEMPLATE); } function load_navi_left($portaltyp, $PHPSESSID) { $TEMPLATE = "./templates/navi_left.tpl"; switch($portaltyp) { case '102': $vars[GROUP_ID_1] = "102"; $vars[GROUP_ID_2] = "102100001"; $vars[GROUP_ID_3] = "102100002"; $vars[GROUP_ID_4] = "102100003"; $vars[GROUP_ID_5] = "102100005"; $vars[GROUP_ID_6] = "102100004"; $vars[GROUP_ID_7] = "102100006"; $vars[GROUP_ID_8] = "104"; $vars[headline] = "Bildung & Politik"; $vars[LAST_LINK] = "Kultur (KMP)"; $vars[SUCHNAME] = "B&P"; $vars[IMAGE] = "goBlau.gif"; $vars[GROUP_ID_SUCHE] = "102100009"; $vars[style_navtop] = "navtop"; $vars[NavLink] = "NavLink"; $vars[CAT_SHORT] = "B&P"; break; case '103': $vars[GROUP_ID_1] = "103"; $vars[GROUP_ID_2] = "103001001"; $vars[GROUP_ID_3] = "103001002"; $vars[GROUP_ID_4] = "103001003"; $vars[GROUP_ID_5] = "103001005"; $vars[GROUP_ID_6] = "103001004"; $vars[GROUP_ID_7] = "103001006"; $vars[GROUP_ID_8] = "105"; $vars[headline] = "Frauen & Politik"; $vars[LAST_LINK] = "FrauenGesundheit"; $vars[SUCHNAME] = "F&P"; $vars[IMAGE] = "goMagenta.gif"; $vars[GROUP_ID_SUCHE] = "103001007"; $vars[style_navtop] = "navtopFP"; $vars[NavLink] = "NavLinkFP"; $vars[CAT_SHORT] = "F&P"; break; case '104': $vars[GROUP_ID_1] = "104"; $vars[GROUP_ID_2] = "104001001"; $vars[GROUP_ID_3] = "104001002"; $vars[GROUP_ID_4] = "104001003"; $vars[GROUP_ID_5] = "104001005"; $vars[GROUP_ID_6] = "104001004"; $vars[GROUP_ID_7] = "104001006"; $vars[GROUP_ID_8] = "102"; $vars[headline] = "Kultur:Medien:Politik"; $vars[LAST_LINK] = "Bildung & Politik"; $vars[SUCHNAME] = "KMP"; $vars[IMAGE] = "goOrange.gif"; $vars[GROUP_ID_SUCHE] = "104001007"; $vars[style_navtop] = "navtop"; $vars[NavLink] = "NavLink"; $vars[CAT_SHORT] = "Kultur (KMP)"; break; case '105': $vars[GROUP_ID_1] = "105"; $vars[GROUP_ID_2] = "105001001"; $vars[GROUP_ID_3] = "105001002"; $vars[GROUP_ID_4] = "105001003"; $vars[GROUP_ID_5] = "105001005"; $vars[GROUP_ID_6] = "105001004"; $vars[GROUP_ID_7] = "105001006"; $vars[GROUP_ID_8] = "103"; $vars[headline] = "FrauenGesundheit"; $vars[LAST_LINK] = "Frauen & Politik"; $vars[SUCHNAME] = "FG&P"; $vars[IMAGE] = "goGruen.gif"; $vars[GROUP_ID_SUCHE] = "105001007"; $vars[style_navtop] = "navtop"; $vars[NavLink] = "NavLink"; $vars[CAT_SHORT] = "FG&P"; break; } $vars[PHPSESSID] = $PHPSESSID; return parse_vars($vars, $TEMPLATE); } function replace_search($ergebnis, $search_name) { $ergebnis = str_replace(strtoupper($search_name), "".strtoupper($search_name)."", $ergebnis); $ergebnis = str_replace(strtolower($search_name), "".strtolower($search_name)."", $ergebnis); $ergebnis = str_replace(ucfirst($search_name), "".ucfirst($search_name)."", $ergebnis); return $ergebnis; } function getBanners($type = 'all') { $return = array(); if($type == 'all') { $res = mysql_query("SELECT * FROM mod_banner WHERE 1"); while($row = mysql_fetch_assoc($res)) { $return[$row['id']] = $row; } } else { $res = mysql_query("SELECT * FROM mod_banner WHERE `online_{$type}` = '1'"); while($row = mysql_fetch_assoc($res)) { $return[$row['id']] = $row; } } return $return; } ?>