'; $db_name = ''; $db_user = ''; $db_passwort = ''; $dbs = new mysqli( $db_server, $db_user, $db_passwort, $db_name ); if ($dbs->connect_errno) { echo "Failed to connect to MySQL: (" . $dbs->connect_errno . ") " . $dbs->connect_error; } error_reporting(0); /* Define function */ function datum($date) { $datum = substr($date, 8, 2) . '.' . substr($date, 5, 2) . '.' . substr($date, 0, 4); return $datum; } /* Analyse query string */ parse_str($_SERVER['QUERY_STRING'], $values); if ($values["number"]) { $sql = "SELECT ID FROM `" . $language . "_rss` WHERE ID='" . $values["number"] . "'"; $error = $dbs->query($sql); $id = ($hold = $error->fetch_assoc()) ? $hold['ID'] : 0; } else { $id = 0; } /* Read global texts */ $sql = "SELECT ident, text FROM `" . $language . "_texts` WHERE ID=0"; $rest = $dbs->query($sql); while($texts = $rest->fetch_assoc()) { $text0[$texts['ident']] = $texts['text']; } /* Set cookies */ $css = $_POST["css"]; if ($css) { setcookie('rl_style', $css, time()+31536000, '/', $domain, '0'); header("Location: $path_relil_de/rl_rss.php?number=" . $values["number"]); } header('Content-Type: text/html; charset=iso-8859-1'); /* Output */ $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= "<>"; /* Read data */ $sql = "SELECT * FROM `" . $language . "_rss` WHERE ID='" . $id . "'"; $result = $dbs->query($sql); $row = $result->fetch_assoc(); $values["number"] = $id; $name = 0; $hier = 0; /* Build head*/ $str .= '<>"; $str .= "" . $row['title'] . "<>"; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; /* Read cookies */ $css = $_COOKIE["rl_style"]; /* Determine CSS-file */ if (!$css) $css = "rl_inwhiteandred"; $str .= '<>'; $str .= "<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= "<>"; /* Determine size */ $row['width'] = floor($row['width']); $row['height'] = floor($row['height']); $width = 300; $height = 50; /* Build body */ $str .= '<>

' . $text0["Title"] . '

<>
<>
    <>'; /* Read levels for menu */ $sql = "SELECT * FROM `" . $language . "_level1` WHERE ID<>13 ORDER BY ID"; $l = 1; $rsult[$l] = $dbs->query($sql); while($sub[$l] = $rsult[$l]->fetch_assoc()) { /* Build menu as unordered list */ $site++; $lname[$site] = $sub[$l]['name']; $lsite[$site] = $sub[$l]['page']; $lhier[$site] = $l; if ($sub[$l]['page']) { $hier++; $lpage[$hier] = $sub[$l]['page']; $str .= '
  • ' . $sub[$l]['name'] . "<>"; if ($id == $sub[$l]['page']) { $level[$l] = $sub[$l]['page']; $link[$l] = $sub[$l]['name']; $lid = $hier; } } else { $str .= "
  • " . $sub[$l]['name'] . "<>"; } $sql = "SELECT * FROM `" . $language . "_level2` WHERE SUBSTR(ID, 1, 2)='" . $sub[$l]['ID'] . "' ORDER BY name"; $l = 2; $rsult[$l] = $dbs->query($sql); $stmt = mysqli_prepare($dbs, $sql); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); if (mysqli_stmt_num_rows($stmt) > 0) { $str .= "
      <>"; while($sub[$l] = $rsult[$l]->fetch_assoc()) { $site++; $lname[$site] = $sub[$l]['name']; $lsite[$site] = $sub[$l]['page']; $lhier[$site] = $l; if ($sub[$l]['page']) { $hier++; $lpage[$hier] = $sub[$l]['page']; $str .= '
    • ' . $sub[$l]['name'] . "<>"; if ($id == $sub[$l]['page']) { for ($x=1;$x<=$l;$x++) { $level[$x] = $sub[$x]['page']; $link[$x] = $sub[$x]['name']; } $lid = $hier; } } else { $name++; $str .= '
    • ' . $sub[$l]['name'] . "<>"; } $sql = "SELECT * FROM `" . $language . "_level3` WHERE SUBSTR(ID, 1, 5)='" . $sub[$l]['ID'] . "' ORDER BY name"; $l = 3; $rsult[$l] = $dbs->query($sql); $stmt = mysqli_prepare($dbs, $sql); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); if (mysqli_stmt_num_rows($stmt) > 0) { $str .= "
        <>"; while($sub[$l] = $rsult[$l]->fetch_assoc()) { $site++; $lname[$site] = $sub[$l]['name']; $lsite[$site] = $sub[$l]['page']; $lhier[$site] = $l; if ($sub[$l]['page']) { $hier++; $lpage[$hier] = $sub[$l]['page']; $str .= '
      • ' . $sub[$l]['name'] . "<>"; if ($id == $sub[$l]['page']) { for ($x=1;$x<=$l;$x++) { $level[$x] = $sub[$x]['page']; $link[$x] = $sub[$x]['name']; } $lid = $hier; } } else { $name++; $str .= '
      • ' . $sub[$l]['name'] . "<>"; } $sql = "SELECT * FROM `" . $language . "_level4` WHERE SUBSTR(ID, 1, 8)='" . $sub[$l]['ID'] . "' ORDER BY name"; $l = 4; $rsult[$l] = $dbs->query($sql); $stmt = mysqli_prepare($dbs, $sql); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); if (mysqli_stmt_num_rows($stmt) > 0) { $str .= "
          <>"; while($sub[$l] = $rsult[$l]->fetch_assoc()) { $site++; $lname[$site] = $sub[$l]['name']; $lsite[$site] = $sub[$l]['page']; $lhier[$site] = $l; if ($sub[$l]['page']) { $hier++; $lpage[$hier] = $sub[$l]['page']; $str .= '
        • ' . $sub[$l]['name'] . "
        • <>"; if ($id == $sub[$l]['page']) { for ($x=1;$x<=$l;$x++) { $level[$x] = $sub[$x]['page']; $link[$x] = $sub[$x]['name']; } $lid = $hier; } } else { $name++; $str .= '
        • ' . $sub[$l]['name'] . "
        • <>"; } } $str .= "
        <>"; } $l = 3; $str .= "
      • <>"; } $str .= "
      <>"; } $l = 2; $str .= "
    • <>"; } $str .= "
    <>"; } $l = 1; $str .= "
  • <>"; } $str .= '
  • ' . $text0["Politics"] . "
  • <>"; $str .= '
  • ' . $text0["Private"] . "
  • <>"; /* Consider language */ if ($language == "de") { $sql = "SELECT ID FROM `en_rss` WHERE ID='" . $id . "'"; $ref = $dbs->query($sql); $stmt = mysqli_prepare($dbs, $sql); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); if (mysqli_stmt_num_rows($stmt) <> 0) { $refs = $ref->fetch_assoc(); if ($localhost) $str .= '
  • English
  • <>'; else $str .= '
  • English
  • <>'; } } else { $sql = "SELECT ID FROM `de_rss` WHERE ID='" . $id . "'"; $ref = $dbs->query($sql); $stmt = mysqli_prepare($dbs, $sql); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); if (mysqli_stmt_num_rows($stmt) <> 0) { $refs = $ref->fetch_assoc(); if ($localhost) $str .= '
  • Deutsch
  • <>'; else $str .= '
  • Deutsch
  • <>'; } } $str .= '
<><>
'; /* Build main part */ $str .= '<>




'; $sql = "SELECT COUNT(*) AS count FROM `" . $language . "_rss`"; $resuc = $dbs->query($sql); $count = $resuc->fetch_assoc(); switch($id) { case 0 : case 1 : $str .= '' . $text0["Next"] . "

"; break; case ($count['count'] - 1) : $str .= '' . $text0["Previous"] . "

"; break; default: $str .= '' . $text0["Previous"] . ' | ' . $text0["Next"] . "

"; break; } if ($row['audio']) { if ($row['picture']) $str .= '<>



' . $row['name'] . '

'; if (substr($row['audio'], strlen($row['audio']) - 5, 1) == "s") $str .= '<>

' . $row['title'] . '

<>

' . $text0["MP3-version melody"] . "
" . '' . $text0["MP3-version text"] . "

<>" . $row['text']; else $str .= '<>

' . $row['title'] . '

<>

' . $text0["MP3-version"] . "

<>" . $row['text']; } else { if ($row['picture']) $str .= '<>

' . $row['name'] . '

'; $str .= "<>

" . $row['title'] . "

<>" . $row['text']; } $str .= "<>

© " . datum($row['date']) . " by Boris Haase

"; /* Build footer */ $height = 16; $str .= '<>
'; $str .= '<>
'; $str .= '<>
'; $str .= '<>'; $str .= '<><>
<>
'; $str .= '<>
<>
'; /* Consider css */ if ($css == "rl_inwhiteandred") { $str .= '<>'; $str .= '<><>
<>
'; } else { $str .= '<>'; $str .= '<><><>'; } $str .= '<>


'; $width = 44; $str .= '<>Valid XHTML 1.0 • '; $str .= '' . $text0["Privacy Policy"] . " • "; $str .= '' . $text0["Disclaimer"] . " • "; $str .= '' . $text0["Imprint"] . " • "; $str .= '' . $text0["PDF version"] . " • "; $str .= '' . $text0["Questionnaire text"] . " • "; $str .= '' . $text0["Bibliography text"] . " • "; $str .= '' . $text0["Subject catalogue text"] . " • "; $str .= '' . $text0["Definitions text"] . " • "; $str .= '' . $text0["PHP-Code"] . " • "; $str .= '' . $text0["Sitemap"] . " • "; $str .= '' . $text0["RSS-Feed"] . " • "; $str .= '' . $text0["MWiki"] . " • "; $str .= '' . $text0["Top"] . "







<>"; /* Create record for statistics */ if ($id > 0) { $sql = "SELECT title FROM `" . $language . "_stat` WHERE title='RSS " . $values["number"] . "' AND ip='" . $_SERVER['REMOTE_ADDR'] . "' AND date LIKE '" . date("Y-m-d") . "%'"; $result = $dbs->query($sql); $stmt = mysqli_prepare($dbs, $sql); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); if (mysqli_stmt_num_rows($stmt) == 0) { $sql = "INSERT INTO `" . $language . "_stat` (title, referer, ip, date) VALUES ('RSS " . $values["number"] . "', '" . $_SERVER['HTTP_REFERER'] . "', '" . $_SERVER['REMOTE_ADDR'] . "', '" . date("Y-m-d H:i:s") . "')"; $query = $dbs->query($sql); } } /* Output */ $output = explode("<>", $str . ""); foreach($output as $out) { echo $out . "\n"; } echo ""; ?>