url=$GLOBALS["Site"]->urls[0].$GLOBALS["runpath"]; ### GET SITE CONFIIG if (file_exists($n="../.cfg/sites/site.".$GLOBALS["Site"]->id.".cfg.php")){ include_once($n); } #### #print_r($GLOBALS["Page"]); #echo "

"; #die(); include_once ($GLOBALS['uploadpath']."module/custom.functions.php"); include_once($GLOBALS['uploadpath']."module/breadcrumb.class.php"); $GLOBALS["BREADCRUMB"]=new breadcrumb(); $GLOBALS["BREADCRUMB"]->add("home", "Home"); ###################################### MAP TO MEISTERSTRASSE ############################### /* MAP MEISTERSTRASSE START id: 9*/ ## FIND BANNER DOWNWARDS function downbanner($start=0) { $bannerid=$start; $res=mysql_query($sql="SELECT COUNT(b.id) as anz,n.parent FROM banner b LEFT JOIN banner_navig_map m on m.mapid=b.id LEFT JOIN _navigation n on m.myid=n.id WHERE m.myid='".$start."' GROUP BY n.id"); if(mysql_num_rows($res)<1) { $res=mysql_query($sql="SELECT n.parent FROM _navigation n WHERE n.id='".$start."'"); $arr=mysql_fetch_array($res); if(($parent=$arr["parent"])>0) { return $bannerid=downbanner($parent); } else { $bannerid=0; } } return $bannerid; } if($GLOBALS["Page"]->data["parent"]>0) { $BANNERID = downbanner($GLOBALS["Page"]->id); }else{ $BANNERID = $GLOBALS["Page"]->id; } // BANNER PAGE $sql="SELECT b.* FROM banner b LEFT JOIN banner_navig_map m on m.mapid=b.id WHERE m.myid='".$BANNERID."' ORDER BY m.sortorder ASC"; if ($res=mysql_query($sql)) { if (mysql_num_rows($res)>0) { $BANNER = array(); while ($bann = mysql_fetch_array($res)) { $BANNER[]=$bann; } } } $sql=""; /* */ $dat=array("localisation"=>0); $sq="SELECT localisation from _module where id='".$GLOBALS["Page"]->data["_module_id"]."'"; if(!$qu=mysql_query($sq)) { echo "ERROR $sq"; } else { $dat = mysql_fetch_array($qu); } /* print_r($GLOBALS["Page"]); echo "
"; print_r($dat); die("
$sq
".$GLOBALS["CURRENT_MEISTERSTRASSE"]." , ".$GLOBALS["CURRENT_REGION"]." , ".$GLOBALS["CURRENT_BETRIEB"]); */ $GLOBALS["XML"]="site=".$GLOBALS["Site"]->id."&".urlencode("/tools/xml.php"); if ($dat["localisation"]>=1) { if ($GLOBALS["CURRENT_BETRIEB"]>0) { $sq="SELECT b.id, b.bet_reg_id, b.bet_ms_id, m.ms_name, m.ms_uri, m.ms_footer, r.reg_footer, r.reg_uri,m.ms_addr, r.reg_addr, r.reg_name from module_betriebe b LEFT JOIN module_meisterstrasse m on m.id=b.bet_ms_id LEFT JOIN module_region r on r.id=bet_reg_id where b.id = '".$GLOBALS["CURRENT_BETRIEB"]."'"; if($result=mysql_query($sq)) { if (mysql_num_rows($result)>0) { $arr = mysql_fetch_array($result); $GLOBALS["CURRENT_MEISTERSTRASSE"]=$arr["bet_ms_id"]; $GLOBALS["CURRENT_MEISTERSTRASSE_NAME"]=$arr["ms_uri"]; $GLOBALS["CURRENT_MEISTERSTRASSE_REALNAME"]=$arr["ms_name"]; $GLOBALS["CURRENT_REGION"]=$arr["bet_reg_id"]; $GLOBALS["CURRENT_REGION_NAME"]=$arr["reg_uri"]; $GLOBALS["CURRENT_REGION_REALNAME"]=$arr["reg_name"]; if ($arr["ms_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["ms_addr"]; } if ($arr["reg_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["reg_addr"]; } $sq="SELECT id, ms_name, ms_uri,ms_headmsg, ms_addr,ms_logo, ms_col from module_meisterstrasse where id='".mysql_escape_string($GLOBALS["CURRENT_MEISTERSTRASSE"])."'"; if($result=mysql_query($sq)) { if(mysql_num_rows($result)>0){ $arr = mysql_fetch_array($result); if ($arr["ms_uri"]=="") { $GLOBALS["CURRENT_MEISTERSTRASSE_NAME"] ="id".$arr["id"]; } else {$GLOBALS["CURRENT_MEISTERSTRASSE_NAME"] = $arr["ms_uri"]; } if($arr["ms_name"]!=""){$GLOBALS["CURRENT_MEISTERSTRASSE_REALNAME"]=$arr["ms_name"];} if ($arr["ms_col"]!="") { $GLOBALS["CURRENT_COLOR"]=$arr["ms_col"]; } if ($arr["ms_footer"]!="") { $GLOBALS["CURRENT_FOOTER"]=$arr["ms_footer"]; } if ($arr["reg_footer"]!="") { $GLOBALS["CURRENT_FOOTER"]=$arr["reg_footer"]; } if ($arr["ms_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["ms_addr"]; } if ($arr["ms_logo"]>0) { $GLOBALS["CURRENT_LOGO"]=$arr["ms_logo"]; } if ($arr["ms_headmsg"]>0) { $GLOBALS["CURRENT_HEADMSG"]=$arr["ms_headmsg"]; } } } else { echo "
$sq
"; } $sq="SELECT id, reg_uri, reg_footer, reg_logo, reg_headmsg, reg_addr, reg_name from module_region where id='".mysql_escape_string($GLOBALS["CURRENT_REGION"])."'"; if($result=mysql_query($sq)) { if(mysql_num_rows($result)>0){ $arr = mysql_fetch_array($result); if ($arr["reg_uri"]=="") { $GLOBALS["CURRENT_REGION_NAME"] ="id".$arr["id"]; } else {$GLOBALS["CURRENT_REGION_NAME"] = $arr["reg_uri"]; } if($arr["reg_name"]!=""){$GLOBALS["CURRENT_REGION_REALNAME"]=$arr["reg_name"];} if ($arr["reg_col"]!="") { $GLOBALS["CURRENT_COLOR"]=$arr["reg_col"]; } if ($arr["reg_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["reg_addr"]; } if ($arr["reg_logo"]>0) { $GLOBALS["CURRENT_LOGO"]=$arr["reg_logo"]; } if ($arr["reg_footer"]!="") { $GLOBALS["CURRENT_FOOTER"]=$arr["reg_footer"]; } if ($arr["reg_headmsg"]>0) { $GLOBALS["CURRENT_HEADMSG"]=$arr["reg_headmsg"]; } } } else { echo "
$sq
"; } } } $GLOBALS["XML"]="site=".$GLOBALS["Site"]->id."&".urlencode("/tools/xml.php?type=betrieb&betrieb=".$GLOBALS["CURRENT_BETRIEB"]); } else { if (count($GLOBALS["Page"]->params)>=1) { // GET MEISTERSTRASSEN ID if (ereg("id([0-9][0-9]*)", $GLOBALS["Page"]->params[0], $out)) { #print_r($GLOBALS["Page"]->params); $GLOBALS["CURRENT_MEISTERSTRASSE"]=$out[0]; $GLOBALS["CURRENT_MEISTERSTRASSE_NAME"]=$GLOBALS["Page"]->params[0]; // GET COL $sq="SELECT id, ms_col, ms_headmsg, ms_footer, ms_addr, ms_name, ms_logo from module_meisterstrasse where id='".mysql_escape_string($GLOBALS["CURRENT_MEISTERSTRASSE"])."'"; if($result=mysql_query($sq)) { if(mysql_num_rows($result)>0){ $arr = mysql_fetch_array($result); if ($arr["ms_col"]!="") { $GLOBALS["CURRENT_COLOR"]=$arr["ms_col"]; } if ($arr["ms_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["ms_addr"]; } if($arr["ms_name"]!=""){$GLOBALS["CURRENT_MEISTERSTRASSE_REALNAME"]=$arr["ms_name"];} if($arr["ms_footer"]!=""){$GLOBALS["CURRENT_FOOTER"]=$arr["ms_footer"];} if ($arr["ms_logo"]>0) { $GLOBALS["CURRENT_LOGO"]=$arr["ms_logo"]; } if ($arr["ms_headmsg"]>0) { $GLOBALS["CURRENT_HEADMSG"]=$arr["ms_headmsg"]; } } } } else { $sq="SELECT id, ms_uri,ms_headmsg, ms_footer, ms_name, ms_addr,ms_logo, ms_col from module_meisterstrasse where ms_uri='".mysql_escape_string($GLOBALS["Page"]->params[0])."'"; if($result=mysql_query($sq)) { if(mysql_num_rows($result)>0){ $arr = mysql_fetch_array($result); $GLOBALS["CURRENT_MEISTERSTRASSE"]=$arr["id"]; if ($arr["ms_uri"]=="") { $GLOBALS["CURRENT_MEISTERSTRASSE_NAME"] ="id".$arr["id"]; } else {$GLOBALS["CURRENT_MEISTERSTRASSE_NAME"] = $arr["ms_uri"]; } if ($arr["ms_col"]!="") { $GLOBALS["CURRENT_COLOR"]=$arr["ms_col"]; } if ($arr["ms_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["ms_addr"]; } if($arr["ms_name"]!=""){$GLOBALS["CURRENT_MEISTERSTRASSE_REALNAME"]=$arr["ms_name"];} if ($arr["ms_logo"]>0) { $GLOBALS["CURRENT_LOGO"]=$arr["ms_logo"]; } if ($arr["ms_headmsg"]>0) { $GLOBALS["CURRENT_HEADMSG"]=$arr["ms_headmsg"]; } if($arr["ms_footer"]!=""){$GLOBALS["CURRENT_FOOTER"]=$arr["ms_footer"];} } } } $GLOBALS["CURRENT_LOCALISATION_STRING"]="/".$GLOBALS["CURRENT_MEISTERSTRASSE_NAME"]; // BANNER $sql="SELECT b.* FROM banner b LEFT JOIN banner_meisterstrasse_map m on m.mapid=b.id WHERE m.myid='".$GLOBALS["CURRENT_MEISTERSTRASSE"]."' ORDER BY m.sortorder ASC"; if ($res=mysql_query($sql)) { if (mysql_num_rows($res)>0) { $BANNER = array(); while ($bann = mysql_fetch_array($res)) { $BANNER[]=$bann; } } } } /* MAP REGION ENDE */ if (count($GLOBALS["Page"]->params)>=2) { // GET REGION ID if (ereg("id([0-9]*)", $GLOBALS["Page"]->params[1], $out)) { $GLOBALS["CURRENT_REGION"]=$out[0]; $GLOBALS["CURRENT_REGION_NAME"]=$GLOBALS["Page"]->params[1]; $sq="SELECT id, reg_col, reg_name, reg_footer, reg_headmsg, reg_addr from module_region where id='".mysql_escape_string($GLOBALS["CURRENT_REGION"])."'"; if($result=mysql_query($sq)) { if(mysql_num_rows($result)>0){ $arr = mysql_fetch_array($result); if ($arr["reg_name"]!="") { $GLOBALS["CURRENT_REGION_REALNAME"] = $arr["reg_name"]; } if ($arr["reg_col"]!="") { $GLOBALS["CURRENT_COLOR"]=$arr["reg_col"]; } if ($arr["reg_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["reg_addr"]; } if ($arr["reg_logo"]>0) { $GLOBALS["CURRENT_LOGO"]=$arr["reg_logo"]; } if($arr["reg_footer"]!=""){$GLOBALS["CURRENT_FOOTER"]=$arr["reg_footer"];} if ($arr["reg_headmsg"]>0) { $GLOBALS["CURRENT_HEADMSG"]=$arr["reg_headmsg"]; } } } } else { $sq="SELECT id, reg_uri, reg_name, reg_footer, reg_logo, reg_headmsg, reg_addr from module_region where reg_uri='".mysql_escape_string($GLOBALS["Page"]->params[1])."'"; if($result=mysql_query($sq)) { if(mysql_num_rows($result)>0){ $arr = mysql_fetch_array($result); $GLOBALS["CURRENT_REGION"]=$arr["id"]; if ($arr["reg_uri"]=="") { $GLOBALS["CURRENT_REGION_NAME"] ="id".$arr["id"]; } else {$GLOBALS["CURRENT_REGION_NAME"] = $arr["reg_uri"]; } if ($arr["reg_col"]!="") { $GLOBALS["CURRENT_COLOR"]=$arr["reg_col"]; } if ($arr["reg_addr"]>0) { $GLOBALS["CURRENT_ADDRESS"]=$arr["reg_addr"]; } if ($arr["reg_logo"]>0) { $GLOBALS["CURRENT_LOGO"]=$arr["reg_logo"]; } if ($arr["reg_headmsg"]>0) { $GLOBALS["CURRENT_HEADMSG"]=$arr["reg_headmsg"]; } if ($arr["reg_name"]!="") { $GLOBALS["CURRENT_REGION_REALNAME"] = $arr["reg_name"]; } if($arr["reg_footer"]!=""){$GLOBALS["CURRENT_FOOTER"]=$arr["reg_footer"];} } } } $GLOBALS["CURRENT_LOCALISATION_STRING"]=$GLOBALS["CURRENT_LOCALISATION_STRING"]."/".$GLOBALS["CURRENT_REGION_NAME"]; // BANNER $sql="SELECT b.* FROM banner b LEFT JOIN banner_region_map m on m.mapid=b.id WHERE m.myid='".$GLOBALS["CURRENT_REGION"]."' ORDER BY m.sortorder ASC"; if ($res=mysql_query($sql)) { if (mysql_num_rows($res)>0) { $BANNER = array(); while ($bann = mysql_fetch_array($res)) { $BANNER[]=$bann; } } } } $GLOBALS["XML"]="site=".$GLOBALS["Site"]->id."&".urlencode("/tools/xml.php?type=meisterstrassse&meisterstrasse=".$GLOBALS["CURRENT_MEISTERSTRASSE"]."®ion=".$GLOBALS["CURRENT_REGION"]); /* MAP REGION ENDE */ } } // GET CONTACT-ADDR $sq="SELECT * from address where id='".mysql_escape_string($GLOBALS["CURRENT_ADDRESS"])."'"; if($result=mysql_query($sq)) { $GLOBALS["CURRENT_ADDRESS_DATA"] = mysql_fetch_array($result); } #echo "
".$GLOBALS["CURRENT_LOCALISATION_STRING"]=$GLOBALS["CURRENT_LOCALISATION_STRING"]."/".$GLOBALS["CURRENT_REGION_NAME"]; /* MAP MEISTERSTRASSE ENDE */ ###################################### MAP TO MEISTERSTRASSE ############################### /*##############################################*/ /* CALL template.class */ /*##############################################*/ require $GLOBALS['uploadpath']."lib/rdt_xtpl.class.php"; $xtpl=new XTemplate ($GLOBALS['uploadpath'].'tpl/'.$GLOBALS['Site']->tpl); // ASSIGN VALUES $xtpl->assign("CURRENT_MEISTERSTRASSE_NAME", $GLOBALS["CURRENT_MEISTERSTRASSE_NAME"]); $xtpl->assign("CURRENT_MEISTERSTRASSE", $GLOBALS["CURRENT_MEISTERSTRASSE"]); $xtpl->assign("CURRENT_SITE", $GLOBALS['Site']->id); $xtpl->assign("LANGUAGE", $GLOBALS["Page"]->Language->id); $xtpl->assign("MyLanguage", $GLOBALS["Page"]->Language->id); $xtpl->assign("CURRENT_COLOR", $GLOBALS["CURRENT_COLOR"]); $xtpl->assign("CURRENT_BETRIEB_URI", $GLOBALS["CURRENT_BETRIEB_URI"]); $xtpl->assign("CURRENT_REGION", $GLOBALS["CURRENT_REGION"]); $xtpl->assign("XML", $GLOBALS["XML"]); $xtpl->assign("CURRENT_REGION_NAME", $GLOBALS["CURRENT_REGION_NAME"]); $xtpl->assign("CURRENT_LOCALISATION_STRING", $GLOBALS["CURRENT_LOCALISATION_STRING"]); #### USE THE FIRST URL OF site->urls as webpath $xtpl->assign('PHP',$arr = array("webpath"=>"http://".$GLOBALS["Site"]->urls[0].$GLOBALS["runpath"]."/")); $xtpl->assign("COLSHORT", str_replace("#", "", $GLOBALS["CURRENT_COLOR"])); // GET ADDRESS $xtpl->assign("CONTACT", $GLOBALS["CURRENT_ADDRESS_DATA"]=format_address($GLOBALS["CURRENT_ADDRESS_DATA"])); $xtpl->parse("main.left_nav.contact"); // ASSIGN ENDE #echo $REQUEST_URI." -- $sid --
"; #die("--- stage ini passed form handle.php---"); if ($GLOBALS['Page']->Module->id) { $xtpl->assign_file('MODULE_TPL', '../tpl/'.$GLOBALS['Page']->Module->data[moduletable].'.tpl'); $xtpl->assign('MODULE', $GLOBALS['Page']->Module->data); $xtpl->assign('PAGE', $GLOBALS['Page']->data); include("../module/". $GLOBALS['Page']->Module->data[file_name]); } else { _notfound(); $GLOBALS[nopage] = 1; } //print navigation; $bread = $GLOBALS['Page']->get_active_tree(); //mydebug($bread); $root =$rootTree = $GLOBALS['Page']->get_root_tree($bread); if ($SPid = $GLOBALS['Page']->get_search_page($root)) { $SP = new Page($SPid); $spath = ''; if ($GLOBALS[Site]->Navigation->tree[$root[0]][data][root]) { $spath = $GLOBALS[Site]->Navigation->tree[$root[0]][data][fullpath]; } $search = array(); $search = array(); $search[lang] = $SP->data[_language_id]; $search[restrict] = 'http://'.(($GLOBALS[WEBSERVER]) ? $GLOBALS[WEBSERVER] : $_SERVER[HTTP_HOST]); $search[path] = $SP->data[fullpath]; $xtpl->assign('SEARCH',$search); $xtpl->parse('main.search'); } reset($root); $tcount = 0; $bcount = 0; // INIT MODULES $loc=array(); $sq="SELECT id, localisation from _module where localisation>0"; if($qu=mysql_query($sq)) { while ($dat = mysql_fetch_array($qu)) { $loc[] = $dat["id"]; } } $meta=false; while (list(,$nid) = each($root)) { if ($GLOBALS['Site']->Navigation->tree[$nid][data][visible]) { $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_inactive; if (in_array($nid,$bread)) { $GLOBALS['Site']->Navigation->tree[$nid][data][active] = 'active'; $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_active; } if ($GLOBALS['Site']->Navigation->tree[$nid][data][position] == 'MAIN') { $tcount++; $GLOBALS['Site']->Navigation->tree[$nid][data][counter] = $tcount; $GLOBALS['Site']->Navigation->tree[$nid][data][ucname] = htmlentities(($GLOBALS['Site']->Navigation->tree[$nid][data][name]),ENT_COMPAT,'UTF-8'); $GLOBALS['Site']->Navigation->tree[$nid][data][ucname_encode] = urlencode(($GLOBALS['Site']->Navigation->tree[$nid][data][name])); if (in_array($GLOBALS['Site']->Navigation->tree[$nid][data]["_module_id"], $loc)) { $GLOBALS['Site']->Navigation->tree[$nid][data]["fullpath"].=$GLOBALS["CURRENT_LOCALISATION_STRING"]; } // LOAD SUB $scount=0; $sub=false; if ($GLOBALS['Site']->Navigation->tree[$nid][data][active] == 'active') { if(!$result=mysql_query($sql="SELECT * from _navigation WHERE parent='".$nid."' AND position='MAINSUB' and visible>0 AND _language_id='".$GLOBALS["Page"]->Language->id."' AND _site_id='".$GLOBALS["Site"]->id."' ORDER BY rank")){ echo "
ERROR $sql
"; } else { if (mysql_num_rows($result)>0) { while($arr = mysql_fetch_array($result, MYSQL_ASSOC)) { $scount++; $sub=true; if($GLOBALS["Page"]->id==$arr["id"]){$arr["active"]="active";} if (in_array($arr["_module_id"], $loc)) { $arr["fullpath"].=$GLOBALS["CURRENT_LOCALISATION_STRING"]; } $arr["counter"]=$tcount."-".$scount; $xtpl->assign('NAV',$arr); $xtpl->parse('main.nav.subnav.item'); } } } if ($sub) { $xtpl->parse('main.nav.subnav'); } } $xtpl->assign('NAV', $GLOBALS['Site']->Navigation->tree[$nid][data]); $xtpl->parse('main.nav'); } /* if ($GLOBALS['Site']->Navigation->tree[$nid][data][position] == 'META') { $bcount++; $GLOBALS['Site']->Navigation->tree[$nid][data][counter] = 'm'.$bcount; $GLOBALS['Site']->Navigation->tree[$nid][data][ucname] = htmlentities(mb_strtoupper($GLOBALS['Site']->Navigation->tree[$nid][data][name],'utf-8'),ENT_COMPAT,'UTF-8'); $GLOBALS['Site']->Navigation->tree[$nid][data][ucname_encode] = urlencode(mb_strtoupper($GLOBALS['Site']->Navigation->tree[$nid][data][name],'utf-8')); $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_inactive; if (in_array($nid,$bread)) { $GLOBALS['Site']->Navigation->tree[$nid][data][active] = 'active'; $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_active; } $xtpl->assign('NAV', $GLOBALS['Site']->Navigation->tree[$nid][data]); $xtpl->parse('main.metanav'); } */ if ($GLOBALS['Site']->Navigation->tree[$nid][data][position] == 'SUB') { $scount++; $GLOBALS['Site']->Navigation->tree[$nid][data][counter] = 'm'.$scount; $GLOBALS['Site']->Navigation->tree[$nid][data][ucname] = htmlentities(mb_strtoupper($GLOBALS['Site']->Navigation->tree[$nid][data][name],'utf-8'),ENT_COMPAT,'UTF-8'); $GLOBALS['Site']->Navigation->tree[$nid][data][ucname_encode] = urlencode(mb_strtoupper($GLOBALS['Site']->Navigation->tree[$nid][data][name],'utf-8')); $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_inactive; if (in_array($nid,$bread)) { $GLOBALS['Site']->Navigation->tree[$nid][data][active] = 'active'; $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_active; } $xtpl->assign('SUB', $GLOBALS['Site']->Navigation->tree[$nid][data]); $xtpl->parse('main.subnav'); } } } //print subnavigation; $topnav = $GLOBALS['Page']->get_topnav(); // mydebug($topnav); if ($topnav) { while (list(,$nid) = each($GLOBALS['Site']->Navigation->tree[$topnav][childs])) { if ($GLOBALS['Site']->Navigation->tree[$nid][data][visible]) { if (in_array($nid,$bread)) { $GLOBALS['Site']->Navigation->tree[$nid][data][active] = 'active'; } if (count($GLOBALS['Site']->Navigation->tree[$nid][childs])) { $subsub = FALSE; while (list(,$sid) = each($GLOBALS['Site']->Navigation->tree[$nid][childs])) { if (in_array($sid,$bread)) { $GLOBALS['Site']->Navigation->tree[$sid][data][active] = 'active'; } $xtpl->assign('NAV', $GLOBALS['Site']->Navigation->tree[$sid][data]); $xtpl->parse('main.subnav.subsubnav.item'); $subsub = TRUE; } if ($subsub) { $xtpl->parse('main.subnav.subsubnav'); } } $xtpl->assign('NAV', $GLOBALS['Site']->Navigation->tree[$nid][data]); $xtpl->parse('main.subnav'); } } // $xtpl->parse('main.nav_sub'); } if (!$GLOBALS['nopage']) { // print languages $GLOBALS[Site]->Navigation->tree[$root[0]][data][header_link] = $GLOBALS[Site]->Navigation->tree[$root[0]][data][fullpath]; $GLOBALS[Site]->Navigation->tree[$root[0]][data][header_name] = $GLOBALS[Site]->Navigation->tree[$root[0]][data][name_entity]; if (count($GLOBALS['Site']->languages) > 1) { $mylangs = get_site_languages(); $sql = "SELECT * FROM conf_language WHERE _language_id IN ('".join("', '",$GLOBALS['Site']->languages)."') AND _site_id = '".$GLOBALS[Site]->id."' ORDER BY _language_id"; $result = mysql_query($sql); while ($res = mysql_fetch_array($result, MYSQL_ASSOC)) { if ($res[_language_id] == $GLOBALS[Site]->Navigation->tree[$root[0]][data][_language_id] && $res[header_link]) { $GLOBALS[Site]->Navigation->tree[$root[0]][data][header_link] = $GLOBALS[Site]->Navigation->tree[$res[header_link]][data][fullpath]; $GLOBALS[Site]->Navigation->tree[$root[0]][data][header_name] = $GLOBALS[Site]->Navigation->tree[$res[header_link]][data][name_entity]; } $xtpl->assign('lang', array('id' => $res[_language_id], 'name' => $mylangs[$res[_language_id]], 'link' => $GLOBALS[Site]->Navigation->tree[$res[internal]][data][fullpath])); $xtpl->parse('main.langsite'); } } $use=str_replace($GLOBALS['runpath'],"",$REQUEST_URI); $mr = explode("/", $use); $mod = $mr[2]; if (count($GLOBALS[Page]->params)) { unset($mr[(count($req) - count($GLOBALS[Page]->params))]); } $xtpl->assign('MODULE_style',$mod ); $xtpl->assign('MODULE_type',$GLOBALS['Page']->Module->id); $xtpl->assign_file("FOOTERMAINFILE", "../tpl/footer/".$GLOBALS["CURRENT_FOOTER"]); // METANAV // INIT MODULES $meta=false; $root=$rootTree; while (list(,$nid) = each($root)) { if ($GLOBALS['Site']->Navigation->tree[$nid][data][visible]) { $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_inactive; if (in_array($nid,$bread)) { $GLOBALS['Site']->Navigation->tree[$nid][data][active] = 'active'; $GLOBALS['Site']->Navigation->tree[$nid][data][font] = $font_active; } if ($GLOBALS['Site']->Navigation->tree[$nid][data][position] == 'META') { #print_r($GLOBALS['Site']->Navigation->tree[$nid][data]); $GLOBALS['Site']->Navigation->tree[$nid][data][ucname] = htmlentities(($GLOBALS['Site']->Navigation->tree[$nid][data][name]),ENT_COMPAT,'UTF-8'); $GLOBALS['Site']->Navigation->tree[$nid][data][ucname_encode] = urlencode(($GLOBALS['Site']->Navigation->tree[$nid][data][name])); if($GLOBALS["Page"]->id==$arr["id"]){$arr["active"]="active";} if (in_array($arr["_module_id"], $loc)) { $arr["fullpath"].=$GLOBALS["CURRENT_LOCALISATION_STRING"]; } $arr["counter"]=$tcount."-".$scount; #print_r($arr); $xtpl->assign('NAV',$GLOBALS['Site']->Navigation->tree[$nid][data]); $meta=true; $xtpl->parse('main.metanav.item'); } } } if ($meta) { $xtpl->parse('main.metanav'); } $xtpl->assign('ROOT', $GLOBALS[Site]->Navigation->tree[$root[0]][data]); $xtpl->assign('SERVER',$_SERVER['HTTP_HOST']); #### USE THE FIRST URL OF site->urls as webpath $xtpl->assign('PHP',$arr = array("webpath"=>"http://".$GLOBALS["Site"]->urls[0].$GLOBALS["runpath"]."/")); $xtpl->assign('LANGUAGE', $l=$GLOBALS['Page']->Language->data); $xtpl->assign('TPL', preg_replace("/\.tpl$/","",$GLOBALS['Site']->tpl)); $xtpl->assign('MODULE', $GLOBALS['Page']->Module->data); $xtpl->assign('META', array( title => htmlentities($GLOBALS['Page']->data[meta_title],ENT_COMPAT,'UTF-8'), description => htmlentities($GLOBALS['Page']->data[meta_description],ENT_COMPAT,'UTF-8'), keywords => htmlentities($GLOBALS['Page']->data[meta_keywords],ENT_COMPAT,'UTF-8') ) ); $xtpl->parse('main.'.$GLOBALS['Page']->Language->id); Header('Content-Type: text/html; charset='.$GLOBALS['Page']->Language->data[charset]); Header('Content-Language: '.$GLOBALS['Page']->Language->data[id]); include_once ($GLOBALS['uploadpath']."module/custom.functions.php"); if (!array_key_exists("HEAD_DONE", $GLOBALS)) { $xtpl=build_head($GLOBALS["CURRENT_LOGO"],$GLOBALS["CURRENT_HEADMSG"],$GLOBALS["CURRENT_MEISTERSTRASSE_NAME"],$xtpl); } $xtpl=$GLOBALS["BREADCRUMB"]->out($xtpl,"main"); ### DO SocialNetwors include_once("../.cfg/socialnw.cfg.php"); foreach($GLOBALS["socialnw"] as $kk=>$rr) { $rr["key"]=$kk; $ra=array(); $ra["#URL#"]=urlencode("http://".$GLOBALS["Site"]->urls[0].$_SERVER["REQUEST_URI"]); $ra["#NOTICE#"]=""; $ra["#TITLE#"]=urlencode($GLOBALS["METADATA"]["title"]); $ra["#DESC#"]=urlencode($GLOBALS["METADATA"]["description"]); $ra["#TAGS#"]=urlencode($GLOBALS["METADATA"]["keywords"]); $rr["url"]=strtr($rr["url"],$ra); $rr=array_merge($ra,$rr); $xtpl->assign("ITM",$rr); $xtpl->parse("main.right_nav.socialnw.item"); } $xtpl->parse("main.right_nav.socialnw"); $xtpl->parse("main.right_nav"); $xtpl->parse('main'); //$xtpl->out('main'); $page_html = $xtpl->text('main'); $page_html = preg_replace("@]*?>(.*?)@usie",'htmlentities(gettext("\\1"),ENT_COMPAT,\'UTF-8\')',$page_html); /*if( function_exists( 'tidy_parse_string' ) ) { //print "DRIN"; tidy_set_encoding('utf8'); tidy_parse_string($page_html); tidy_setopt('output-xhtml', TRUE); tidy_setopt('indent', TRUE); tidy_setopt('indent-spaces', 2); tidy_setopt('wrap', 200); //tidy_setopt('hide-comments',TRUE); //tidy_setopt('numeric-entities',TRUE); //tidy_setopt('input-encoding', 'utf8'); //tidy_setopt('char-encoding','latin1'); //tidy_setopt('output-encoding', 'utf8'); tidy_clean_repair(); $page_html = tidy_get_output(); }*/ $page_html = utf8_html_entity_decode($page_html); ## NO DBLSLASCH #$replace="%(<\!\-\-\[if gte mso ([0-9]*)\]>)(.*?)(<\!\-\-\[endif\]\-\->)%is"; $pagehtml="dasds sadasdf fsdafds dasdsdss da kdfsaj df fdajsösdasdfa sdasdfa"; $allowed="([a-zA-Z_0-9\-/\.\?\=]*)"; $replace="%(href=\"(//)".$allowed."\")%is"; $page_html=preg_replace($replace,'href="/$3"',$page_html); $replace="%(href=\"".$allowed."(//)\")%is"; $page_html=preg_replace($replace,'href="$2/"',$page_html); $replace="%(href=\"".$allowed."(//)".$allowed."\")%is"; $page_html=preg_replace($replace,'href="$2/$4"',$page_html); $replace="%(href=\"http://".$allowed."(//)\")%is"; $page_html=preg_replace($replace,'href="http://$2/"',$page_html); $replace="%(href=\"http://".$allowed."(//)".$allowed."\")%is"; $page_html=preg_replace($replace,'href="http://$2/$4"',$page_html); #die($pagehtml); print str_replace("//?", "/?",$page_html); # print str_replace("//", "/", $page_html); #print $page_html; #echo "

"; } else { _notfound(); } #die(); #$data = ob_get_contents(); #ob_flush(); #echo strtr($data."
",$replaceURL); ?>