now() ) ORDER BY link_nr"; $sql_data2 = mysql_query($query) or die(mysql_error() ); $page_m = file_get_contents('9.7 menu_line.html'); $box = ""; $i=1; while ($result2 = mysql_fetch_array( $sql_data2 )) { if ($i==1) { // menu title $page = str_replace("menu_title_text",$result2["title_".$lang],$page); } else { $line = str_replace("menu_title",$result2["title_".$lang],$page_m); $line = str_replace("key#",$i,$line); $line = str_replace("header_link",$_SERVER['PHP_SELF']."?p=".$result2["link_title_".$lang]."&l=".$lang,$line); $box = $box . $line ."\n"; } $i++; } /* $page = str_replace("menu_line",$box,$page); $page = str_replace("#home",$_SERVER['PHP_SELF']."?p=home&l=".$lang,$page); if ($lang == "de") { $page = str_replace("[DE][EN]","English",$page); $page = str_replace("#language",$_SERVER['PHP_SELF']."?p=". $result["title_en"] ."&l=en",$page); } else { $page = str_replace("[DE][EN]","Deutsch",$page); $page = str_replace("#language",$_SERVER['PHP_SELF']."?p=". $result["title_de"] ."&l=de",$page); } */ // check umlaute $page = str_replace("", "ä",$page); $page = str_replace("", "ö",$page); $page = str_replace("", "ü",$page); $page = str_replace("", "Ä",$page); $page = str_replace("", "Ö",$page); $page = str_replace("", "Ü",$page); echo $page; // end build menu if ($n!=1) { //echo $result['heading1_de']; $page = file_get_contents('6_sub2_page-bg.html'); $page = str_replace("picture_line","",$page); $page = str_replace("Heading 1","Sorry",$page); $page = str_replace("Heading 2","page not available",$page); $page = str_replace("1st 3 words","",$page); $page = str_replace("paragraph 1","",$page); // links $page = str_replace("Heading Links","",$page); for ($i=1;$i<=8;$i++) { $page = str_replace("Link ".$i,"",$page); $page = str_replace("Link_URL".$i,"",$page); } echo $page; } else { $type = $result['type']; $pic_line = file_get_contents('9.8 picture_line.html'); if ($type == "M") { // Main front page //echo $result['heading1_de']; $page = file_get_contents('4_main_page-bg.html'); // scope 1 $query = "SELECT `heading1_".$lang."`, `heading2_".$lang."` FROM `publishing_photo_pages` WHERE `title_".$lang."` = '".$result["home_scope1_title_".$lang]."'"; $sql_data2 = mysql_query($query) or die(mysql_error() ); if ($result2 = mysql_fetch_array( $sql_data2 )) { $page = str_replace("Scope 1",$result2["heading1_".$lang],$page); $page = str_replace("description scope 1",$result2["heading2_".$lang],$page); $page = str_replace("#scope1_ref",$_SERVER['PHP_SELF']."?p=".$result["home_scope1_title_".$lang]."&l=".$lang,$page); } // scope 2 $query = "SELECT `heading1_".$lang."`, `heading2_".$lang."` FROM `publishing_photo_pages` WHERE `title_".$lang."` = '".$result["home_scope2_title_".$lang]."'"; $sql_data2 = mysql_query($query) or die(mysql_error() ); if ($result2 = mysql_fetch_array( $sql_data2 )) { $page = str_replace("Scope 2",$result2["heading1_".$lang],$page); $page = str_replace("description scope 2",$result2["heading2_".$lang],$page); $page = str_replace("#scope2_ref",$_SERVER['PHP_SELF']."?p=".$result["home_scope2_title_".$lang]."&l=".$lang,$page); } // scope 3 $query = "SELECT `heading1_".$lang."`, `heading2_".$lang."` FROM `publishing_photo_pages` WHERE `title_".$lang."` = '".$result["home_scope3_title_".$lang]."'"; $sql_data2 = mysql_query($query) or die(mysql_error() ); if ($result2 = mysql_fetch_array( $sql_data2 )) { $page = str_replace("Scope 3",$result2["heading1_".$lang],$page); $page = str_replace("description scope 3",$result2["heading2_".$lang],$page); $page = str_replace("#scope3_ref",$_SERVER['PHP_SELF']."?p=".$result["home_scope3_title_".$lang]."&l=".$lang,$page); } $query = "SELECT `heading1_".$lang."`, `heading2_".$lang."`, `picture`, `title_".$lang."`, `3word_".$lang."`, `content_".$lang."`, `pic_title_".$lang."` FROM `publishing_photo_pages` WHERE topstory_nr IS NOT NULL ORDER BY topstory_nr"; $sql_data2 = mysql_query($query) or die(mysql_error() ); $n2 = mysql_num_rows($sql_data2); // update Latest Top Paragraphs $page_p = file_get_contents('9.0 front_paragraph.html'); $box = ""; while ($result2 = mysql_fetch_array( $sql_data2 )) { if ($box == "") { // 1st paragraph $page = str_replace("Top Heading 1",$result2['heading1_'.$lang],$page); $page = str_replace("Top Heading 2",$result2['heading2_'.$lang],$page); } if ($result2['picture']) { $line = str_replace("picture_line",$pic_line,$page_p); $line = str_replace("picture2",$result2['picture'],$line); $line = str_replace("pic_title",$result2['pic_title_'.$lang],$line); } else { $line = str_replace("picture_line","",$page_p); } $line = str_replace("First part (3 words)",$result2["3word_".$lang],$line); $line = str_replace("Top Description (370 characters)",substr($result2["content_".$lang], 0, PARAGRAPH_LEN),$line); $line = str_replace("JAVASCRIPT",$script ,$line); // check if javascript $line = str_replace("topstory_link",$_SERVER['PHP_SELF']."?p=".$result2["title_".$lang]."&l=".$lang,$line); if (strlen($result2["content_".$lang]) < PARAGRAPH_LEN) { $line = str_ireplace("more...","",$line); } $box = $box . $line ."\n"; } $page = str_replace("TopParagraph",$box,$page); } // end ($type == "M") if ($type == "2C") { //echo $result['heading1_de']; $page = file_get_contents('6_sub2_page-bg.html'); if ($result['picture']) { $page = str_replace("picture_line",$pic_line,$page); $page = str_replace("picture2",$result['picture'],$page); $page = str_replace("pic_title",$result['pic_title_'.$lang],$page); } else { $page = str_replace("picture_line","",$page); } $page = str_replace("Heading 1",$result["heading1_".$lang],$page); $page = str_replace("Heading 2",$result["heading2_".$lang],$page); $page = str_replace("1st 3 words",$result["3word_".$lang],$page); $content_str = $result["content_".$lang]; if ($result["content_uses_list"]) { // check list elements $content_str = str_ireplace("