204 lines
8.3 KiB
Plaintext
204 lines
8.3 KiB
Plaintext
<?php
|
|
include_once '../classes/lg-on_Smarty.class_subdir.php';
|
|
$smarty = new lgon_Smarty();
|
|
require_once("../config.inc.php");
|
|
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
|
require_once "../language/german.inc.php";
|
|
|
|
|
|
require("../bibellookup.php");
|
|
|
|
|
|
if(isset($_GET['stopmark'])){
|
|
$stopmark = $_GET['stopmark'];
|
|
}
|
|
|
|
function makeLink($a, $b, $c, $d, $e, $f, $g, $h, $lid)
|
|
{
|
|
|
|
$a=trim($a);
|
|
$b=trim($b);
|
|
$c=trim($c);
|
|
$d=trim($d);
|
|
$e=trim($e);
|
|
$f=trim($f);
|
|
$g=trim($g);
|
|
$h=trim($h);
|
|
|
|
# $d muss immer ein Komma haben, wenn danach noch was kommt
|
|
if($e != '' or $f != "" or $g != "" or $h != ""){
|
|
if($d == ''){
|
|
$d=',';
|
|
}
|
|
}
|
|
|
|
/*
|
|
echo "a: '$a'<br>
|
|
b: '$b'<br>
|
|
c: '$c'<br>
|
|
d: '$d'<br>
|
|
e: '$e'<br>
|
|
f: '$f'<br>
|
|
g: '$g'<br>
|
|
h: '$h'<br>
|
|
i: '$i'<br>
|
|
";
|
|
*/
|
|
|
|
if($a!=''){
|
|
$a=$a." ";
|
|
}
|
|
|
|
if($c!=''){
|
|
$c=" ".$c;
|
|
}
|
|
if($e!=''){
|
|
$e=" ".$e." ";
|
|
}
|
|
|
|
// Handling, wenn bei Bibelstelle Bindestrich oder Punkt enthalten sind
|
|
if($g == '-'){
|
|
#return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s\" target=\"_parent\" onmousemove=\"ttBibleShowN('%s');\" onmouseout=\"ttBibleHide();\">%s</a>", $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
|
|
#$wort="Römer 8,31-39";
|
|
$wort="$a$b$c$d$f$g$h";
|
|
$wort=trim($wort);
|
|
$wort="$wort|B|$lid";
|
|
|
|
return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s&stopmark=$f\" target=\"_parent\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450);\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
|
|
}elseif($g == '.'){
|
|
|
|
// Wenn Punkt, dann muss unterschieden werden, ob die Textstelle forlaufend ist
|
|
$next=$f+1;
|
|
if($h==$next){
|
|
// Beispiel Matthäus 1,1.2
|
|
// aus dem Punkt wird ein Bindestrich für bibleserver
|
|
$g1='-';
|
|
#return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s\" target=\"_parent\" onmousemove=\"ttBibleShowN('%s');\" onmouseout=\"ttBibleHide();\">%s</a>", $a.$b.$c.$d.$f.$g1.$h, $a.$b.$c.$d.$f.$g1.$h, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
|
|
$wort="$a$b$c$d$f$g1$h";
|
|
$wort=trim($wort);
|
|
$wort="$wort|B|$lid";
|
|
|
|
return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s&stopmark=$f\" target=\"_parent\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450);\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$d.$f.$g1.$h, $a.$b.$c.$d.$f.$g1.$h, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
}else{
|
|
// Beispiel Matthäus 1,1.3
|
|
// Da Vers 2 nicht aufgeführt ist, darf man nicht 1-3 machen
|
|
// Parameter $g und $h (.3) wird daher nicht im Link übergeben
|
|
#return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s\" target=\"_parent\" onmousemove=\"ttBibleShowN('%s');\" onmouseout=\"ttBibleHide();\">%s</a>", $a.$b.$c.$d.$f, $a.$b.$c.$d.$f, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
$wort="$a$b$c$d$f";
|
|
$wort=trim($wort);
|
|
$wort="$wort|B|$lid";
|
|
|
|
return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s&stopmark=$f\" target=\"_parent\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450);\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$d.$f, $a.$b.$c.$d.$f, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
}
|
|
|
|
}else{
|
|
// Alles Ohne Bindestrich und Punkt, daher auch kein $g und $h
|
|
#return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s\" target=\"_parent\" onmousemove=\"ttBibleShowN('%s');\" onmouseout=\"ttBibleHide();\">%s</a>", $a.$b.$c.$d.$f, $a.$b.$c.$d.$f, $a.$b.$c.$d.$e.$f);
|
|
|
|
$wort="$a$b$c$d$f$g$h";
|
|
$wort=trim($wort);
|
|
$wort="$wort|B|$lid";
|
|
return sprintf("<a class=\"biblelink\" href=\"bib_popup.php?wort=%s&stopmark=$f\" target=\"_parent\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450);\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
}
|
|
}
|
|
|
|
$anz_buch=$_GET['anz_buch'];
|
|
$buch=$_GET['buch'];
|
|
$kapitel=$_GET['kapitel'];
|
|
$vers_anf=$_GET['vers_anf'];
|
|
$vers_trenner=$_GET['vers_trenner'];
|
|
$vers_ende=$_GET['vers_ende'];
|
|
$vers_select=$_GET['vers_select'];
|
|
|
|
$db = dbconnect();
|
|
|
|
$result_anz = $db->query( "SELECT count(*) Anz
|
|
FROM bibel_lut_1984
|
|
WHERE anz_buch = '$anz_buch'
|
|
AND buch = '$buch'
|
|
AND kapitel ='$kapitel'
|
|
ORDER BY bid ASC
|
|
");
|
|
$row_anz = $result_anz->fetch_array();
|
|
|
|
if($row_anz[Anz] > 0){
|
|
$query = "SELECT bid, vers, inhalt
|
|
FROM bibel_lut_1984
|
|
WHERE anz_buch = '$anz_buch'
|
|
AND buch = '$buch'
|
|
AND kapitel ='$kapitel'
|
|
ORDER BY bid ASC
|
|
";
|
|
$result = $db->query( $query )
|
|
or die ("Cannot execute query");
|
|
|
|
|
|
|
|
// Schleife über alle Kapitel der Bibel
|
|
while ($row = $result->fetch_array()){
|
|
if($stopmark == trim($row[vers]) AND $stopmark != ''){
|
|
$ret_wort .="<a name='stopmark'></a>";
|
|
}
|
|
$ret_wort .= " <span class='verse'>$row[vers]</span> $row[inhalt]";
|
|
}
|
|
|
|
if($vers_trenner ==''){
|
|
if($vers_select!='N' AND $vers_anf != ''){
|
|
$ret_wort =str_replace ("<span class='verse'>$vers_anf</span>", "<span style='background-color:#D6DFF7'><span class='verse'>$vers_anf</span>" , $ret_wort);
|
|
}
|
|
|
|
$ende=$vers_anf+1;
|
|
$ret_wort =str_replace (" <span class='verse'>$ende", "</span> <span class='verse'>$ende" , $ret_wort);
|
|
}
|
|
|
|
if($vers_trenner =='-'){
|
|
if($vers_select!='N' AND $vers_anf != ''){
|
|
$ret_wort =str_replace ("<span class='verse'>$vers_anf</span>", "<span style='background-color:#D6DFF7'><span class='verse'>$vers_anf</span>" , $ret_wort);
|
|
|
|
}
|
|
|
|
$ende=$vers_ende+1;
|
|
$ret_wort =str_replace (" <span class='verse'>$ende", "</span> <span class='verse'>$ende" , $ret_wort);
|
|
}
|
|
|
|
|
|
}else{
|
|
$ret_wort ="Die Bibelstelle wurde nicht gefunden!";
|
|
}
|
|
|
|
$stelle="$anz_buch $buch $kapitel";
|
|
$ret_wort=preg_replace_callback("/([0-9][0-9]?\.\s*)?(Makkabäer|Johannes|Mose|Könige|Chronik|Korinther|Samuel|Thessalonicher|Timotheus|Petrus|Gebet Manasses|Stücke zu Daniel|Stücke zu Ester|Baruch|Weisheit|Judit|Judith|Sirach|Josua|Richter|Rut|Ruth|Esra|Nehemia|Esther|Ester|Hiob|Ijob|Psalm|Sprüche|Prediger|Hoheslied|Jesaja|Jeremia|Klagelieder|Hesekiel|Ezechiel|Daniel|Hosea|Joel|Amos|Tobias|Obadja|Jona|Micha|Nahum|Habakuk|Zefanja|Haggai|Sacharja|Maleachi|Matthäus|Markus|Lukas|Apostelgeschichte|Römer|Galater|Epheser|Philipper|Kolosser|Titus|Hebräer|Jakobus|Offenbarung|Philemon|Judas)(\s*[0-9]{1,3})(,\s*)?(\s*aus\s*|\s*Verse\s*|\s*Vers\s*)?([0-9]{0,3})?(\s*\-\s*|\s*\.\s*)?([0-9]{0,3})?/", function($m) use (&$stelle) { return makeLink($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], "$stelle");}, $ret_wort);
|
|
|
|
// Überschriften sollen linksbündig bleiben
|
|
preg_match_all('#<h1>(.+?)</h1>#su', $ret_wort, $ueberschrift1);
|
|
for($i=0;$i<count($ueberschrift1[1]);$i++){
|
|
$wort= $ueberschrift1[1];
|
|
$ret_wort =str_replace ("<h1>".$wort[$i]."</h1>", "<div align='left'><h1>$wort[$i]</h1></div>" , $ret_wort);
|
|
}
|
|
|
|
preg_match_all('#<h2>(.+?)</h2>#su', $ret_wort, $ueberschrift2);
|
|
for($i=0;$i<count($ueberschrift2[1]);$i++){
|
|
$wort= $ueberschrift2[1];
|
|
$ret_wort =str_replace ("<h2>".$wort[$i]."</h2>", "<div align='left'><h2>$wort[$i]</h2></div>" , $ret_wort);
|
|
}
|
|
|
|
preg_match_all('#<h3>(.+?)</h3>#su', $ret_wort, $ueberschrift3);
|
|
for($i=0;$i<count($ueberschrift3[1]);$i++){
|
|
$wort= $ueberschrift3[1];
|
|
$ret_wort =str_replace ("<h3>".$wort[$i]."</h3>", "<div align='left'><h3>$wort[$i]</h3></div>" , $ret_wort);
|
|
}
|
|
|
|
preg_match_all('#<h4>(.+?)</h4>#su', $ret_wort, $ueberschrift4);
|
|
for($i=0;$i<count($ueberschrift4[1]);$i++){
|
|
$wort= $ueberschrift4[1];
|
|
$ret_wort =str_replace ("<h4>".$wort[$i]."</h4>", "<div align='left'><h4>$wort[$i]</h4></div>" , $ret_wort);
|
|
}
|
|
|
|
|
|
$smarty->assign('bib_popup_body_wort', "$ret_wort");
|
|
|
|
$smarty->display("../templates/$template/$templatename");
|
|
?> |