getSQL("SELECT * FROM ".PREFIX."sysparam WHERE id=7"); if($wartung->getAt("value") == 1) { if(!isset($_COOKIE["disable_preview"])) { // Wenn Cookie nicht gesetzt ist, Fehlerseite anzeigen header("location:".SERVER_URL."/wartung.html"); } else { $tmp = $db->getSQL("SELECT * FROM ".PREFIX."disable_preview WHERE preview_code = '".$_COOKIE["disable_preview"]."'"); if($tmp->size != 1) { // Nutzer existiert nicht header("location:".SERVER_URL."/wartung.html"); } else { $log = $db->getSQL("SELECT * FROM ".PREFIX."disable_preview_log WHERE preview_id = '".$tmp->getAt("preview_id")."' ORDER BY date DESC"); $datum_heute = date("Y-m-d"); #echo $datum_heute; #echo "
".$log->getAt("date"); if($datum_heute != $log->getAt("date")) { #echo "
".$log->getAt("date"); // User IP und Datum eintragen $db->insertSQL("INSERT INTO ".PREFIX."disable_preview_log (preview_id, ip, date, time) VALUES ('".$tmp->getAt("preview_id")."', '".$_SERVER['REMOTE_ADDR']."', CURDATE(), CURTIME())"); } } } } if(isset($set_lang)) { if(!setcookie("save_lang", $save_lang, time()+24*3600)) { $onload = "onLoad=\"alert('Not able to set Cookie!');\""; } header("location:index.php?katID=".$katID); } //wenn keine Sprache, dann DE if(!isset($lang) AND !isset($save_lang)) { // darf nicht länger als zwei zeichen sein if(strlen($lang) != 2) { $lang = "pl"; include("lang/pl.php"); } } else { if(file_exists("lang/".$lang.".php")) { include("lang/".$lang.".php"); } else { include("lang/en.php"); } } //wenn Cookie, dann Sprache aus Cookie if(isset($save_lang)) { if(strlen($save_lang) != 2) { $lang = "pl"; } else { $lang = $save_lang; } } //Wenn keine KatID, dann Startseite if(!isset($katID) OR $katID=="") { $tmp = $db->getSQL("SELECT id FROM ".TAB_MENU." WHERE startseite=1"); $tmp->next(); $katID = $tmp->getAt("id"); } if(isset($suchbegriff) AND $suchbegriff!="") { //Template laden ------------------------------- $template = new Page("[page_title]", "../templates/suche.html"); $liste = $db->getSQL("SELECT LEFT(headline_$lang, 100) as headline, infotext_$lang as infotext, LEFT(inhalt_$lang, 500) as inhalt, kat_id, ROUND(MATCH (inhalt_$lang) AGAINST ('$suchbegriff'),2) as prozent FROM ".PREFIX."artikel WHERE (MATCH (inhalt_$lang) AGAINST ('$suchbegriff')) > 0 ORDER BY prozent DESC"); $template->whileReplaceSearch($liste, "suche"); } else { //Template für Seite laden ---------------------- if(isset($customer_login) OR isset($mfg_usr)) { //Alle Artikel anzeigen $artikel = $db->getSQL("SELECT a.id AS artikelID, headline AS headline, infobox_headline AS infobox_headline, infotext AS infotext, inhalt AS inhalt, infobox_inhalt AS infobox_inhalt, a.status, teaserbild_big, bildunterschrift, a.rang, template, a.id AS artikelID, a.kat_id, datum, t.file as layout, a.type as type, a.module_param1, a.module_param2, a.module_param3, a.module_param4, a.enable_print, IF(a.bildunterschrift = '' OR a.bildunterschrift = ' ', '', CONCAT('
',a.bildunterschrift,'
\n')) as layerbildunterschrift, IF(a.bildquelle = '' OR a.bildquelle = ' ', '', CONCAT('
© ',a.bildquelle,'
\n')) as bildquelle FROM (".PREFIX."artikel a) LEFT JOIN ".PREFIX."templates t ON a.layout = t.id WHERE a.kat_id = '$katID' AND a.lang='$lang' AND a.status='visible' AND ((NOW()>= a.date_on AND NOW()<= a.date_off) OR a.date_on='0000-00-00') AND (a.area='' OR a.area=' ') ORDER BY rang"); } else { //Nur öffentl.Artikel $artikel = $db->getSQL("SELECT a.id AS artikelID, headline AS headline, infobox_headline AS infobox_headline, infotext AS infotext, inhalt AS inhalt, infobox_inhalt AS infobox_inhalt, a.status, teaserbild_big, bildunterschrift, a.rang, template, a.id AS artikelID, a.kat_id, datum, t.file as layout, a.type as type, a.module_param1, a.module_param2, a.module_param3, a.module_param4, a.enable_print, IF(a.bildunterschrift = '' OR a.bildunterschrift = ' ', '', CONCAT('
',a.bildunterschrift,'
\n')) as layerbildunterschrift, IF(a.bildquelle = '' OR a.bildquelle = ' ', '', CONCAT('
© ',a.bildquelle,'
\n')) as bildquelle FROM (".PREFIX."artikel a, ".PREFIX."menu m) LEFT JOIN ".PREFIX."templates t ON a.layout = t.id WHERE a.status='visible' AND ((NOW()>= a.date_on AND NOW()<= a.date_off) OR a.date_on='0000-00-00') AND (a.area='' OR a.area=' ') AND m.customer_area=0 AND m.id='$katID' AND a.lang='$lang' AND a.kat_id = '$katID' ORDER BY rang"); } $main_template = $db->getSQL("SELECT t.file as file FROM (".PREFIX."templates t, ".PREFIX."menu m) LEFT JOIN ".PREFIX."menu_entry me ON me.menu_id = m.id AND me.lang='$lang' WHERE m.id='$katID' AND me.template = t.id"); //Festegelegtes Template laden $templ_file = $main_template->getAt("file"); //Prüfe auf Mobile Endgeäte #$mobile = mobile_device_detect(); if($mobile) { //lade Pagetemplate für mobile Geräte $templ_file="standard_page_mobile_tmpl.html"; } else { //Wenn leer, dann Basic-Template laden if($main_template->size==0 OR $templ_file=="") { $templ_file="standard_page_tmpl.html"; } } //Artikel ersetzen ------------------------------- $template = new Page("[page_title]", TEMPL_PATH.$templ_file); $template->ArtikelReplace($artikel, "artikel", 1, $katID); } //Hauptpunkt als Platzhalter ersetzen $pfad = get_Pfad($db, $katID, $lang); $pfad->it=1; $lang_list = $db->getSQL("SELECT code, sprache, id, IF(icon!='', icon, 'flag_blank.gif') as icon FROM ".PREFIX."languages l WHERE sprache_enable=1 AND frontend_enable=1"); $template->whileReplace($lang_list, "languages"); $template->replace("[CHOOSELANG]", LANGCHOOSELANG); $template->replace("[main_katID]", $pfad->getAt("id")); $template->replace("[main_kat]", $pfad->getAt("$lang")); $template->replace("[load_option]", $onload); $template->replace("[suchtext]", $suchtext); $template->replace("[menu]", get_menu($db, $katID, $lang, 0, $costumer_login, 0)); $template->replace("[menu_mobile]", get_menu_mobile($db, $katID, $lang, 0, $costumer_login, 0)); $template->replace("[SERVER_URL]", SERVER_URL); $template->replacePageTitle($PageTitle, "OFF", "ON", "OFF"); $template->replacePageDescription($PageDescription); $template->replaceLinkImage($LinkImage); $template->show(); ?>