776 lines
30 KiB
PHP
776 lines
30 KiB
PHP
<?php
|
|
|
|
|
|
function makeLink($a, $b, $c, $d, $e, $f, $g, $h, $lid, $link, $jahr)
|
|
{
|
|
|
|
|
|
$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>
|
|
";
|
|
*/
|
|
|
|
$b =str_replace ("Ruth", "Rut" , $b);
|
|
$b =str_replace ("Esther", "Ester" , $b);
|
|
$b =str_replace ("Judith", "Judit" , $b);
|
|
$b =str_replace ("Ezechiel", "Hesekiel" , $b);
|
|
$b =str_replace ("Ijob", "Hiob" , $b);
|
|
|
|
if($a!=''){
|
|
$a=$a." ";
|
|
}
|
|
|
|
if($c!=''){
|
|
$c=" ".$c;
|
|
}
|
|
if($e!=''){
|
|
$e=" ".$e." ";
|
|
}
|
|
|
|
// Handling, wenn bei Bibelstelle Bindestrich oder Punkt enthalten sind
|
|
if($g == '-'){
|
|
|
|
#$wort="Römer 8,31-39";
|
|
$wort="$a$b$c$d$f$g$h";
|
|
$wort=trim($wort);
|
|
|
|
|
|
if($link == 'lokal'){
|
|
$wort="$wort|T|$lid";
|
|
#target=\"_blank\"
|
|
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_1984.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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);
|
|
}else{
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_2017.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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($link == 'bibleserver'){
|
|
#target=\"_blank\"
|
|
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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);
|
|
}else{
|
|
$x = str_replace(',','%2C',$d);
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450 );\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$x.$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=intval($f)+1;
|
|
if($h==$next){
|
|
// Beispiel Matthäus 1,1.2
|
|
// aus dem Punkt wird ein Bindestrich für bibleserver
|
|
$g1='-';
|
|
|
|
$wort="$a$b$c$d$f$g1$h";
|
|
$wort=trim($wort);
|
|
|
|
|
|
if($link == 'lokal'){
|
|
$wort="$wort|T|$lid";
|
|
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_1984.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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{
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_2017.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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);
|
|
}
|
|
|
|
|
|
}elseif($link == 'bibleserver'){
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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{
|
|
$x = str_replace(',','%2C',$d);
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450 );\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$x.$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
|
|
|
|
$wort="$a$b$c$d$f";
|
|
$wort=trim($wort);
|
|
|
|
if($link == 'lokal'){
|
|
$wort="$wort|T|$lid";
|
|
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_1984.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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{
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_2017.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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);
|
|
}
|
|
|
|
|
|
}elseif($link == 'bibleserver'){
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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{
|
|
$x = str_replace(',','%2C',$d);
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450 );\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$x.$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
|
|
|
|
$wort="$a$b$c$d$f$g$h";
|
|
$wort=trim($wort);
|
|
|
|
if($link == 'lokal'){
|
|
$wort="$wort|T|$lid";
|
|
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_1984.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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);
|
|
}else{
|
|
return sprintf("<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_2017.php?wort=%s&stopmark=$f','Bibellink','640','480','center','front');\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', CAPTIONSIZE, '10px', 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($link == 'bibleserver'){
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if($jahr < 2019){
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" 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);
|
|
}else{
|
|
$x = str_replace(',','%2C',$d);
|
|
return sprintf("<a class=\"biblelink\" href=\"http://www.bibleserver.com/LUT/%s\" target=\"_blank\" onmouseover=\"return overlib('".getword("$wort")."', ABOVE, CAPTION,'%s', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 450 );\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$x.$f.$g.$h, $a.$b.$c.$d.$f.$g.$h, $a.$b.$c.$d.$e.$f.$g.$h);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function refill($a,$b,$c,$d,$e,$f,$g,$h,$i)
|
|
{
|
|
// Funktion die aus Textstellenkurzeichen die vollständige Textstelle erstellt
|
|
|
|
/*
|
|
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>
|
|
";
|
|
*/
|
|
|
|
switch($c)
|
|
{
|
|
case'Sir':
|
|
$c= 'Sirach';
|
|
break;
|
|
case'Mo':
|
|
$c= 'Mose';
|
|
break;
|
|
case'Jos':
|
|
$c= 'Josua';
|
|
break;
|
|
case'Ri':
|
|
$c= 'Richter';
|
|
break;
|
|
case'Rut':
|
|
$c= 'Rut';
|
|
break;
|
|
case'Sam':
|
|
$c= 'Samuel';
|
|
break;
|
|
case'Kön':
|
|
$c= 'Könige';
|
|
break;
|
|
case'Chr':
|
|
$c= 'Chronik';
|
|
break;
|
|
case'Esr':
|
|
$c= 'Esra';
|
|
break;
|
|
case'Neh':
|
|
$c= 'Nehemia';
|
|
break;
|
|
case'Est':
|
|
$c= 'Esther';
|
|
break;
|
|
case'Hiob':
|
|
$c= 'Hiob';
|
|
break;
|
|
case'Hi':
|
|
$c= 'Hiob';
|
|
break;
|
|
case'Ps':
|
|
$c= 'Psalm';
|
|
break;
|
|
case'Spr':
|
|
$c= 'Sprüche';
|
|
break;
|
|
case'Pred':
|
|
$c= 'Prediger';
|
|
break;
|
|
case'Hld':
|
|
$c= 'Hoheslied';
|
|
break;
|
|
case'Jes':
|
|
$c= 'Jesaja';
|
|
break;
|
|
case'Jer':
|
|
$c= 'Jeremia';
|
|
break;
|
|
case'Kla':
|
|
$c= 'Klagelieder';
|
|
break;
|
|
case'Klgl':
|
|
$c= 'Klagelieder';
|
|
break;
|
|
case'Hes':
|
|
$c= 'Hesekiel';
|
|
break;
|
|
case'St zu Dan':
|
|
$c= 'Stücke zu Daniel';
|
|
break;
|
|
case'Dan':
|
|
$c= 'Daniel';
|
|
break;
|
|
case'Hos':
|
|
$c= 'Hosea';
|
|
break;
|
|
case'Joel':
|
|
$c= 'Joel';
|
|
break;
|
|
case'Am':
|
|
$c= 'Amos';
|
|
break;
|
|
case'Obd':
|
|
$c= 'Obadja';
|
|
break;
|
|
case'Jona':
|
|
$c= 'Jona';
|
|
break;
|
|
case'Mi':
|
|
$c= 'Micha';
|
|
break;
|
|
case'Nah':
|
|
$c= 'Nahum';
|
|
break;
|
|
case'Hab':
|
|
$c= 'Habakuk';
|
|
break;
|
|
case'Zef':
|
|
$c= 'Zefanja';
|
|
break;
|
|
case'Hag':
|
|
$c= 'Haggai';
|
|
break;
|
|
case'Sach':
|
|
$c= 'Sacharja';
|
|
break;
|
|
case'Weish':
|
|
$c= 'Weisheit';
|
|
break;
|
|
case'Mal':
|
|
$c= 'Maleachi';
|
|
break;
|
|
case'Tob':
|
|
$c= 'Tobias';
|
|
break;
|
|
case'Mt':
|
|
$c= 'Matthäus';
|
|
break;
|
|
case'Mk':
|
|
$c= 'Markus';
|
|
break;
|
|
case'Lk':
|
|
$c= 'Lukas';
|
|
break;
|
|
case'Luk':
|
|
$c= 'Lukas';
|
|
break;
|
|
case'Joh':
|
|
$c= 'Johannes';
|
|
break;
|
|
case'Jh':
|
|
$c= 'Johannes';
|
|
break;
|
|
case'Apg':
|
|
$c= 'Apostelgeschichte';
|
|
break;
|
|
case'Röm':
|
|
$c= 'Römer';
|
|
break;
|
|
case'Rom':
|
|
$c= 'Römer';
|
|
break;
|
|
case'Kor':
|
|
$c= 'Korinther';
|
|
break;
|
|
case'Gal':
|
|
$c= 'Galater';
|
|
break;
|
|
case'Eph':
|
|
$c= 'Epheser';
|
|
break;
|
|
case'Phil':
|
|
$c= 'Philipper';
|
|
break;
|
|
case'Kol':
|
|
$c= 'Kolosser';
|
|
break;
|
|
case'Thess':
|
|
$c= 'Thessalonicher';
|
|
break;
|
|
case'Tim':
|
|
$c= 'Timotheus';
|
|
break;
|
|
case'Tit':
|
|
$c= 'Titus';
|
|
break;
|
|
case'Phlm':
|
|
$c= 'Philemon';
|
|
break;
|
|
case'Ptr':
|
|
$c= 'Petrus';
|
|
break;
|
|
case'Petr':
|
|
$c= 'Petrus';
|
|
break;
|
|
case'Hbr':
|
|
$c= 'Hebräer';
|
|
break;
|
|
case'Hebr':
|
|
$c= 'Hebräer';
|
|
break;
|
|
case'Jak':
|
|
$c= 'Jakobus';
|
|
break;
|
|
case'Jk':
|
|
$c= 'Jakobus';
|
|
break;
|
|
case'Jud':
|
|
$c= 'Judas';
|
|
break;
|
|
case'Offb':
|
|
$c= 'Offenbarung';
|
|
break;
|
|
case'Off':
|
|
$c= 'Offenbarung';
|
|
break;
|
|
}
|
|
|
|
# $a=trim($a);
|
|
if($a !=""){$a=trim($a).".";} // nach der Zahl noch der Punkt hinzufügen
|
|
if($a != ""){$a=trim($a)." ";$b="";} // nach dem Punkt ein Leerzeichen, B kann dann entfallen
|
|
if($d ==""){$d=" ";}
|
|
if($g !=""){$g=" ".$g." ";} // --> "1. Johannes 3,aus3" wird "1. Johannes 3, aus 3"
|
|
|
|
|
|
|
|
return trim($a.$b.$c.$d.$e.$f.$g.$h);
|
|
}
|
|
|
|
|
|
// Herausfinden des Verses, damit bei bibelpopup an den Anker "Stopmark" gesprungen wird
|
|
function splitword_stopmark($a,$b,$c,$d,$e,$f,$g,$h){
|
|
return "$d";
|
|
}
|
|
|
|
|
|
function makepopup($art, $weid, $eid, $thema_kurz, $template1){
|
|
$db = dbconnect();
|
|
if($art=="lueexeg"){
|
|
|
|
$result_exeg1a = $db->query("SELECT count(*) Anz
|
|
FROM wort_exegese
|
|
WHERE verweis='$weid'
|
|
AND beschreibung != ''");
|
|
$row_exeg1a = $result_exeg1a->fetch_array();
|
|
|
|
if($row_exeg1a['Anz']>1){
|
|
$query_exeg2 = "SELECT weid, wort, beschreibung, verweis
|
|
FROM wort_exegese
|
|
WHERE verweis='$weid'
|
|
AND beschreibung != ''";
|
|
$result_exeg2 = $db->query( $query_exeg2)
|
|
or die ("Cannot execute query: result_exeg2");
|
|
|
|
$zaehler_exeg=1;
|
|
$exegese = "<table width=100%>";
|
|
|
|
|
|
while ($row_exeg2 = $result_exeg2->fetch_array()){
|
|
$exegese .= "<tr>
|
|
<td valign=top>
|
|
<font style=\"font-size:8pt\">$zaehler_exeg</font>
|
|
</td>
|
|
<td valign=top>
|
|
<font style=\"font-size:8pt\">$row_exeg2[beschreibung]</font>
|
|
</td>
|
|
</tr>";
|
|
$zaehler_exeg=$zaehler_exeg+1;
|
|
}
|
|
|
|
$exegese .= "</table>";
|
|
|
|
}else{
|
|
$result_exeg3 = $db->query("SELECT beschreibung
|
|
FROM wort_exegese
|
|
WHERE weid='$weid'");
|
|
$row_exeg3 = $result_exeg3->fetch_array();
|
|
$exegese = $row_exeg3['beschreibung'];
|
|
}
|
|
|
|
$exegese=preg_replace("/\n/", "", $exegese);
|
|
$exegese=preg_replace("/\r/", "", $exegese);
|
|
$exegese= preg_replace('/\s{2,}/sm',' ',$exegese,PREG_SET_ORDER); //Mehr als zwei leerzeichen entfernen
|
|
$exegese = str_replace (array('"'), array("""), $exegese);
|
|
$exegese = str_replace (array("'"), array("\'"), $exegese);
|
|
|
|
$result_lue1 = $db->query("SELECT thema
|
|
FROM lue_quelle
|
|
WHERE eid='$eid'");
|
|
$row_lue1 = $result_lue1->fetch_array();
|
|
$thema = $row_lue1['thema'];
|
|
|
|
$repl="<a class=alue href='lue_ansicht.php?eid=$eid' title='Publikation: $thema' target='_parent'>$thema_kurz</a><a onmouseover=\"return overlib('$exegese', ABOVE, CAPTION,'Begriffserklärung: $thema_kurz', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 300);\" onmouseout='nd();'><sup><img title = 'Begriffserklärung' border='0' height=10 src='templates/$template1/images/i.png'></sup></a>";
|
|
}
|
|
|
|
|
|
if($art=="exeg"){
|
|
|
|
$result_exeg1a = $db->query("SELECT count(*) Anz
|
|
FROM wort_exegese
|
|
WHERE verweis='$weid'
|
|
AND beschreibung != ''");
|
|
$row_exeg1a = $result_exeg1a->fetch_array();
|
|
|
|
|
|
if($row_exeg1a['Anz']>1){
|
|
$query_exeg2 = "SELECT weid, wort, beschreibung, verweis
|
|
FROM wort_exegese
|
|
WHERE verweis='$weid'
|
|
AND beschreibung != ''";
|
|
|
|
$result_exeg2 = $db->query( $query_exeg2)
|
|
or die ("Cannot execute query: result_exeg2");
|
|
|
|
$zaehler_exeg=1;
|
|
$exegese = "<table width=100%>";
|
|
|
|
while ($row_exeg2 = $result_exeg2->fetch_array()){
|
|
$exegese .= "<tr>
|
|
<td valign=top>
|
|
<font style=\"font-size:8pt\">$zaehler_exeg</font>
|
|
</td>
|
|
<td valign=top>
|
|
<font style=\"font-size:8pt\">$row_exeg2[beschreibung]</font>
|
|
</td>
|
|
</tr>";
|
|
$zaehler_exeg=$zaehler_exeg+1;
|
|
}
|
|
|
|
$exegese .= "</table>";
|
|
|
|
}else{
|
|
$result_exeg1 = $db->query("SELECT beschreibung
|
|
FROM wort_exegese
|
|
WHERE weid='$weid'");
|
|
$row_exeg1 = $result_exeg1->fetch_array();
|
|
$exegese = $row_exeg1['beschreibung'];
|
|
}
|
|
|
|
$exegese=preg_replace("/\n/", "", $exegese);
|
|
$exegese=preg_replace("/\r/", "", $exegese);
|
|
$exegese= preg_replace('/\s{2,}/sm',' ',$exegese,PREG_SET_ORDER); //Mehr als zwei leerzeichen entfernen
|
|
$exegese = str_replace (array('"'), array("""), $exegese);
|
|
$exegese = str_replace (array("'"), array("\'"), $exegese);
|
|
|
|
$repl="$thema_kurz<a onmouseover=\"return overlib('$exegese', ABOVE, CAPTION,'Begriffserklärung: $thema_kurz', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 300);\" onmouseout='nd();'><sup><img title = 'Begriffserklärung' border='0' height=10 src='templates/$template1/images/i.png'></sup></a>";
|
|
}
|
|
|
|
if($art=="lue"){
|
|
$result_lue1 = $db->query("SELECT thema
|
|
FROM lue_quelle
|
|
WHERE eid='$eid'");
|
|
$row_lue1 = $result_lue1->fetch_array();
|
|
|
|
|
|
|
|
#echo "$row_lue1[thema] --> $eid<br>\n";
|
|
$thema = $row_lue1['thema'];
|
|
$repl="<a class=alue href='lue_ansicht.php?eid=$eid' title='Publikation: $thema' target='_parent'>$thema_kurz</a>";
|
|
#$repl ="";
|
|
}
|
|
|
|
return $repl;
|
|
}
|
|
|
|
function replace_text_links($suche, $repl, $text){
|
|
$dom = new DOMDocument;
|
|
@$dom->loadHtml(mb_convert_encoding($text, 'HTML-ENTITIES', "UTF-8"));
|
|
$dom->recover = true;
|
|
$dom->strictErrorChecking = false;
|
|
$dom->formatOutput = TRUE;
|
|
|
|
$xpath = new DOMXPath($dom);
|
|
$nodes = $xpath->query("//text()[contains(., \"$suche\")]");
|
|
|
|
foreach($xpath->query("//text()[not(ancestor::a)]") as $node){
|
|
|
|
$replaced = str_replace($suche, $repl, $node->wholeText);
|
|
$newNode = $dom->createDocumentFragment();
|
|
$newNode->appendXML($replaced);
|
|
$node->parentNode->replaceChild($newNode, $node);
|
|
|
|
}
|
|
#echo $dom->saveXML($dom->documentElement);
|
|
|
|
# http://stackoverflow.com/questions/4044812/regex-domdocument-match-and-replace-text-not-in-a-link
|
|
return mb_substr($dom->saveXML($xpath->query('//body')->item(0)), 6, -7, "UTF-8");
|
|
}
|
|
|
|
function get_array_key($search, $array)
|
|
{
|
|
# funktion durchsucht eine Mehrdimensionales Array(thema2) ob ein Suchbegriff darin enthalten ist und liefert ggf. key zurück
|
|
foreach($array as $key => $values)
|
|
{
|
|
if(in_array($search, $values))
|
|
{
|
|
return $key;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function makeKNK_FA($a, $b)
|
|
{
|
|
$db = dbconnect();
|
|
$db->query("SET NAMES 'utf8'");
|
|
|
|
$result_knk_fa = $db->query("SELECT number, question, answer, reference, description, description2, headline
|
|
FROM knk_fa
|
|
WHERE number ='$b'
|
|
");
|
|
$row_knk_fa = $result_knk_fa->fetch_array();
|
|
|
|
$ueberschrift = str_replace (array("—", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '"'), array("-", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '\"'), "Frage ".$row_knk_fa['number']);
|
|
$question= str_replace (array("'"), array("&\#39;"), $row_knk_fa['question']);
|
|
$answer= str_replace (array("'"), array("&\#39;"), $row_knk_fa['answer']);
|
|
$reference= str_replace (array("'"), array("&\#39;"), $row_knk_fa['reference']);
|
|
$description= str_replace (array("'"), array("&\#39;"), $row_knk_fa['description']);
|
|
$description2= str_replace (array("'"), array("&\#39;"), $row_knk_fa['description2']);
|
|
|
|
$max=1000;
|
|
$origin=strlen($answer);
|
|
$answer = substr($answer.' ' , 0 , $max + 1);
|
|
$answer = substr($answer , 0 , strrpos ($answer , ' '));
|
|
|
|
$answer = strip_tags($answer, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
if($max<=$origin){
|
|
# Funktioniert manchmal nicht, da nicht zwischen Wort getrennt wird [strrpos ($text , ' ')] sondern immer nach einem
|
|
# vollständigen Wort. Das Merkmal ist: Wenn ein Leerzeichen kommt, dann trennen.
|
|
# Es kann passieren, dass es dann nach dem Wort span [<span class=\'verse\'>] getrennt wird,
|
|
# Dann sieht es so aus: <span<nobr> <b>[...]</b></nobr>, weil nach dem Span ein Leerzeichen kommt.
|
|
# Der Tag wird dann nicht dargestellt.
|
|
# Zur Minderung: $text = strip_tags($text, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$answer.="<nobr> <b>[...]</b></nobr>";
|
|
}
|
|
$kapitel = $b;
|
|
$kap=$row_knk_fa['headline'];
|
|
$body = "<table><tr><td class=knkfa><b>$question</b><td></tr><tr><td class=knkfa>$answer<td></tr>";
|
|
if($reference != ''){
|
|
$body_ref = "<tr><td class=knkfa>$reference</td></tr>";
|
|
$body = $body.$body_ref;
|
|
}
|
|
if($description != ''){
|
|
$body_desc = "<tr><td class=knkfa bgcolor=#ffffff>$description</td></tr>";
|
|
$body = $body.$body_desc;
|
|
}
|
|
if($description2 != ''){
|
|
$body_desc2 = "<tr><td class=knkfa bgcolor=#ffffff>$description2</td></tr>";
|
|
$body = $body.$body_desc2;
|
|
}
|
|
$body_footer .= "</table>";
|
|
$body = $body.$body_footer;
|
|
|
|
return sprintf("<a href=\"katechismus_fa.php?katechismus_knk=$kap&katechismus_kapitel=$b\" target=_parent class=\"biblelink\" onmouseover=\"return overlib('$body', ABOVE, CAPTION,'$ueberschrift', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 600);\" onmouseout=\"nd();\">%s</a>", $a.' '.$b, $a.' '.$b);
|
|
}
|
|
|
|
function makeKNK($a, $b)
|
|
{
|
|
$db = dbconnect();
|
|
$result_knk = $db->query("SELECT ueberschrift, text
|
|
FROM knk
|
|
WHERE knk ='$b'
|
|
");
|
|
$row_knk = $result_knk->fetch_array();
|
|
|
|
$ueberschrift = str_replace (array("—", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '"'), array("-", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '\"'), $row_knk['ueberschrift']);
|
|
$text= str_replace (array("'"), array("&\#39;"), $row_knk['text']);
|
|
|
|
$max=1000;
|
|
$origin=strlen($text);
|
|
$text = substr($text.' ' , 0 , $max + 1);
|
|
$text = substr($text , 0 , strrpos ($text , ' '));
|
|
|
|
$text = strip_tags($text, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
if($max<=$origin){
|
|
# Funktioniert manchmal nicht, da nicht zwischen Wort getrennt wird [strrpos ($text , ' ')] sondern immer nach einem
|
|
# vollständigen Wort. Das Merkmal ist: Wenn ein Leerzeichen kommt, dann trennen.
|
|
# Es kann passieren, dass es dann nach dem Wort span [<span class=\'verse\'>] getrennt wird,
|
|
# Dann sieht es so aus: <span<nobr> <b>[...]</b></nobr>, weil nach dem Span ein Leerzeichen kommt.
|
|
# Der Tag wird dann nicht dargestellt.
|
|
# Zur Minderung: $text = strip_tags($text, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$text.="<nobr> <b>[...]</b></nobr>";
|
|
}
|
|
$kapitel = explode('.', $b);
|
|
$kap=$kapitel[0];
|
|
return sprintf("<a href=\"katechismus.php?katechismus_knk=$kap&katechismus_kapitel=$b\" target=_parent class=\"biblelink\" onmouseover=\"return overlib('$text', ABOVE, CAPTION,'Katechismus: $ueberschrift', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 600);\" onmouseout=\"nd();\">%s</a>", $a.' '.$b, $a.' '.$b);
|
|
}
|
|
|
|
|
|
function makeKNK2($a, $b, $c, $d, $e, $f)
|
|
{
|
|
|
|
$db = dbconnect();
|
|
$result_knk = $db->query("SELECT ueberschrift, text
|
|
FROM knk
|
|
WHERE knk ='$d'
|
|
");
|
|
$row_knk = $result_knk->fetch_array();
|
|
|
|
|
|
$ueberschrift = str_replace (array("—", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '"'), array("-", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '\"'), $row_knk['ueberschrift']);
|
|
$text= str_replace (array("'"), array("&\#39;"), $row_knk['text']);
|
|
|
|
$max=1000;
|
|
$origin=strlen($text);
|
|
$text = substr($text.' ' , 0 , $max + 1);
|
|
$text = substr($text , 0 , strrpos ($text , ' '));
|
|
|
|
$text = strip_tags($text, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
if($max<=$origin){
|
|
# Funktioniert manchmal nicht, da nicht zwischen Wort getrennt wird [strrpos ($text , ' ')] sondern immer nach einem
|
|
# vollständigen Wort. Das Merkmal ist: Wenn ein Leerzeichen kommt, dann trennen.
|
|
# Es kann passieren, dass es dann nach dem Wort span [<span class=\'verse\'>] getrennt wird,
|
|
# Dann sieht es so aus: <span<nobr> <b>[...]</b></nobr>, weil nach dem Span ein Leerzeichen kommt.
|
|
# Der Tag wird dann nicht dargestellt.
|
|
# Zur Minderung: $text = strip_tags($text, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$text.="<nobr> <b>[...]</b></nobr>";
|
|
}
|
|
$kapitel = explode('.', $d);
|
|
$kap=$kapitel[0];
|
|
if(strlen($row_knk['text'])>0){
|
|
if($a == ' '){
|
|
#bei Konstellationen (5.3.2.3; 5.3.2.4) ist $a entweder ( oder Leerzeichen. Für saubere Darstellung des Links, ohne dass das Leerzeichen Teil des Links ist, kommt $a bei der Ausgabe weg und das Leerzeichen vor dem Link
|
|
return sprintf(" <a href=\"katechismus.php?katechismus_knk=$kap&katechismus_kapitel=$d\" target=_parent class=\"biblelink\" onmouseover=\"return overlib('$text', ABOVE , CAPTION,'Katechismus: $ueberschrift', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 600);\" onmouseout=\"nd();\">%s</a>", $b.$c.$d.$f, $b.$c.$d.$f);
|
|
}else{
|
|
return sprintf("<a href=\"katechismus.php?katechismus_knk=$kap&katechismus_kapitel=$d\" target=_parent class=\"biblelink\" onmouseover=\"return overlib('$text', ABOVE , CAPTION,'Katechismus: $ueberschrift', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 600);\" onmouseout=\"nd();\">%s</a>", $a.$b.$c.$d.$f, $a.$b.$c.$d.$f);
|
|
}
|
|
}else{
|
|
return $a.$b.$c.$d.$f;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
# Wurde nur für die Erstellung der Textvarianten reference_lokal bzw reference_bibleserver aus func_make_reference_fa.php verwendet
|
|
function makeKNK_FA2($b)
|
|
{
|
|
$db = dbconnect();
|
|
$db->query("SET NAMES 'utf8'");
|
|
|
|
$result_knk_fa = $db->query("SELECT number, question, answer, reference, description, description2, headline
|
|
FROM knk_fa
|
|
WHERE number ='$b'
|
|
");
|
|
$row_knk_fa = $result_knk_fa->fetch_array();
|
|
|
|
$ueberschrift = str_replace (array("—", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '"'), array("-", "ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", '\"'), "Frage ".$row_knk_fa['number']);
|
|
$question= str_replace (array("'"), array("&\#39;"), $row_knk_fa['question']);
|
|
$answer= str_replace (array("'"), array("&\#39;"), $row_knk_fa['answer']);
|
|
$reference= str_replace (array("'"), array("&\#39;"), $row_knk_fa['reference']);
|
|
$description= str_replace (array("'"), array("&\#39;"), $row_knk_fa['description']);
|
|
$description2= str_replace (array("'"), array("&\#39;"), $row_knk_fa['description2']);
|
|
|
|
$max=1000;
|
|
$origin=strlen($answer);
|
|
$answer = substr($answer.' ' , 0 , $max + 1);
|
|
$answer = substr($answer , 0 , strrpos ($answer , ' '));
|
|
|
|
$answer = strip_tags($answer, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
if($max<=$origin){
|
|
# Funktioniert manchmal nicht, da nicht zwischen Wort getrennt wird [strrpos ($text , ' ')] sondern immer nach einem
|
|
# vollständigen Wort. Das Merkmal ist: Wenn ein Leerzeichen kommt, dann trennen.
|
|
# Es kann passieren, dass es dann nach dem Wort span [<span class=\'verse\'>] getrennt wird,
|
|
# Dann sieht es so aus: <span<nobr> <b>[...]</b></nobr>, weil nach dem Span ein Leerzeichen kommt.
|
|
# Der Tag wird dann nicht dargestellt.
|
|
# Zur Minderung: $text = strip_tags($text, '<nobr><em>,<span>,<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$answer.="<nobr> <b>[...]</b></nobr>";
|
|
}
|
|
$kapitel = $b;
|
|
$kap=$row_knk_fa['headline'];
|
|
$body = "<table><tr><td class=knkfa><b>$question</b><td></tr><tr><td class=knkfa>$answer<td></tr>";
|
|
if($reference != ''){
|
|
$body_ref = "<tr><td class=knkfa>$reference</td></tr>";
|
|
$body = $body.$body_ref;
|
|
}
|
|
if($description != ''){
|
|
$body_desc = "<tr><td class=knkfa bgcolor=#ffffff>$description</td></tr>";
|
|
$body = $body.$body_desc;
|
|
}
|
|
if($description2 != ''){
|
|
$body_desc2 = "<tr><td class=knkfa bgcolor=#ffffff>$description2</td></tr>";
|
|
$body = $body.$body_desc2;
|
|
}
|
|
$body_footer .= "</table>";
|
|
$body = $body.$body_footer;
|
|
|
|
return sprintf("<a href=\"katechismus_fa.php?katechismus_knk=$kap&katechismus_kapitel=$b\" target=_parent class=\"biblelink\" onmouseover=\"return overlib('$body', ABOVE, CAPTION,'$ueberschrift', CAPTIONSIZE, '10px', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 600);\" onmouseout=\"nd();\">%s</a>", $b, $b);
|
|
}
|
|
|
|
?>
|