='".$cDate."') AND (onTime<='".$cTime."' AND offTime>='".$cTime."')))) ORDER BY MenuOrder"; If ($fromstart) { $Query = SPrintF ($QTemp, "*", 1, 0); } Else { $Query = SPrintF ($QTemp, "*", 2, 0); } $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='".$_SESSION["sesvar"]["lang"]."'"; $Result = MySQL_Query ($Query); $itemRow = MySQL_Fetch_Array ($Result); $StartFlag = ($itemRow["MenuType"] == 2); $OfficeList = ($itemRow["MenuType"] == 199); } $Exp = Implode (Array_Unique (Explode (",", GetRealExpandedItems($PageID).$expAlways)), ","); $Macro = Array ("TITLE", "META", "STYLE", "MENU", "CONTENT", "FOOTER", "TOP", "BANNER", "SEARCH", "PAGEID", "EXPSTR", "OPTIONMAP", "TODAY", "TOPMENU", "ART", "MAINMAP", "EXTRAMAP", "RETPAGEID", "COMMENT"); $mPageID = $PageID; Function IsSecure ($PageID) { GLOBAL $TBL; $Query = "SELECT * FROM ".$TBL["menu"]." WHERE PageID=".$PageID; $Result = MySQL_Query ($Query); If ($Row = MySQL_Fetch_Array ($Result)) { Return ($Row["InPassword"] == 1); } Return FALSE; } Function GetLoginPage () { GLOBAL $TBL; $Query = "SELECT * FROM ".$TBL["menu"]." WHERE MenuType=99"; $Result = MySQL_Query ($Query); If ($Row = MySQL_Fetch_Array ($Result)) { Return $Row["PageID"]; } Return 0; } Function GetNewsPage () { GLOBAL $TBL; $Query = "SELECT * FROM ".$TBL["menu"]." WHERE MenuType=111"; $Result = MySQL_Query ($Query); If ($Row = MySQL_Fetch_Array ($Result)) { Return $Row["PageID"]; } Return 0; } If (IsSecure ($mPageID) AND !$_SESSION["sesvar"]["user-logged"]) { $GOPAGEID = $mPageID; $mPageID = GetLoginPage (); If ($mPageID) $useLogin = 1; } If ($A_ID) { $mPageID = GetNewsPage(); If ($mPageID) { $StartFlag = FALSE; $useArticle = TRUE; } } $MENU = DoBuildMenu(); $PageID = $mPageID; $EXPSTR = $Exp; If ($EXPSTR) { $EXPSTR = Explode(",", $EXPSTR); $EXPSTR = Array_Unique($EXPSTR); $EXPSTR = Implode($EXPSTR, ","); } $TITLE = StripSlashes(GetPageTitle ($PageID)); $CONTENT = StripSlashes(GetPageContents ($PageID)); $BANNER = GetBanner (); $OPTIONMAP = GetOptionMap (0, 0); $OPTIONMAP .= GetOptionMap (86, 0); If ($Art == 1) { $PageID = 19; } $TOPMENU = DoTopMenu(86); $PageID = $mPageID; $TODAY = Date ("d.m.Y", Time()); If (!$_SESSION["sesvar"]["stats"]) { $_SESSION["sesvar"]["stats"] = Array (); } If ($PageID AND !$_SESSION["sesvar"]["stats"][$PageID]) { $sm = (int)Date("m", Time()); $sy = (int)Date("Y", Time()); $statQuery = "SELECT * FROM ".$TBL["stats"]." WHERE s_type=0 AND s_month=".$sm." AND s_year=".$sy." AND PageID=".$PageID; $statResult = MySQL_Query ($statQuery); If (MySQL_Num_Rows ($statResult)) { $statRow = MySQL_Fetch_Array ($statResult); $updQuery = "UPDATE ".$TBL["stats"]." SET s_totalcount=s_totalcount+1 WHERE s_id=".$statRow["s_id"]; } Else { $updQuery = "INSERT INTO ".$TBL["stats"]." (PageID, s_month, s_year, s_totalcount, s_type) VALUES (".$PageID.", ".$sm.", ".$sy.", 1, 0)"; } MySQL_Query ($updQuery); $_SESSION["sesvar"]["stats"][$PageID] = 1; } $CharSet = "\n"; $Query = "SELECT * FROM ".$TBL["lang"]." WHERE LangID='".$_SESSION["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"; Function MakeMenuStructure ($pid, $level=0) { GLOBAL $TBL; $retVal = ""; $Query = "SELECT * FROM ".$TBL["menu"]." WHERE ParentID=".$pid." AND Active=1"; $Result = MySQL_Query ($Query); $nodeName = ($pid == 0) ? "menuNodes" : "subNodes".$pid; // If (MySQL_Num_Rows ($Result) > 0) { $retVal .= 'var '.$nodeName.' = new Array; '; } $k = 0; While ($Row = MySQL_Fetch_Array ($Result)) { $retVal .= $nodeName.'['.$k++.'] = '.$Row["MenuID"].'; '; if ($level < 1) $retVal .= MakeMenuStructure ($Row["MenuID"], $level+1); } Return $retVal; } $STYLE .= ' '; ?> \n"; If ($itemRow["MenuType"] == 4 OR $itemRow["MenuType"] == 8 OR $useLogin) { $PAGEID = $PageID; // $CONTENT = ""; $fName = ($itemRow["MenuType"] == 4) ? "_form.inc.php" : "_formsend.inc.php"; $fName = ($useLogin) ? "_login.inc.php" : $fName; $File = FOpen ($CFG["url"]."/".$TMP_PATH.$fName."?lng=".$sesvar["lang"], "r"); If ($File) { While (!FEOF ($File)) { $CONTENT .= FRead ($File, 16384); } FClose ($File); } } $PAGEID = $PageID; $RETPAGEID = ($FromID) ? $FromID : $PageID; If ($FromID) { $Query = "SELECT T1.*, T2.* FROM ".$TBL["pages"]." T1 LEFT OUTER JOIN ".$TBL["menu"]." T2 ON T1.PageID=T2.PageID WHERE T1.PageID=".$FromID; $ptResult = MySQL_Query ($Query); If ($ptRow = MySQL_Fetch_Array ($ptResult)) { Array_Push ($Macro, "SENDTITLE"); Array_Push ($Macro, "MENUNAME"); $SENDTITLE = $ptRow["PageTitle"]; $MENUNAME = $ptRow["MenuText"]; } } $ART = $Art; $Pattern = Array (); $Replace = Array (); $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"]; } If ($StartFlag) { $TemplateFile = (File_Exists ($TMP_PATH."index.html")) ? $TMP_PATH."index.html" : $TMP_PATH.$CFG["deftemplate"]; } If ($pF == 1) { $TemplateFile = $TMP_PATH."print.htm"; } } $blockMatch = Array (); $TempFile = @FOpen ($TemplateFile, "r"); If ($useArticle) { $CONTENT .= GetArticleContent ($A_ID); $Query = "SELECT T_ID FROM ".$TBL["aa"]." WHERE A_ID=".$A_ID; $Result = MySQL_Query ($Query); If ($Row = MySQL_Fetch_Array ($Result)) { $T_ID = $Row["T_ID"]; } $newsTemplate = fnReadFile ($TMP_PATH."news-short.html"); If ($T_ID) { $Result = GetAllArticles ($T_ID, 0); If (MySQL_Num_Rows ($Result) > 1) { $CONTENT .= '
'; $CONTENT .= ($T_ID == 1) ? "

More News

" : "

More Press Releases

"; $Pattern = Array ("/\[NT\]/", "/\[NS\]/", "/\[NL\]/"); While ($Row = MySQL_Fetch_Array ($Result)) { $T_ID = ($T_ID) ? $T_ID : $Row["T_ID"]; If ($Row["A_ID"] != $A_ID) { $Replace = Array ($Row["A_Title"], ($Row["A_Short"]) ? $Row["A_Short"]."
" : "", "index.php?A_ID=".$Row["A_ID"]); $CONTENT .= Preg_Replace ($Pattern, $Replace, $newsTemplate); } } $CONTENT .= '
'; } } } If ($itemRow["MenuType"] == 111) { $newsTemplate = fnReadFile ($TMP_PATH."news-short.html"); $Pattern = Array ("/\[NT\]/", "/\[NS\]/", "/\[NL\]/"); $CONTENT .= '
'; $CONTENT .= "

News

"; $Result = GetAllArticles (1, 0); While ($Row = MySQL_Fetch_Array ($Result)) { $Replace = Array ($Row["A_Title"], ($Row["A_Short"]) ? $Row["A_Short"]."
" : "", "index.php?A_ID=".$Row["A_ID"]); $CONTENT .= Preg_Replace ($Pattern, $Replace, $newsTemplate); } $CONTENT .= "

Press Releases

"; $Result = GetAllArticles (2, 0); While ($Row = MySQL_Fetch_Array ($Result)) { $Replace = Array (Date("d.m.Y", StrToTime($Row["A_Date"]))." - ".$Row["A_Title"], ($Row["A_Short"]) ? $Row["A_Short"]."
" : "", "index.php?A_ID=".$Row["A_ID"]); $CONTENT .= Preg_Replace ($Pattern, $Replace, $newsTemplate); } $CONTENT .= '
'; } $hhQuery = "SELECT * FROM ".$TBL["aa"]." WHERE T_ID=3 ORDER BY RAND()"; $hhResult = MySQL_Query ($hhQuery); $hhResult = MySQL_Query ($hhQuery); $Macro[] = "HEAD1"; $Macro[] = "HEAD2"; If ($hhRow = MySQL_Fetch_Array ($hhResult)) { $HEAD1 = StripSlashes ($hhRow["A_Title"]); $HEAD2 = StripSlashes ($hhRow["A_Short"]); } Else { $HEAD1 = "High Speed."; $HEAD2 = "The independent Swiss manufacturer
of high Speed, InP based optical components"; } MySQL_Free_Result ($hhResult); $Contents = ""; If ($TempFile) { While (!FEOF ($TempFile)) { $Contents .= FRead ($TempFile, FileSize ($TemplateFile)); } FClose ($TempFile); Include ("includes/_parser.inc.php"); Include ("includes/_block.inc.php"); $Macro[] = "HEADER2"; $CONTENT = Preg_Replace ("/[&]amp[;]([AOUaou])uml;/", "&\\1uml;", $CONTENT); $HEADER2 = GetPageHeader ($PageID); $Macro[] = "LOCATION"; $LOCATION = GetUserLocation ($PageID); $Macro[] = "SITEURL"; $SITEURL = $CFG["url"]."/"; $Macro[] = "TICKER"; $TICKER = ""; If ($_SESSION["sesvar"]["lang"] == "pt") { $TICKER = fnReadFile ("ticker-pt.html"); /* $Query = "SELECT * FROM ".$TBL["pages"]." WHERE PageID=21"; $Result = MySQL_Query ($Query); If ($Row = MySQL_Fetch_Array ($Result)) { $TICKER .= "
"; $TICKER .= "".StripSlashes ($Row["PageText"]).""; $TICKER .= "    "; $TICKER .= "
"; }*/ } Else { $TICKER = fnReadFile ("ticker-de.html"); } $Macro[] = "GOPAGEID"; $Macro[] = "BGCOLOR"; $BGCOLOR = getBGColor($PageID); $Macro[] = "BILD1"; $Macro[] = "BILD2"; $BILD1 = getBild ("Bild1", $PageID); $BILD2 = getBild ("Bild2", $PageID); If ($OfficeList) { $fName = "_map.inc.php"; $File = FOpen ($CFG["url"]."/".$TMP_PATH.$fName, "r"); If ($File) { While (!FEOF ($File)) { $CONTENT .= FRead ($File, 16384); } FClose ($File); } } ForEach ($Macro As $Num => $Value) { Array_Push ($Pattern, "/\[".$Value."\]/"); Array_Push ($Replace, $$Value); } $Contents = Preg_Replace ($Pattern, $Replace, $Contents); $Contents .= $hiddenDivs; } Print $Contents; ?>