'; $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('bh_style', $css, time()+31536000, '/', $domain, '0'); header("Location: $path_boris_haase_de/bh_rss.php?number=" . $values["number"]); } header('Content-Type: text/html; charset=iso-8859-1'); /* Build 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; $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["bh_style"]; /* Determine CSS-file */ if (!$css) $css = "bh_inwhiteandblack"; $str .= '<>'; $str .= "<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= '<>'; $str .= "<>"; /* Determine size */ $row['width'] = floor($row['width']); $row['height'] = floor($row['height']); $width = 450; $height = 50; /* Build body */ $str .= '<>

' . $text0["Title"] . '

<>
<>
    <>'; /* Read ciphers for menu */ $sql = "SELECT text FROM `" . $language . "_sites` WHERE ID=1"; $result = $dbs->query($sql); $page = $result->fetch_assoc(); $ciphers = explode(';', $page['text']); /* Build menu as unordered list */ foreach($ciphers as $cipher) { $sql = "SELECT page, numbers FROM `" . $language . "_sites` WHERE ID=" . $cipher; $result = $dbs->query($sql); $pages = $result->fetch_assoc(); $str .= '
  • ' . $pages['page'] . ""; if ($pages['numbers']) { $str .= "<>
      <>"; $subs[$cipher] = explode(';', $pages['numbers']); foreach($subs[$cipher] as $submenu) { $sql = "SELECT page FROM `" . $language . "_sites` WHERE ID=" . $submenu; $reult = $dbs->query($sql); $sub = $reult->fetch_assoc(); $str .= '
    • ' . $sub['page'] . "
    • <>"; } $str .= "
    <>"; } $str .= "
  • <>"; } $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 : $str .= '' . $text0["Next"] . "

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

"; else $str .= '' . $text0["Previous"] . "

"; break; case 1 : $str .= '' . $text0["Next"] . "

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

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

' . $row['name'] . '

'; $str .= "<>

" . $row['title'] . "

<>" . $row['text'] . "<>

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

"; /* Build footer */ $height = 16; $str .= '<>
'; $str .= '<>
'; $str .= '<>
'; $str .= '<>'; $str .= '<><>
<>
'; $str .= '<>
<>
'; /* Consider css */ if ($css == "bh_inwhiteandblack") { $background = "000000"; $font = "FFFFFF"; $str .= '<>'; $str .= '<><>
<>
'; } else { $background = "FFFFFF"; $font = "000000"; $str .= '<>'; $str .= '<><><>'; } $str .= '<>


'; $width = 44; $str .= '<>Valid XHTML 1.0 • '; $str .= '' . $text0["Disclaimer"] . " • "; $str .= 'mail@boris-haase.de • '; $str .= '' . $text0["PDF version"] . " • "; $str .= '' . $text0["Bibliography text"] . " • "; $str .= '' . $text0["Subject catalogue text"] . " • "; $str .= '' . $text0["Definitions text"] . " • "; $str .= '' . $text0["Statistics text"] . " • "; $str .= '' . $text0["PHP-Code"] . " • "; $str .= '' . $text0["RSS-Feed"] . " • "; $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 */ if ($localhost) { $str = str_replace("https://www.boris-haase.de", ".." , $str); } if ($css <> "bh_inwhiteandblack") $str = str_replace("_wb.gif", "_bw.gif", $str); $output = explode("<>", $str . ""); foreach($output as $out) { echo $out . "\n"; } echo ""; ?>