Host="$dbhost"; $db->Database="$dbname"; $db->User="$dbuser"; $db->Password="$dbpswd"; if (isset($id) == 0) exit; else { // Holen der Infos für die Seite $db->query("SELECT * FROM $dbtable WHERE dbid = '$id' AND news_table <> ''"); if ($db->nf() == 1) { $db->next_record(); $file = "output/".$db->f('news_file'); $htmlcode = loadfile($file); // $dbtable = $db->f('news_table'); $dbtable = "news"; $randspalte = $db->f('randspalte'); $pic_actual = $db->f('pic_actual'); $charset = ""; // Query erstellen $mon = date('m'); $day = date('d'); if (isset($news) == 0) { // Damit auch der Monat mit den letzten News erscheint, wenn die Schlufis ihre DB mal wieder nicht gepflegt haben... $monatskorrektur = -1; $jahreskorrektur = 0; $query = "SELECT * FROM $dbtable WHERE datum >= '$year-$mon-01' AND datum <= '$year-$mon-$day' AND language = '".addslashes($id)."' AND freigabe = '1' ORDER BY dbid DESC"; $db->query($query); while (($db->nf() == 0) AND ($monatskorrektur < 12) AND $yearflag == true ) { $monatskorrektur++; $mon--; if ($mon == 0) { $mon = 12; $year--; } $query = "SELECT * FROM $dbtable WHERE datum >= '$year-$mon-01' AND datum <= '$year-$mon-31' AND language = '".addslashes($id)."' AND freigabe = '1' ORDER BY datum DESC, dbid DESC"; $db->query($query); //echo "\n"; } } else $db->query("SELECT * FROM $dbtable WHERE dbid = '$news' AND freigabe = '1' LIMIT 1"); $num = $db->nf(); if ($num != 0) { for ($i = 0; $i < $num; $i++) { $db->next_record(); $titel = stripslashes($db->f('titel')); if ($db->f('dbid') > 2340) { $text = stripslashes(nl2br($db->f('htmlcode'))); $text = bbcodes($text); } else { $text = stripslashes($db->f('htmlcode')); } $iddatum = makegerdate($db->f('datum')); if ($db->f('link') <> "") $tlink = "name=\"anker".$db->f('dbid')."\" href=\"".$db->f('link')."\""; else $tlink = "name=\"anker".$db->f('dbid')."\""; $output .= "

\n$titel\n

\n

\n".$text."
[$iddatum]

\n\n"; } } // Archiv-Liste der News ohne Text $aktjahr = "$aktjahr-01-01"; if (empty($news) == true) { if ($year != date('Y')) $mon = 12; else $mon--; $lastmonth = $year."-".$mon."-31"; $query = "SELECT dbid, titel, datum FROM $dbtable WHERE (datum >= '$year-01-01' AND datum <= '$lastmonth') AND language = '".addslashes($id)."' AND freigabe = '1' ORDER BY datum DESC, dbid DESC"; $db->query($query); // Anzahl der Reihen, die selektiert wurden $num = $db->nf(); if ($num != 0) { for ($i = 0; $i < $num; $i++) { $number = $num - $i; $db->next_record(); $titel = stripslashes($db->f('titel')); $iddatum = makegerdate($db->f('datum')); $outlist .= "

\n

  • \nf('dbid')."&id=$id\">$titel [$iddatum]
     
  • \n\n"; } } if ($year != date('Y')) $output = ""; } // Link auf vergangenes Jahr $lastyear = $year - 1; $db->query("SELECT dbid FROM $dbtable WHERE datum >= '$lastyear-01-01' AND datum <= '$lastyear-12-31' AND language = '".addslashes($id)."' AND freigabe = '1'"); $num = $db->nf(); if ($num != 0) { $htmlcode = ereg_replace("", "$lastyear", $htmlcode); $htmlcode = preg_replace("/.*?/siU", "", $htmlcode); } else { $htmlcode = preg_replace("/.*?/siU", "", $htmlcode); } } } if (isset($news) != 0) { $htmlcode = preg_replace("/<\!-- Link -->.*?<\!-- \/Link -->/siU", "", $htmlcode); $htmlcode = preg_replace("/.*?/siU", "", $htmlcode); $htmlcode = preg_replace("/<\!-- Archivlink -->.*?<\/a>/siU", "", $htmlcode); } $htmlcode = eregi_replace("", $charset, $htmlcode); $htmlcode = ereg_replace("", $date, $htmlcode); $htmlcode = ereg_replace("", $output, $htmlcode); $htmlcode = ereg_replace("", $outlist, $htmlcode); if ($randspalte != '') { $randspalte = loadfile("/w3ns/juripro/layout/$randspalte"); $htmlcode = eregi_replace("", $randspalte, $htmlcode); } // Zu guter letzt mein liebster SSI-Parser in der Version 1.1 preg_match_all("//i", $htmlcode, $matches); for ($i=0;$i 1) $ssioutput = implode("\"", $dummy); // Ersetzen $htmlcode = str_replace($matches[0][$i], $ssioutput, $htmlcode); } echo $htmlcode; ?>