$val) { $$key = $val; } require(dirname(__FILE__) . '/../db_mysql.inc'); if(!isset($rid)) $rid = 2; $cfg_db_mandant = sprintf('%04d', $this->site->getAgent()->getExpId()); $db4 = new DB_RTK; # $sql = "select * from psites where mandant = '$cfg_db_mandant'"; # $db4->query($sql); # $db4->next_record(); # $head_t = $db4->f("meta_title"); # $head_d = $db4->f("meta_descr"); # $head_k = $db4->f("meta_keyw"); $cfg_db_gruppe = $gruppe; if (strlen($cfg_db_gruppe) == 0) { die('Unable to proceed'); } $sql = "SELECT * FROM rubriken WHERE id_rubriken=$rid"; $db4->query($sql); $db4->next_record(); $rubrik = $db4->f("rubrik"); $sql = "SELECT * FROM reisen,reisen_groups WHERE reisen.id_reisen = reisen_groups.reise_id AND reisen_groups.group_id = $cfg_db_gruppe AND reisen.valid=1 AND reisen.rubrik_id=$rid ORDER BY preis1"; $db4->query($sql); $count = $db4->num_rows(); $suchergebnis = ($count == 1) ? "1 Datensatz gefunden" : "$count Datensätze gefunden"; $filecontent = getfile(dirname(__FILE__) . "/../gruppe/".$cfg_db_gruppe."/html/reisen/reisen2.htm"); $filecontent = restore("SUCHERGEBNIS", $suchergebnis, $filecontent); $filecontent = restore("HEAD_D", $head_d, $filecontent); $filecontent = restore("HEAD_K", $head_k, $filecontent); $filecontent = restore("HEAD_T", $head_t, $filecontent); $filecontent = restore("rubrik", $rubrik, $filecontent); $filecontent = restore("rid", $rid, $filecontent); $row_clean = getRow("row", $filecontent); $i=0; while ($db4->next_record() ) { $row = $row_clean; $title = htmlentities($db4->f("title")); $text = special_html(cutresult($db4->f("text"),310)); $preis1 = $db4->f("waehrung")." ".$db4->f("preis1"); $id_reisen = $db4->f("id_reisen"); $img = "/reisen/images/thumb_".$db4->f("id_reisen").".jpg"; $row = restore_row("title", $title, $row); $row = restore_row("text", $text, $row); $row = restore_row("preis1", $preis1, $row); $row = restore_row("id_reisen", $id_reisen, $row); $row = restore_row("img", $img, $row); $row = restore_row("I", $i, $row); $row = restore_row("waehrung", "", $row); $row_all .= $row; $i++; } $filecontent = canceRow("row", $row_all, $filecontent); $filecontent = str_replace('reise_detail.html', 'reise_detail.php', $filecontent); $filecontent = str_replace('/gruppe/', '/_rt/gruppe/', $filecontent); $filecontent = str_replace('/reisen/', '/_rt/reisen/', $filecontent); $filecontent = str_replace('(.*)\n\s*/sm"; preg_match_all($reg, $filecontent, $match); return $match[1][0]; } function canceRow($placer, $row_all, $filecontent) { $reg = "/(.*)\n\s*/sm"; return preg_replace( $reg, $row_all, $filecontent); } function getfile ($file) { return join ("", file ($file)); } function restore($platz, $value, $filecontent) { $filecontent = eregi_replace("{".$platz."}",$value,$filecontent); return $filecontent; } function cutresult($string,$length) { $a = chop(substr($string,0,$length)); if(strlen($string)>$length) $b = sprintf("%s...",$a); else $b = $a; return $b; } function restore_row($platz, $value, $row) { $row = eregi_replace("{".$platz."}",$value,$row); return $row; } function special_html($html, $tags = "a|b|i|u|br|p|ul|ol|li|font|blink|span|table|tr|td|img") { $html = ereg_replace("(<|]*>|>)", '@!@!@!XtagxtagXtagxtagX\1\2\3@!@!@!', $html); $arr = split("@!@!@!", $html); while(list($key, $value) = each ($arr)) { if(ereg("^XtagxtagXtagxtagX", $value)) { $arr_opt[] = ereg_replace("XtagxtagXtagxtagX","", $value); } else { $arr_opt[] = nl2br(htmlentities($value)); } } $html = implode("", $arr_opt); return $html; } ?>