"oe", ""=>"ae", ""=>"ue", ""=>"OE", ""=>"AE", ""=>"UE", ""=>"ss"); ForEach ($umlFix AS $What=>$To) { $retName = Str_Replace ($What, $To, $retName); } $retName = StrToLower (StripSlashes($retName)); $retName = Preg_Replace ("/[\'\.\,\/\]\[]/", "", $retName); $retName = Preg_Replace ("/\s+$/", "", $retName); $retName = Preg_Replace ("/[\s]/", "_", $retName); $retName = Preg_Replace ("/[&]([aoue])uml[;]/", "\\1e", $retName); $retName = Str_Replace ("ß", "ss", $retName); $retName = Str_Replace ("ä", "ae", $retName); Return $retName; } $Query = "SELECT * FROM ".$TBL["pages"]; $Result = MySQL_Query ($Query); While ($Row = MySQL_Fetch_Array ($Result)) { $pIndex = makePageName ($Row["PageTitle"]); $refLinks[$pIndex] = $Row["PageID"]; $refLinksB[$Row["PageID"]] = $pIndex; } if ($_GET["bn"] AND $refLinks[$_GET["bn"]]) { $PageID = $refLinks[$_GET["bn"]]; } SetType ($PageID, "Integer"); /* $Query = "select * from ".$TBL["pages"]; $Result = MySQL_Query ($Query); While ($Row = MySQL_Fetch_Array ($Result)) { $newText = StripSlashes ($Row["PageText"]); $newText = Str_Replace ("width=869", "width=735", $newText); mysql_query ("update ".$TBL["pages"]." SET PageText='".AddSlashes($newText)."' WHERE PageID=".$Row["PageID"]); }*/ If (Empty ($PageID)) { $QTemp = "SELECT %s FROM ".$TBL["menu"]." WHERE Active=1 AND MenuType=%s AND LangID='".$sesvar["lang"]."' AND ParentID=%s AND (TimeAkt = 0 OR (TimeAkt=1 AND ((onDate<='".$cDate."' AND offDate>='".$cDate."') AND (onTime<='".$cTime."' AND offTime>='".$cTime."')))) ORDER BY MenuOrder"; If ($fromstart) { $Query = SPrintF ($QTemp, "*", 1, 0); // $Query = "SELECT * FROM ".$TBL["menu"]." WHERE ParentID=0 AND MenuMenuType=1 AND Active=1 AND HomePage=1 AND LangID='".$sesvar["lang"]."'"; } Else { $Query = SPrintF ($QTemp, "*", 2, 0); } // $Query = "SELECT * FROM ".$TBL["menu"]." WHERE MenuType=2 AND Active=1 AND HomePage=1 AND LangID='".$sesvar["lang"]."'"; $Result = MySQL_Query ($Query); $PageID = ($Row = MySQL_Fetch_Array ($Result)) ? $Row["PageID"] : $PageID; $StartFlag = ($Row["MenuType"] == 2); } Else { $Query = "SELECT * FROM ".$TBL["menu"]." WHERE PageID=".$PageID." AND LangID='".$sesvar["lang"]."'"; $Result = MySQL_Query ($Query); $itemRow = MySQL_Fetch_Array ($Result); $StartFlag = ($itemRow["MenuType"] == 2); } $Macro = Array ("TITLE", "META", "STYLE", "MENU", "CONTENT", "FOOTER", "TOP", "BANNER", "SEARCH", "PAGEID", "EXPSTR"); // $TOPMENU = DoBuildMenu(0, 0, TRUE); If ($itemRow["MenuID"]) { $sqQuery = "SELECT * FROM ".$TBL["menu"]." WHERE Active=1 AND ParentID=".$itemRow["MenuID"]." AND LangID='".$sesvar["lang"]."'"; $sqResult = MySQL_Query ($sqQuery); } Function getRPParent ($mid) { GLOBAL $TBL; GLOBAL $sesvar; $Query = "SELECT * FROM ".$TBL["menu"]." WHERE MenuID=".$mid." AND LangID='".$sesvar["lang"]."'"; $Result = MySQL_Query ($Query); If ($Row = MySQL_Fetch_Array ($Result)) { If ($Row["ParentID"] == 0) Return $Row["MenuID"]; Else Return getRPParent ($Row["ParentID"]); } } If ($itemRow["ParentID"] != 0 OR ($sqResult AND MySQL_Num_Rows ($sqResult) > 0)) { If ($itemRow["MenuID"]) { $buildFrom = getRPParent ($itemRow["MenuID"]); } } $noBottom = FALSE; If ($buildFrom) { $TOPMENU = DoBuildMenu($buildFrom, 0, TRUE); } Else { $TOPMENU = ""; } If ($noBottom) { $SUBMENU .= ''; $SUBMENU .= $TOPMENU; $SUBMENU .= '
'; $TOPMENU = ""; } $MENU = DoBuildMenu(0, 0); $SMENU = ""; If ($buildFrom) { $getOnlyBack = TRUE; $SMENU = DoBuildMenu($buildFrom, 0); $getOnlyBack = FALSE; } $noHome = TRUE; $useIT = TRUE; $INDEXMENU = DoBuildMenu(0, 0); $EXPSTR = $Exp; If ($EXPSTR) { $EXPSTR = Explode(",", $EXPSTR); $EXPSTR = Array_Unique($EXPSTR); $EXPSTR = Implode($EXPSTR, ","); } $TITLE = GetPageTitle ($PageID); $CONTENT = StripSlashes(GetPageContents ($PageID)); $CONTENT = Str_Replace ("[SUBMENU]", $SUBMENU, $CONTENT); $BANNER = GetBanner (); $CharSet = "\n"; $Query = "SELECT * FROM ".$TBL["lang"]." WHERE LangID='".$sesvar["lang"]."'"; $Result = MySQL_Query ($Query); $Row["Charset"] = ($Row = MySQL_Fetch_Array ($Result) AND !Empty($Row["Charset"])) ? $Row["Charset"] :$CFG["defcharset"]; $META = SPrintF ($CharSet, $Row["Charset"]); $META .= SPrintF ($MetaTemplate, "language", StrToLower($Row["Name"]).", ".$Row["LangID"]); $META .= GetMetaTags ($PageID); $META .= ' '; $STYLE = "\n"; $STYLE .= "\n"; If ($itemRow["MenuType"] == 4) { $PAGEID = $PageID; $F_ID = GetFormularID ($PageID); If ($F_ID != 0) { // $CONTENT = ""; $File = FOpen ($CFG["url"]."/".$TMP_PATH."_fman.inc.php?F_ID=".$F_ID, "r"); If ($File) { While (!FEOF ($File)) { $CONTENT .= FRead ($File, 16384); } FClose ($File); } } UnSet ($F_ID); // $CONTENT = ""; /* $File = FOpen ($CFG["url"]."/".$TMP_PATH."_form.inc.php", "r"); If ($File) { While (!FEOF ($File)) { $CONTENT .= FRead ($File, 16384); } FClose ($File); } */ } $Pattern = Array (); $Replace = Array (); $Macro[] = "TOPMENU"; $Macro[] = "INDEXMENU"; $Macro[] = "SMENU"; $Macro[] = "SUBNAVY"; $Macro[] = "LUDATE"; $Query = "SELECT DATE_FORMAT(LastUpdated, '%d.%m.%Y') AS luDate FROM ".$TBL["pages"]." ORDER BY LastUpdated DESC LIMIT 0,1"; $lResult = MySQL_Query ($Query); If ($lRow = MySQL_Fetch_Array ($lResult)) { $LUDATE = $lRow["luDate"]; } Else $LUDATE = Date ("d.m.Y"); { } ForEach ($Macro As $Num => $Value) { Array_Push ($Pattern, "/\[".$Value."\]/"); Array_Push ($Replace, $$Value); } If ($customMSG AND Is_Array($customMSG)) { ForEach ($customMSG AS $mI=>$mText) { Array_Push ($Pattern, "/\["."CUSTOM".$mI."\]/"); Array_Push ($Replace, $mText); } } $Query = "SELECT * FROM ".$TBL["pages"]." WHERE PageID=".$PageID; $Result = MySQL_Query ($Query); If (MySQL_Num_Rows ($Result) == 0) { $TemplateFile = $TMP_PATH.$CFG["deftemplate"]; } Else { $Row = MySQL_Fetch_Array ($Result); If ($Row["LayoutID"] == 0) { $TemplateFile = $TMP_PATH.$CFG["deftemplate"]; } Else { $Result = MySQL_Query ("SELECT * FROM ".$TBL["lo"]." WHERE LayoutID=".$Row["LayoutID"]); $Row = MySQL_Fetch_Array ($Result); $TemplateFile = $TMP_PATH.$Row["MainTemplate"]; $Query = "SELECT * FROM ".$TBL["temp"]." WHERE LayoutID=".$Row["LayoutID"]; $Result = MySQL_Query ($Query); While ($Row = MySQL_Fetch_Array ($Result)) { $TNAME = $Row["TemplateName"]; } } If ($StartFlag) { $TemplateFile = $TMP_PATH."index.html"; } } $TempFile = FOpen ($TemplateFile, "r"); $Contents = ""; If ($TempFile) { While (!FEOF ($TempFile)) { $Contents .= FRead ($TempFile, FileSize ($TemplateFile)); } FClose ($TempFile); $Contents = Preg_Replace ($Pattern, $Replace, $Contents); } If ($sesvar["kfinfo"]) { ForEach ($sesvar["kfinfo"] AS $kfKey=>$kfValue) { $Contents = Str_Replace ("{".$kfKey."}", $kfValue, $Contents); } $sesvar["kfinfo"] = Array (); } If ($CFG["rewrite"]) { ForEach ($refLinksB AS $pid=>$pName) { $Contents = Str_Replace ("index.php?PageID=".$pid."\"", $pName.".htm\"", $Contents); } } $mainTemplateRaw = strip_tags ($Contents); if (preg_match_all('/(\b[\w\.%\-&]+\b|"[^"]+")@\b[\w\-&]+\b(\.\b[\w\-&]+\b)*\.[A-Za-z]{2,4}/im', $mainTemplateRaw, $matches, PREG_PATTERN_ORDER)) { // encode remaining text email foreach ($matches[0] AS $email) { $Contents = str_replace ($email, encodeEmail($email, 'text'), $Contents); } } if ($_SESSION['lastform'] AND is_array ($_SESSION['lastform'])) { foreach ($_SESSION['lastform'] AS $key=>$value) { $Contents = str_replace('{'.$key.'}', $value, $Contents); } } Print $Contents; ?>