0 &&!is_numeric($katID)) { die(); } //Prüfen, ob nur die Shopseiten abgerufen werden if($katID==78 || $katID==100 || $katID==101 || $katID==54) { $blind=1; } else { header("location:index.php?katID=78"); } 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)) { $lang = "de"; } //wenn Cookie, dann Sprache aus Cookie if(isset($save_lang)) { $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(DOMAIN_1_NAME." [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 headline AS headline, infotext AS infotext, inhalt AS inhalt, a.status, rang, template, a.id, 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 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 headline AS headline, infotext AS infotext, inhalt AS inhalt, a.status, rang, template, a.id, 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 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"); //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(DOMAIN_1_NAME." [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"); $template->whileReplace($lang_list, "languages"); $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 ("[SERVER_URL]", SERVER_URL); $template->show(); ?>