- ', $org); $org = preg_replace('/{.*}/', '', $org); $org = preg_replace('/\[.*\]/', '', $org); if ($q) { $q = split(' ', $q); foreach ($q AS $key => $value) { $org = preg_replace('/('.$value.')/i', '\\1', $org); } } $org = trim($org); return $org; } if ($_GET['action'] == 'red') { header('Location: /search_'.urlencode($_GET['q']).'.html'); exit(); } elseif ($_GET['action'] == 'show') { dbconnect(); $id = $_GET['id']; $q1 = " SELECT de, en FROM dict WHERE id = '$id' ;"; $exec1 = mysql_query($q1) or die(mysql_error()); $dbvar1 = mysql_fetch_array($exec1); $de = crop($dbvar1['de']); $en = crop($dbvar1['en']); $q_de = crop($dbvar1['de'],'',1); $q_en = crop($dbvar1['en'],'',1); if ($_GET['l'] == 'de') { $title = 'Deutsch: '.$q_de.' - '; $q = $q_de; $hl = 'Deutsch: '.$de; } else { $title = 'Englisch: '.$q_en.' - '; $q = $q_en; $hl = 'Englisch: '.$en; } include('./header.inc.php'); include('./headline.tmpl.php'); include('./table_top.tmpl.php'); $bgcolor = 'ccccff'; include('./table.tmpl.php'); include('./websearch.tmpl.php'); include('./footer.inc.php'); } elseif ($_GET['action'] == 'search') { dbconnect(); $q = stripslashes($_GET['q']); $q1 = " SELECT de, en, MATCH (de) AGAINST ('$q') AS score FROM dict WHERE MATCH (de) AGAINST ('$q') ORDER BY de ASC ;"; // ORDER BY // date DESC // HAVING // score > 6.5 $exec1 = mysql_query($q1) or die(mysql_error()); $num1 = mysql_num_rows($exec1); $q2 = " SELECT de, en, MATCH (en) AGAINST ('$q') AS score FROM dict WHERE MATCH (en) AGAINST ('$q') ORDER BY en ASC ;"; // ORDER BY // date DESC // HAVING // score > 6.5 $exec2 = mysql_query($q2) or die(mysql_error()); $num2 = mysql_num_rows($exec2); $title = $q.' - '; include('./header.inc.php'); if ($num1 == 0 && $num2 == 0) { include('./no_entry.tmpl.php'); } else { include('./table_top.tmpl.php'); $s = true; while ($dbvar1 = mysql_fetch_array($exec1)) { $de = crop($dbvar1['de'], $q); $en = crop($dbvar1['en'], $q); if ($s) { $bgcolor = 'ccccff'; $s = false; } else { $bgcolor = 'ffffff'; $s = true; } include('./table.tmpl.php'); } $s = true; while ($dbvar2 = mysql_fetch_array($exec2)) { $de = crop($dbvar2['de'], $q); $en = crop($dbvar2['en'], $q); if ($s) { $bgcolor = 'ccccff'; $s = false; } else { $bgcolor = 'ffffff'; $s = true; } include('./table.tmpl.php'); } } include('./websearch.tmpl.php'); include('./footer.inc.php'); } elseif ($_GET['action'] == 'sitemap') { $letter = $_GET['letter']; $start = $_GET['start']; $lang = $_GET['l']; $limit = ($start-1)*100; include('./header.inc.php'); if ($letter) { dbconnect(); if ($lang == 'de') { $hl = 'Sitemap Deutsch / Englisch - Buchstabe: '.strtoupper($letter); $q1 = " SELECT id, de as word FROM dict WHERE de LIKE '$letter%' ORDER BY word ASC "; $exec1 = mysql_query($q1) or die(mysql_error()); $num = mysql_num_rows($exec1); $q1 .= ' LIMIT '.$limit.',100'; $exec1 = mysql_query($q1) or die(mysql_error()); } else { $hl = 'Sitemap Englisch / Deutsch - Buchstabe: '.strtoupper($letter); $q1 = " SELECT id, en as word FROM dict WHERE en LIKE '$letter%' ORDER BY word ASC "; $exec1 = mysql_query($q1) or die(mysql_error()); $num = mysql_num_rows($exec1); $q1 .= ' LIMIT '.$limit.',100'; $exec1 = mysql_query($q1) or die(mysql_error()); } include('./sitemap_top.tmpl.php'); while ($dbvar1 = mysql_fetch_array($exec1)) { $word = crop($dbvar1['word'], '', 1); $id = $dbvar1['id']; include('./sitemap_entry.tmpl.php'); } include('./sitemap_bottom.tmpl.php'); $pages = round((($num - 100) / 100) + 1.5); $page = $start; for ($i=1;$i<=$pages;++$i) { include('./sitemap_pagelink.tmpl.php'); if ($i != $pages) echo ' | '; } include('./sitemap_nav.tmpl.php'); } else { include('./sitemap.tmpl.php'); } include('./footer.inc.php'); } elseif ($_GET['action'] == 'impressum') { include('./header.inc.php'); include('./impressum.tmpl.php'); include('./footer.inc.php'); } else { include('./header.inc.php'); include('./index.tmpl.php'); include('./footer.inc.php'); } ?>