Initial commit
This commit is contained in:
146
test2.php
Normal file
146
test2.php
Normal file
@ -0,0 +1,146 @@
|
||||
<?php
|
||||
require_once("config.inc.php");
|
||||
function makepopup($art, $weid, $eid, $thema_kurz, $template1){
|
||||
echo "
|
||||
art -> $art|<br>
|
||||
weid -> $weid|<br>
|
||||
eid -> $eid|<br>
|
||||
thema_kurz -> $thema_kurz|<br>
|
||||
template1 -> $template1|<hr>
|
||||
";
|
||||
|
||||
$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='Lehre und Erkenntnis: $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='Lehre und Erkenntnis: $thema' target='_parent'>$thema_kurz</a>";
|
||||
#$repl ="";
|
||||
}
|
||||
|
||||
return $repl;
|
||||
}
|
||||
|
||||
$botschaft = "Die Erscheinung __exeg-38-0__ in Wort und Sakrament erfassen.";
|
||||
$exeg_wort = "Christi";
|
||||
$template = "standard";
|
||||
|
||||
$botschaft=preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function ($m) use (&$exeg_wort,&$template) { return makepopup($m[1], $m[2], $m[3], "$exeg_wort", "$template");}, $botschaft);
|
||||
echo $botschaft;
|
||||
?>
|
Reference in New Issue
Block a user