1190 lines
56 KiB
PHP
1190 lines
56 KiB
PHP
<?php
|
|
# Fuer debugging
|
|
#error_reporting(E_ALL);
|
|
#ini_set('display_errors', 1);
|
|
#echo __LINE__."<br>";
|
|
session_start();
|
|
#error_reporting(E_ALL);
|
|
#ini_set('display_errors', 1);
|
|
|
|
require_once("config/ftpanbindung.php"); // fügt die FTP-anbindung ein
|
|
|
|
include_once 'classes/lg-on_Smarty.class.php';
|
|
$smarty = new lgon_Smarty();
|
|
#$smarty->caching = true;
|
|
require_once("config.inc.php");
|
|
require_once("func_rollenrechte.php");
|
|
$templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html";
|
|
require_once "language/german.inc.php";
|
|
require_once("func_highlight.php");
|
|
require_once("func_ansicht.php");
|
|
|
|
|
|
if (isset($_GET['action'])) {
|
|
$action = $_GET['action'];
|
|
} else {
|
|
$action = '';
|
|
}
|
|
|
|
if ($action == '') {
|
|
|
|
$lid = $_GET['lid'];
|
|
|
|
$sid = session_id();
|
|
$datum = date("Y-m-d H:i:s");
|
|
$result = $db->query("INSERT INTO historie (vaid, datum, session_id, art, art_id) VALUES ('$user_vaid;', '$datum', '$sid', 'L', '$lid')");
|
|
|
|
$suchart = @$_GET['suchart'];
|
|
$fadeout = @$_GET['fadeout'];
|
|
|
|
|
|
if (isset($_GET['inhalt_hig'])) {
|
|
$inhalt_hig = stripslashes($_GET['inhalt_hig']);
|
|
$inhalt_hig = unserialize("$inhalt_hig");
|
|
}
|
|
|
|
$verweis = @stripslashes($_GET['verweis']);
|
|
$verweis = @unserialize($verweis);
|
|
|
|
|
|
|
|
if ($user_admin == "") {
|
|
require("index.php");
|
|
exit;
|
|
} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
|
|
|
|
$db = dbconnect();
|
|
$result = $db->query("SELECT lid, txt_anz_buch, txt_buch, txt_kapitel, txt_vers, Ueberschrift, thema, unterthema, textstelle, replace(replace(replace(textstelle, ' aus ', ''), 'vgl',''), ' ','') textstelle2, vorwort, botschaft, textwort, inhalt, zusammenfassung, kontext, DATE_Format(datum, '%d.%m.%Y') as datum, kid, ukid, DATE_Format(datum, '%d') tag, DATE_Format(datum, '%m') monat, DATE_Format(datum, '%Y') jahr, ukid, DATE_Format(datum, '%Y-%m-%d')AS datum_berechnung, stapgd
|
|
FROM quelle
|
|
WHERE lid='$lid'");
|
|
$row = $result->fetch_array();
|
|
|
|
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if ($row['jahr'] < 2019) {
|
|
# Lutherbibel 1984
|
|
require_once("bibellookup_1984.php");
|
|
$bibelversion = "1984";
|
|
} else {
|
|
# Lutherbibel 2017
|
|
require_once("bibellookup_2017.php");
|
|
$bibelversion = "2017";
|
|
}
|
|
|
|
|
|
$result_link_bibel = $db->query("SELECT bibellink
|
|
FROM profil
|
|
WHERE user='$user_admin'");
|
|
$row_link_bibel = $result_link_bibel->fetch_array();
|
|
|
|
$result_count = $db->query("SELECT count(*) Anz
|
|
FROM quelle_cache
|
|
WHERE link = '$row_link_bibel[bibellink]'
|
|
AND lid='$lid'");
|
|
$row_cache_count = $result_count->fetch_array();
|
|
|
|
$ueberschrift = html_entity_decode($row['Ueberschrift']);
|
|
|
|
# typografische Anführungszeichen im UTF8 Format Korrekt darstellen
|
|
$ueberschrift = preg_replace("/\x{0084}/u", "„", $ueberschrift);
|
|
$ueberschrift = preg_replace("/\x{0093}/u", "“", $ueberschrift);
|
|
|
|
|
|
|
|
$wochentag = date("l", mktime(0, 0, 0, $row['monat'], $row['tag'], $row['jahr']));
|
|
|
|
$result_gd = $db->query("SELECT wgd FROM profil WHERE user = '$user_admin'");
|
|
$row_gd = $result_gd->fetch_array();
|
|
|
|
if ($wochentag == 'Wednesday' AND $row_gd['wgd'] != '0' AND ($row['ukid'] == '1')) { // Hintergrund kommt aus der wort_wahl.php. Es gibt einige Gottesdienste, die auf einen Mittwoch fallen (1. vom Monat) aber kein Tag addiert werden darf, daher: Wann muss ein Tag (faktor) addiert werden, generell, wenn Wochengottesdienst, wenn Faktor im Profil != 0 und wenn unterkategorie 1 (GD normal) ist. Bei allen anderen Gottesdiensten bleibt der Mittwoch erhalten. (Buß und Bettag ist Mittwoch, Erntedank bleibt auch am 1. des Monats)
|
|
$datum_wt = date("d.m.Y", mktime(0, 0, 0, $row['monat'], $row['tag'] + $row_gd['wgd'], $row['jahr']));
|
|
$wochentag = date("l", mktime(0, 0, 0, $row['monat'], $row['tag'] + $row_gd['wgd'], $row['jahr']));
|
|
} else {
|
|
$wochentag = date("l", mktime(0, 0, 0, $row['monat'], $row['tag'], $row['jahr']));
|
|
$datum_wt = date("d.m.Y", mktime(0, 0, 0, $row['monat'], $row['tag'], $row['jahr']));
|
|
}
|
|
|
|
|
|
|
|
switch ($wochentag) {
|
|
case 'Sunday':
|
|
$wochentag_wt = "So.";
|
|
break;
|
|
case 'Monday':
|
|
$wochentag_wt = "Mo.";
|
|
break;
|
|
case 'Tuesday':
|
|
$wochentag_wt = "Di.";
|
|
break;
|
|
case 'Wednesday':
|
|
$wochentag_wt = "Mi.";
|
|
break;
|
|
case 'Thursday':
|
|
$wochentag_wt = "Do.";
|
|
break;
|
|
case 'Friday':
|
|
$wochentag_wt = "Fr.";
|
|
break;
|
|
case 'Saturday':
|
|
$wochentag_wt = "Sa.";
|
|
break;
|
|
}
|
|
|
|
|
|
$result1 = $db->query("SELECT bezeichnung
|
|
FROM kategorie
|
|
WHERE kid='$row[kid]'");
|
|
$row1 = $result1->fetch_array();
|
|
$cat_text = $row1['bezeichnung'];
|
|
|
|
$result2 = $db->query("SELECT bezeichnung
|
|
FROM unterkategorie
|
|
WHERE ukid='$row[ukid]'");
|
|
$row2 = $result2->fetch_array();
|
|
|
|
$result3 = $db->query("SELECT bezeichnung
|
|
FROM thema
|
|
WHERE tid='$row[thema]'");
|
|
$row3 = $result3->fetch_array();
|
|
$thema_head = $row3['bezeichnung'];
|
|
|
|
$result4 = $db->query("SELECT bezeichnung
|
|
FROM unterthema
|
|
WHERE tid='$row[thema]'
|
|
AND utid='$row[unterthema]'");
|
|
$row4 = $result4->fetch_array();
|
|
|
|
|
|
|
|
|
|
$textwort = strip_tags($row['textwort']);
|
|
if ($row_cache_count['Anz'] == 0) {
|
|
$vorwort = strip_tags($row['vorwort'], '<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$botschaft = strip_tags($row['botschaft'], '<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$zusammenfassung = strip_tags($row['zusammenfassung'], '<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$kontext = strip_tags($row['kontext'], '<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>');
|
|
$text = strip_tags($row['inhalt'], '<br>,<b>,<strong>,<ul>,<li>,<ol>,<a>,<table>,<tr>,<td>,<h1>,<h2>,<h3>,<img>');
|
|
|
|
# Sonst kommt empty_string Fehlermeldung von Dom-Document. Besonders bei uralten LGs
|
|
if ($vorwort == '') {
|
|
$vorwort = "<br />";
|
|
}
|
|
if ($botschaft == '') {
|
|
$botschaft = "<br />";
|
|
}
|
|
if ($zusammenfassung == '') {
|
|
$zusammenfassung = "<br />";
|
|
}
|
|
if ($kontext == '') {
|
|
$kontext = "<br />";
|
|
}
|
|
if ($text == '') {
|
|
$text = "<br />";
|
|
}
|
|
|
|
|
|
$kontext = str_replace(' "', ' \"', $kontext);
|
|
$kontext = preg_replace_callback("/([0-9]\s*)?()(Sir|Mo|Jos|Ri|Rut|Sam|Kön|Chr|Esr|Neh|Est|Hiob|Ps|Spr|Pred|Hld|Jes|Jer|Kla|Klgl|Hes|St zu Dan|Dan|Hos|Joel|Am|Obd|Jona|Mi|Nah|Hab|Zef|Hag|Sach|Weish|Mal|Tob|Mt|Mk|Lk|Luk|Joh|Jh|Apg|Röm|Rom|Kor|Gal|Eph|Phil|Kol|Thess|Tim|Tit|Phlm|Ptr|Petr|Joh|Hbr|Hebr|Jak|Jk|Jud|Offb|Off)(\s*)" . "([0-9]{1,3})(\,\s*)?(aus\s*)?([0-9]{0,3})/", function($m) use (&$lid)
|
|
{
|
|
return refill($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $m[9], $lid);
|
|
}, $kontext);
|
|
$jahr = "$row[jahr]";
|
|
$bibellink = $row_link_bibel['bibellink'];
|
|
$kontext = 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 (&$lid, &$bibellink, &$jahr)
|
|
{
|
|
return makeLink($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $lid, $bibellink, $jahr);
|
|
}, $kontext);
|
|
|
|
$suchmuster = '/(KNK) (([0-9]{1,2}\.?){0,5})/';
|
|
$kontext = preg_replace_callback($suchmuster, function($m)
|
|
{
|
|
return makeKNK($m[1], $m[2]);
|
|
}, $kontext);
|
|
|
|
$suchmuster2 = '/(KNK-FA) ([0-9]{1,3})/';
|
|
$kontext = preg_replace_callback($suchmuster2, function($m)
|
|
{
|
|
return makeKNK_FA($m[1], $m[2]);
|
|
}, $kontext);
|
|
|
|
|
|
$zusammenfassung = str_replace(' "', ' \"', $zusammenfassung);
|
|
$zusammenfassung = preg_replace_callback("/([0-9]\s*)?()(Sir|Mo|Jos|Ri|Rut|Sam|Kön|Chr|Esr|Neh|Est|Hiob|Ps|Spr|Pred|Hld|Jes|Jer|Kla|Klgl|Hes|St zu Dan|Dan|Hos|Joel|Am|Obd|Jona|Mi|Nah|Hab|Zef|Hag|Sach|Weish|Mal|Tob|Mt|Mk|Lk|Luk|Joh|Jh|Apg|Röm|Rom|Kor|Gal|Eph|Phil|Kol|Thess|Tim|Tit|Phlm|Ptr|Petr|Joh|Hbr|Hebr|Jak|Jk|Jud|Offb|Off)(\s*)" . "([0-9]{1,3})(\,\s*)?(aus\s*)?([0-9]{0,3})/", function($m) use (&$lid)
|
|
{
|
|
return refill($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $m[9], $lid);
|
|
}, $zusammenfassung);
|
|
|
|
$zusammenfassung = 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 (&$lid, &$bibellink, &$jahr)
|
|
{
|
|
return makeLink($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $lid, $bibellink, $jahr);
|
|
}, $zusammenfassung);
|
|
|
|
$vorwort = str_replace(' "', ' \"', $vorwort);
|
|
$vorwort = preg_replace_callback("/([0-9]\s*)?()(Sir|Mo|Jos|Ri|Rut|Sam|Kön|Chr|Esr|Neh|Est|Hiob|Ps|Spr|Pred|Hld|Jes|Jer|Kla|Klgl|Hes|St zu Dan|Dan|Hos|Joel|Am|Obd|Jona|Mi|Nah|Hab|Zef|Hag|Sach|Weish|Mal|Tob|Mt|Mk|Lk|Luk|Joh|Jh|Apg|Röm|Rom|Kor|Gal|Eph|Phil|Kol|Thess|Tim|Tit|Phlm|Ptr|Petr|Joh|Hbr|Hebr|Jak|Jk|Jud|Offb|Off)(\s*)" . "([0-9]{1,3})(\,\s*)?(aus\s*)?([0-9]{0,3})/", function($m) use (&$lid)
|
|
{
|
|
return refill($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $m[9], $lid);
|
|
}, $vorwort);
|
|
|
|
$vorwort = 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 (&$lid, &$bibellink, &$jahr)
|
|
{
|
|
return makeLink($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $lid, $bibellink, $jahr);
|
|
}, $vorwort);
|
|
|
|
$botschaft = str_replace(' "', ' \"', $botschaft);
|
|
$botschaft = preg_replace_callback("/([0-9]\s*)?()(Sir|Mo|Jos|Ri|Rut|Sam|Kön|Chr|Esr|Neh|Est|Hiob|Ps|Spr|Pred|Hld|Jes|Jer|Kla|Klgl|Hes|St zu Dan|Dan|Hos|Joel|Am|Obd|Jona|Mi|Nah|Hab|Zef|Hag|Sach|Weish|Mal|Tob|Mt|Mk|Lk|Luk|Joh|Jh|Apg|Röm|Rom|Kor|Gal|Eph|Phil|Kol|Thess|Tim|Tit|Phlm|Ptr|Petr|Joh|Hbr|Hebr|Jak|Jk|Jud|Offb|Off)(\s*)" . "([0-9]{1,3})(\,\s*)?(aus\s*)?([0-9]{0,3})/", function($m)
|
|
{
|
|
return refill($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $m[9], $lid);
|
|
}, $botschaft);
|
|
|
|
$botschaft = 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 (&$lid, &$bibellink, &$jahr)
|
|
{
|
|
return makeLink($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $lid, $bibellink, $jahr);
|
|
}, $botschaft);
|
|
|
|
}
|
|
|
|
$textstelle = str_replace(array(
|
|
" ",
|
|
"aus",
|
|
"vgl"
|
|
), array(
|
|
"",
|
|
"",
|
|
""
|
|
), $row['textstelle']);
|
|
|
|
$date_nlg = mktime(0, 0, 0, 12, 1, 2007); // Datum ab dem neue LGs gelten
|
|
$date_nlg_format = date("Y-m-d", $date_nlg); // ISO-8601 Format wie in der Datenbank: Formatierung für Vergleiche erforderlich
|
|
|
|
$switch_date = strtotime($date_nlg_format); //Umrechnung des Fristgrenztages in eine Zahl
|
|
$lg_datum = strtotime($row['datum_berechnung']); // Umrechnung des Enddatums in eine Zahl
|
|
|
|
$result_podcast = $db->query("SELECT dateiname
|
|
FROM admin_rechte
|
|
WHERE admin_rolle = 'a_podcast'");
|
|
$row_podcast = $result_podcast->fetch_array();
|
|
|
|
$verzeichnis = "$row[jahr]-$row[monat]";
|
|
$suchbegriff1 = "$row[jahr]_$row[monat]_$row[tag].";
|
|
$suchbegriff2 = "$row[jahr]-$row[monat]-$row[tag].";
|
|
|
|
$verzeichnis2 = "/Leitgedanken/Podcast/$verzeichnis/";
|
|
#$verzeichnis2 = "/homes/admin/Drive/Podcast/$verzeichnis/";
|
|
$VerbindungsID = @ftp_connect($FTPServer2, 21, 5); # Timeout auf 5 Sek
|
|
$LoginErgebnis = @ftp_login($VerbindungsID, $FTPUser2, $FTPPasswort2);
|
|
|
|
########DEBUGINFO#################
|
|
# if($LoginErgebnis){
|
|
# echo "Verbunden<br>";
|
|
# }else{
|
|
# echo "keine Verbindung<br>";
|
|
# }
|
|
#
|
|
# echo "VerbindungsID: $VerbindungsID<br>
|
|
# FTPUser: $FTPUser2<br>
|
|
# FTPPasswort2: $FTPPasswort2<br>
|
|
# Verzeichnis: $verzeichnis2<br>
|
|
# <strong>Dateiname:</strong><br>
|
|
# ";
|
|
########DEBUGINFO ENDE############
|
|
|
|
|
|
$filename = 0;
|
|
$filename_podcast_lesung = 0;
|
|
|
|
if ($VerbindungsID && $LoginErgebnis) {
|
|
$smarty->assign('ftp_ansicht_connect', "1");
|
|
$Dateiliste = ftp_nlist($VerbindungsID, $verzeichnis2);
|
|
if ($Dateiliste != '') {
|
|
|
|
@sort($Dateiliste);
|
|
for ($i = 0; $i < count($Dateiliste); $i++) {
|
|
|
|
$dateiname = basename($Dateiliste[$i]);
|
|
#echo $dateiname."<br>";
|
|
|
|
if ($row['ukid'] != 5) { #Jugendgottesdienst ist der Dateiname anders
|
|
if ($row['ukid'] != 37) {
|
|
|
|
$pos1 = strpos($dateiname, $suchbegriff1);
|
|
$pos2 = strpos($dateiname, $suchbegriff2);
|
|
|
|
#echo "$dateiname -> $suchbegriff -> $pos1 -> -> $pos2<br>";
|
|
if ($pos1 > 0 or $pos2 > 0) {
|
|
$filename = $dateiname;
|
|
#echo "pos1: $pos1|pos2: $pos2|filename: $filename";
|
|
}
|
|
}
|
|
|
|
} else {
|
|
|
|
$suchbegriff1 = "$row[jahr]_$row[monat]_JGD.";
|
|
$suchbegriff2 = "G_$row[jahr]_$row[monat].";
|
|
$suchbegriff3 = "G_$row[jahr]-$row[monat].";
|
|
$suchbegriff4 = "JG_$row[jahr]-$row[monat].";
|
|
$pos1 = strpos($dateiname, $suchbegriff1);
|
|
$pos2 = strpos($dateiname, $suchbegriff2);
|
|
$pos3 = strpos($dateiname, $suchbegriff3);
|
|
$pos4 = strpos($dateiname, $suchbegriff4);
|
|
|
|
if ($pos != '' or $pos2 != '' or $pos3 != '' or $pos3 != '') {
|
|
|
|
$filename = $dateiname;
|
|
#echo "pos1: $pos1 <br> pos2: $pos2 <br> pos3: $pos3 <br> pos4: $pos4 <br>$filename<br><br>";
|
|
}
|
|
}
|
|
|
|
$suchbegriff_lesung = "$row[jahr]_$row[monat]_$row[tag]_Lesung";
|
|
$pos = strpos($dateiname, $suchbegriff_lesung);
|
|
$suchbegriff_lesung2 = "$row[jahr]-$row[monat]-$row[tag]_Lesung";
|
|
$pos2 = strpos($dateiname, $suchbegriff_lesung2);
|
|
if ($pos > 0 or $pos2 > 0) {
|
|
$filename_podcast_lesung = $dateiname;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
#echo "$row_podcast[dateiname]/$verzeichnis/$filename<br><br>";
|
|
|
|
|
|
// Preg auf vollständige Bibelbücher überprüft
|
|
$textstelle_stopmark = preg_replace_callback("/^([0-9]\.)*\s*" . //1 a
|
|
"(Philemon|Judas|Johannes|Mose|Könige|Korinther|Petrus|Sirach|Josua|Richter|Rut|Ruth|Samuel|Chronik|Esra|Nehemia|Esther|Ester|Hiob|Psalm|Sprüche|Prediger|Hoheslied|Jesaja|Jeremia|Klagelieder|Hesekiel|Daniel|Hosea|Joel|Amos|Tobias|Obadja|Jona|Micha|Nahum|Habakuk|Zefanja|Haggai|Sacharja|Maleachi|Judit|Weisheit|Baruch|Makkabäer|Stücke zu Ester|Stücke zu Daniel|Gebet Manasses|Matthäus|Markus|Lukas|Apostelgeschichte|Römer|Galater|Epheser|Philipper|Kolosser|Thessalonicher|Timotheus|Titus|Hebräer|Jakobus|Offenbarung)\s*" . //2
|
|
"([0-9]{1,3})" . //3 c
|
|
"(\,)?\s*" . //4 d
|
|
"(aus)?\s*" . //5 e
|
|
"([0-9]{0,3})" . //6 f
|
|
"(\.|-)?" . //7 g
|
|
"([0-9]{0,3})?" . //8 h
|
|
"(\.|-)?" . //9 i
|
|
"([0-9]{0,3})" . //10 j
|
|
"$/", function($m)
|
|
{
|
|
return splitword_stopmark($m[1], $m[2], $m[3], $m[6], $m[7], $m[8], $m[9], $m[10]);
|
|
}, $row['textstelle']);
|
|
|
|
// stopmark Ende
|
|
|
|
|
|
|
|
// Textwort: Link zu verschiedenen Onlinebibeln
|
|
if ($row_link_bibel['bibellink'] == 'lokal') {
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
if ($bibelversion == "1984") {
|
|
$link = "<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_1984.php?wort=$row[textstelle]&stopmark=$textstelle_stopmark&vers_select=Y','Bibellink','640','480','center','front');\">$row[textstelle]</a>";
|
|
}
|
|
if ($bibelversion == "2017") {
|
|
$link = "<a class=\"biblelink\" href=\"javascript:bib_link_lokal1('bibelpopup/bib_popup_2017.php?wort=$row[textstelle]&stopmark=$textstelle_stopmark&vers_select=Y','Bibellink','640','480','center','front');\">$row[textstelle]</a>";
|
|
}
|
|
} elseif ($row_link_bibel['bibellink'] == 'bibleserver') {
|
|
##### ÄNDERUNG NEUE LUTHERBIBEL ########
|
|
#if ($bibelversion == "1984") {
|
|
# $link = "<a href=http://www.bibleserver.com/go.php?lang={de}&bible={LUT84}&ref={$textstelle} target='_blank'>$row[textstelle]</a>";
|
|
#}
|
|
#if ($bibelversion == "2017") {
|
|
$textstelle = str_replace(',', '%2C', $textstelle);
|
|
$link = "<a href=http://www.bibleserver.com/LUT/{$textstelle} target='_blank'>$row[textstelle]</a>";
|
|
#}
|
|
}
|
|
|
|
$result_verweis = $db->query("SELECT querverweis
|
|
FROM profil
|
|
WHERE user='$user_admin'");
|
|
$row_verweis = $result_verweis->fetch_array();
|
|
|
|
|
|
require_once("verweise.php");
|
|
$querverweis = verweise($lid, $user_admin, $template);
|
|
# Erst werden die Verweise immer erzeugt, und ich cache geschrieben, dann abgefragt, wenn was im Cac dann qv_vorhanden =1.
|
|
# Verweisfenster wird dann nur eingeblendet, wenn ein Verweis vorhanden ist.
|
|
|
|
require_once("further_publication.php");
|
|
$further_publication = further_publication($lid, $user_admin, $template);
|
|
|
|
|
|
$result_te_cache = $db->query("SELECT erg_lid
|
|
FROM quelle_verweise_cache
|
|
WHERE erg_lid = $lid");
|
|
if ($result_te_cache->num_rows > 0) {
|
|
$qv_vorhanden = "1";
|
|
}
|
|
|
|
|
|
######################################################################
|
|
## Prüfung, ob Bibellesung vorhanden ist, die zur Kategorie passt
|
|
######################################################################
|
|
# Neu am 05.12.2019: Bibellesung Jugendgottesdienst, die ja immer am ersten im Monat sind, wurden auch bei normalen GDs angezeigt, die am 01. des Monats waren.
|
|
|
|
$result_lesung = $db->query("SELECT lid
|
|
FROM quelle a
|
|
WHERE datum='$row[datum_berechnung]'
|
|
AND kid = 12
|
|
AND lid != '$lid'
|
|
AND a.ukid = (select ukid from unterkategorie b where a.ukid=b.ukid and b.bezeichnung ='$row2[bezeichnung]')
|
|
");
|
|
$row_lesung = $result_lesung->fetch_array();
|
|
|
|
|
|
|
|
|
|
if ($row_lesung['lid'] != '') {
|
|
|
|
$result_lesung1 = $db->query("SELECT lesung
|
|
FROM profil
|
|
WHERE user='$user_admin'");
|
|
$row_lesung1 = $result_lesung1->fetch_array();
|
|
|
|
|
|
require_once("lesung.php");
|
|
|
|
|
|
$bibellesung = lesung($row['datum_berechnung'], $template, $verzeichnis, $filename_podcast_lesung);
|
|
|
|
}
|
|
|
|
######################################################################
|
|
## Ende Prüfung, ob Bibellesung vorhanden ist
|
|
######################################################################
|
|
|
|
|
|
|
|
if ($row_cache_count['Anz'] == 0) {
|
|
$text = str_replace(' "', ' \"', $text);
|
|
$text = preg_replace_callback("/([0-9]\s*)?()?(Sir|Mo|Jos|Ri|Rut|Sam|Kön|Chr|Esr|Neh|Est|Hiob|Ps|Spr|Pred|Hld|Jes|Jer|Kla|Klgl|Hes|St zu Dan|Dan|Hos|Joel|Am|Obd|Jona|Mi|Nah|Hab|Zef|Hag|Sach|Weish|Mal|Tob|Mt|Mk|Lk|Luk|Joh|Jh|Apg|Röm|Rom|Kor|Gal|Eph|Phil|Kol|Thess|Tim|Tit|Phlm|Ptr|Petr|Joh|Hbr|Hebr|Jak|Jk|Jud|Offb|Off)(\s*)" . "([0-9]{1,3})(\,\s*)?(aus\s*)?([0-9]{0,3})/", function($m) use (&$lid)
|
|
{
|
|
return refill($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $m[9], $lid);
|
|
}, $text);
|
|
|
|
$text = str_replace("$verweis", "<a name='verweis'>$verweis</a>", $text);
|
|
$text = 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 (&$lid, &$bibellink, &$jahr)
|
|
{
|
|
return makeLink($m[1], $m[2], $m[3], $m[4], $m[5], $m[6], $m[7], $m[8], $lid, $bibellink, $jahr);
|
|
}, $text);
|
|
$suchmuster = '/(KNK) (([0-9]{1,2}\.?){0,5})/';
|
|
$text = preg_replace_callback($suchmuster, function($m)
|
|
{
|
|
return makeKNK($m[1], $m[2]);
|
|
}, $text);
|
|
|
|
$suchmuster2 = '/(KNK-FA) ([0-9]{1,3})/';
|
|
$text = preg_replace_callback($suchmuster2, function($m)
|
|
{
|
|
return makeKNK_FA($m[1], $m[2]);
|
|
}, $text);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Automatisch in Publikationen verweisen - Start
|
|
|
|
if ($row_cache_count['Anz'] == 0) {
|
|
|
|
$db = dbconnect();
|
|
$query_lue = "SELECT eid, thema
|
|
FROM lue_quelle";
|
|
$result_lue = $db->query($query_lue);
|
|
$ln_zaehler = 0;
|
|
|
|
# PHP 8 Will ein Startwert
|
|
$thema1[] = "xxx";
|
|
|
|
while ($row_lue = $result_lue->fetch_array()) {
|
|
$thema = strpos("$row_lue[thema]", "Teil"); // Ermitteln wo das Wort "Teil" steht
|
|
|
|
if ($thema > 0) {
|
|
$thema = substr("$row_lue[thema]", 0, $thema); // Alles vor dem Wort "Teil" anzeigen
|
|
} else {
|
|
$thema = "$row_lue[thema]";
|
|
}
|
|
$thema = trim($thema);
|
|
|
|
|
|
|
|
while (substr($thema, -1) == '-' or substr($thema, -1) == ':' or substr($thema, -1) == '(' or substr($thema, -1) == ' ') {
|
|
$thema = trim($thema);
|
|
$thema = substr($thema, 0, -1);
|
|
$thema = trim($thema);
|
|
}
|
|
|
|
|
|
if (!@in_array($thema, $thema1)) {
|
|
#echo "$thema<br>";
|
|
|
|
$thema2[$ln_zaehler]['thema_kurz'] = $thema;
|
|
$thema2[$ln_zaehler]['eid'] = $row_lue['eid'];
|
|
$thema2[$ln_zaehler]['thema'] = $row_lue['thema'];
|
|
|
|
$thema1[] = $thema;
|
|
$ln_zaehler++;
|
|
}
|
|
|
|
}
|
|
|
|
#print_r($thema2);
|
|
|
|
|
|
// Automatisch in Publikationen verweisen - Ende
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#print_r($thema2);
|
|
|
|
// Automatisch in Publikationen und Begriffserklärung verweisen
|
|
foreach ($thema2 as $wert) {
|
|
# Modifikator /i hinzugefügt, damit Groß- Kleinschreibung nicht beachtet wird: 21.11.2011
|
|
# Modifikator /i wieder weggenommen, da die Groß- Kleinschreibung nicht mehr korrekt war "Die Hoffnung auf Die Wiederkunft Christi": 05.01.2012
|
|
$thema_kurz = str_replace("/", "\/", $wert['thema_kurz']);
|
|
|
|
# Wenn das Thema auch noch als Begriffserklärung vorkommt, dann nicht mit dem Thema von Publikationen verknüpfen,
|
|
# sondern später mit einem Popup verknüpfen
|
|
$result_exeg = $db->query("SELECT count(*) Anz FROM wort_exegese WHERE wort = '$thema_kurz'");
|
|
$row_exeg = $result_exeg->fetch_array();
|
|
|
|
if ($row_exeg['Anz'] > 0) {
|
|
|
|
$result_exeg3 = $db->query("SELECT verweis FROM wort_exegese WHERE upper(wort) = upper('$thema_kurz')");
|
|
$row_exeg3 = $result_exeg3->fetch_array();
|
|
|
|
$repl = "__lueexeg-$row_exeg3[verweis]-$wert[eid]__";
|
|
#echo $text;
|
|
#exit;
|
|
|
|
|
|
$text = replace_text_links("$thema_kurz", "$repl", $text);
|
|
$vorwort = replace_text_links("$thema_kurz", "$repl", $vorwort);
|
|
$botschaft = replace_text_links("$thema_kurz", "$repl", $botschaft);
|
|
$zusammenfassung = replace_text_links("$thema_kurz", "$repl", $zusammenfassung);
|
|
$kontext = replace_text_links("$thema_kurz", "$repl", $kontext);
|
|
|
|
$text = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $text);
|
|
$vorwort = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $vorwort);
|
|
$botschaft = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $botschaft);
|
|
$zusammenfassung = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $zusammenfassung);
|
|
$kontext = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $kontext);
|
|
|
|
|
|
#$text =preg_replace ("/\b$thema_kurz\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[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='tmpl/$template/images/i.png'></sup></a>" , $text);
|
|
#$botschaft =preg_replace ("/\b$thema_kurz\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[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='tmpl/$template/images/i.png'></sup></a>" , $botschaft);
|
|
#$zusammenfassung =preg_replace ("/\b$thema_kurz\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[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='tmpl/$template/images/i.png'></sup></a>" , $zusammenfassung);
|
|
#$kontext =preg_replace ("/\b$thema_kurz\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[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='tmpl/$template/images/i.png'></sup></a>" , $kontext);
|
|
}
|
|
}
|
|
|
|
# Das gleiche nochmals mit Kleinbuchstaben am Anfanng (lcfirst). Dann wird auch "Die Hoffnung auf die Wiederkunft Christi" gefunden statt nur "Die Wiederkunft..."
|
|
foreach ($thema2 as $wert) {
|
|
$thema_kurz = str_replace("/", "\/", $wert['thema_kurz']);
|
|
#$thema_kurz1=lcfirst($thema_kurz); # Erst ab PHP 5.3
|
|
$thema_kurz1 = strtolower(substr($thema_kurz, 0, 1)) . substr($thema_kurz, 1);
|
|
|
|
# Wenn das Thema auch noch als Begriffserklärung vorkommt, dann nicht mit dem Thema von Publikationen verknüpfen,
|
|
# sondern später mit einem Popup verknüpfen
|
|
$result_exeg = $db->query("SELECT count(*) Anz FROM wort_exegese WHERE wort = '$thema_kurz1'");
|
|
$row_exeg = $result_exeg->fetch_array();
|
|
|
|
|
|
if ($row_exeg['Anz'] > 0) {
|
|
|
|
$result_exeg3 = $db->query("SELECT verweis FROM wort_exegese WHERE upper(wort) = upper('$thema_kurz1')");
|
|
$row_exeg3 = $result_exeg3->fetch_array();
|
|
|
|
|
|
|
|
$repl = "__lueexeg-$row_exeg3[verweis]-$wert[eid]__";
|
|
#echo $text;
|
|
#exit;
|
|
|
|
$thema_kurz1 = $thema_kurz1;
|
|
$text = replace_text_links("$thema_kurz1", "$repl", $text);
|
|
$vorwort = replace_text_links("$thema_kurz1", "$repl", $vorwort);
|
|
$botschaft = replace_text_links("$thema_kurz1", "$repl", $botschaft);
|
|
$zusammenfassung = replace_text_links("$thema_kurz1", "$repl", $zusammenfassung);
|
|
$kontext = replace_text_links("$thema_kurz1", "$repl", $kontext);
|
|
|
|
$text = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $text);
|
|
$vorwort = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $vorwort);
|
|
$botschaft = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $botschaft);
|
|
$zusammenfassung = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $zusammenfassung);
|
|
$kontext = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $kontext);
|
|
|
|
|
|
|
|
|
|
#$text =preg_replace ("/\b$thema_kurz1\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[thema]' target='_parent'>$thema_kurz1</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='tmpl/$template/images/i.png'></sup></a>" , $text);
|
|
#$botschaft =preg_replace ("/\b$thema_kurz1\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[thema]'target='_parent'>$thema_kurz1</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='tmpl/$template/images/i.png'></sup></a>" , $botschaft);
|
|
#$zusammenfassung =preg_replace ("/\b$thema_kurz1\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[thema]' target='_parent'>$thema_kurz1</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='tmpl/$template/images/i.png'></sup></a>" , $zusammenfassung);
|
|
#$kontext =preg_replace ("/\b$thema_kurz1\b/", "<a class=alue href='lue_ansicht.php?eid=$wert[eid]' title='Publikationen: $wert[thema]' target='_parent'>$thema_kurz1</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='tmpl/$template/images/i.png'></sup></a>" , $kontext);
|
|
}
|
|
}
|
|
// Automatisch in Publikationenen und Begriffserklärung verweisen - Ende
|
|
|
|
|
|
// Begriffserklärung einbinden
|
|
|
|
|
|
|
|
|
|
$query_exeg1 = "SELECT distinct wort, verweis
|
|
FROM wort_exegese";
|
|
$result_exeg1 = $db->query($query_exeg1);
|
|
|
|
# PHP 8 Will ein Startwert
|
|
$arr_wort[] = "xxx";
|
|
while ($row_exeg1 = $result_exeg1->fetch_array()) {
|
|
|
|
if (!get_array_key($row_exeg1['wort'], $thema2)) {
|
|
|
|
|
|
$repl = "__exeg-$row_exeg1[verweis]-0__"; #eid wird nicht benötigt, daher 0
|
|
$exeg_wort = $row_exeg1['wort'];
|
|
$text = replace_text_links("$exeg_wort", "$repl", $text);
|
|
$vorwort = replace_text_links("$exeg_wort", "$repl", $vorwort);
|
|
$botschaft = replace_text_links("$exeg_wort", "$repl", $botschaft);
|
|
$zusammenfassung = replace_text_links("$exeg_wort", "$repl", $zusammenfassung);
|
|
$kontext = replace_text_links("$exeg_wort", "$repl", $kontext);
|
|
|
|
|
|
|
|
if (!@in_array($row_exeg1['wort'], $arr_wort)) {
|
|
# Die Begriffserklärung wird in ein Array geschrieben, so dass die Ersetzung nur einmal stattfindet, Wenn ein gleiches Wort ein der
|
|
# Tabelle wort_exegese wäre, dann würde er beim zweiten durchlauf der Schleife die Überschrift im Popup ersetzen:CAPTION,'$exegese_wort'
|
|
$arr_wort = array(
|
|
$row_exeg1['wort']
|
|
);
|
|
|
|
$text = 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");
|
|
}, $text);
|
|
$vorwort = 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");
|
|
}, $vorwort);
|
|
$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);
|
|
$zusammenfassung = 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");
|
|
}, $zusammenfassung);
|
|
$kontext = 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");
|
|
}, $kontext);
|
|
|
|
#$text =preg_replace ("/\b$row_exeg1[wort]\b/", "$row_exeg1[wort]<a onmouseover=\"return overlib('$exegese', ABOVE, CAPTION,'Begriffserklärung: $row_exeg1[wort]', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 300);\" onmouseout='nd();'><sup><img title = 'Begriffserklärung' border='0' height=10 src='tmpl/$template/images/i.png'></sup></a>" , $text);
|
|
#$botschaft=preg_replace ("/\b$row_exeg1[wort]\b/", "$row_exeg1[wort]<a onmouseover=\"return overlib('$exegese', ABOVE, CAPTION,'Begriffserklärung: $row_exeg1[wort]', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 300);\" onmouseout='nd();'><sup><img title = 'Begriffserklärung' border='0' height=10 src='tmpl/$template/images/i.png'></sup></a>" , $botschaft);
|
|
#$zusammenfassung =preg_replace ("/\b$row_exeg1[wort]\b/", "$row_exeg1[wort]<a onmouseover=\"return overlib('$exegese', ABOVE, CAPTION,'Begriffserklärung: $row_exeg1[wort]', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 300);\" onmouseout='nd();'><sup><img title = 'Begriffserklärung' border='0' height=10 src='tmpl/$template/images/i.png'></sup></a>" , $zusammenfassung);
|
|
#$kontext =preg_replace ("/\b$row_exeg1[wort]\b/", "$row_exeg1[wort]<a onmouseover=\"return overlib('$exegese', ABOVE, CAPTION,'Begriffserklärung: $row_exeg1[wort]', STATUS,'', TEXTSIZE, '10px', CAPTIONSIZE, '10px', CAPTIONFONT, 'Arial', WIDTH, 300);\" onmouseout='nd();'><sup><img title = 'Begriffserklärung' border='0' height=10 src='tmpl/$template/images/i.png'></sup></a>" , $kontext);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Begriffserklärung einbinden - Ende
|
|
|
|
|
|
// Automatisch in Publikationenen
|
|
foreach ($thema2 as $wert) {
|
|
# Modifikator /i hinzugefügt, damit Groß- Kleinschreibung nicht beachtet wird: 21.11.2011
|
|
# Modifikator /i wieder weggenommen, da die Groß- Kleinschreibung nicht mehr korrekt war "Die Hoffnung auf Die Wiederkunft Christi": 05.01.2012
|
|
$thema_kurz = str_replace("/", "\/", $wert['thema_kurz']);
|
|
|
|
# Wenn das Thema auch noch als Begriffserklärung vorkommt, dann nicht mit dem Thema von Publikationen verknüpfen,
|
|
# sondern später mit einem Popup verknüpfen
|
|
$result_exeg = $db->query("SELECT count(*) Anz FROM wort_exegese WHERE upper(wort) = upper('$thema_kurz')");
|
|
$row_exeg = $result_exeg->fetch_array();
|
|
|
|
|
|
if ($row_exeg['Anz'] == 0) {
|
|
|
|
$repl = "__lue-0-$wert[eid]__"; #weid wird nicht benötigt, daher 0
|
|
|
|
|
|
|
|
#echo "$thema_kurz -> $repl<br>\n";
|
|
$text = replace_text_links("$thema_kurz", "$repl", $text);
|
|
$vorwort = replace_text_links("$thema_kurz", "$repl", $vorwort);
|
|
$botschaft = replace_text_links("$thema_kurz", "$repl", $botschaft);
|
|
$zusammenfassung = replace_text_links("$thema_kurz", "$repl", $zusammenfassung);
|
|
$kontext = replace_text_links("$thema_kurz", "$repl", $kontext);
|
|
|
|
$text = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $text);
|
|
$vorwort = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $vorwort);
|
|
$botschaft = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $botschaft);
|
|
$zusammenfassung = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $zusammenfassung);
|
|
$kontext = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz", "$template");
|
|
}, $kontext);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
# Das geliche nochmals mit Kleinbuchstaben am Anfanng (lcfirst). Dann wird auch "Die Hoffnung auf die Wiederkunft Christi" gefunden statt nur "Die Wiederkunft..."
|
|
foreach ($thema2 as $wert) {
|
|
$thema_kurz = str_replace("/", "\/", $wert['thema_kurz']);
|
|
#$thema_kurz=lcfirst($thema_kurz); # Erst ab PHP 5.3
|
|
$thema_kurz1 = strtolower(substr($thema_kurz, 0, 1)) . substr($thema_kurz, 1);
|
|
|
|
# Wenn das Thema auch noch als Begriffserklärung vorkommt, dann nicht mit dem Thema von Publikationen verknüpfen,
|
|
# sondern später mit einem Popup verknüpfen
|
|
$result_exeg = $db->query("SELECT count(*) Anz FROM wort_exegese WHERE upper(wort) = upper('$thema_kurz')");
|
|
$row_exeg = $result_exeg->fetch_array();
|
|
|
|
if ($row_exeg['Anz'] == 0) {
|
|
|
|
$repl = "__lue-0-$wert[eid]__"; #weid wird nicht benötigt, daher 0
|
|
|
|
$thema_kurz1 = $thema_kurz1;
|
|
#echo "$thema_kurz -> $repl<br>\n";
|
|
$text = replace_text_links("$thema_kurz1", "$repl", $text);
|
|
$vorwort = replace_text_links("$thema_kurz1", "$repl", $vorwort);
|
|
$botschaft = replace_text_links("$thema_kurz1", "$repl", $botschaft);
|
|
$zusammenfassung = replace_text_links("$thema_kurz1", "$repl", $zusammenfassung);
|
|
$kontext = replace_text_links("$thema_kurz1", "$repl", $kontext);
|
|
|
|
$text = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $text);
|
|
$vorwort = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $vorwort);
|
|
$botschaft = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $botschaft);
|
|
$zusammenfassung = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $zusammenfassung);
|
|
$kontext = preg_replace_callback("/__(lue|exeg|lueexeg)-([0-9]*)-([0-9]*)__/", function($m) use (&$thema_kurz1, &$template)
|
|
{
|
|
return makepopup($m[1], $m[2], $m[3], "$thema_kurz1", "$template");
|
|
}, $kontext);
|
|
|
|
}
|
|
}
|
|
|
|
// Automatisch in Publikationen - Ende
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($suchart == 1) {
|
|
$suchopt = "{0,1}";
|
|
} else {
|
|
$suchopt = "";
|
|
}
|
|
|
|
if (!isset($inhalt_hig)) {
|
|
$text2 = $text;
|
|
} else {
|
|
$text2 = highlight_results(" " . $text . " ", $suchopt, "$inhalt_hig");
|
|
}
|
|
|
|
} # Ende: if($row_cache_count['Anz'] == 0){
|
|
|
|
###########################
|
|
## Ausgabe der Variablen ##
|
|
###########################
|
|
|
|
$smarty->assign('ansicht_fadeout', "$fadeout");
|
|
$smarty->assign('ansicht_lid', "$lid");
|
|
$smarty->assign('ansicht_headline_text', "$ueberschrift");
|
|
$smarty->assign('ansicht_date', "$datum_wt");
|
|
$smarty->assign('ansicht_weekday', "$wochentag_wt");
|
|
$smarty->assign('ansicht_cat_text', "$cat_text");
|
|
|
|
|
|
$result_anzthema = $db->query("SELECT count(*) Anz
|
|
FROM quelle
|
|
WHERE thema='$row[thema]'");
|
|
$row_anzthema = $result_anzthema->fetch_array();
|
|
|
|
if ($row_anzthema['Anz'] > 1) {
|
|
$smarty->assign('ansicht_thema_text_link', "1");
|
|
$smarty->assign('ansicht_thema_text_tid', "$row[thema]");
|
|
} else {
|
|
$smarty->assign('ansicht_thema_text_link', "0");
|
|
}
|
|
$smarty->assign('ansicht_thema_text', "$thema_head");
|
|
|
|
if ($row4['bezeichnung'] != "") {
|
|
$smarty->assign('ansicht_subthema_exists', "1");
|
|
$subthema = $row4['bezeichnung'];
|
|
$smarty->assign('ansicht_subthema_text', "$subthema");
|
|
}
|
|
|
|
if ($row2['bezeichnung'] != '') {
|
|
$smarty->assign('ansicht_subcat_exists', "1");
|
|
$subcat_text = $row2['bezeichnung'];
|
|
$smarty->assign('ansicht_subcat_text', "$subcat_text");
|
|
}
|
|
|
|
if ($row['stapgd'] == 'Y' AND $row['ukid'] != '37') {
|
|
$smarty->assign('ansicht_stapgd_exists', "1");
|
|
$smarty->assign('ansicht_stapgd_text', "Aus einem Gottesdienst des Stammapostels");
|
|
}
|
|
|
|
if ($row['stapgd'] == 'Y' AND $row['ukid'] == '37') {
|
|
$smarty->assign('ansicht_stapgd1_exists', "1");
|
|
$smarty->assign('ansicht_stapgd1_text', "Stammapostelsgottesdienst");
|
|
}
|
|
|
|
if ($lg_datum >= $switch_date) {
|
|
$smarty->assign('ansicht_lg_new', "1");
|
|
}
|
|
|
|
if (rore($user_admin, 'a_pdf', 'RE')) {
|
|
$smarty->assign('ansicht_icon_pdf_right', "1");
|
|
$smarty->assign('ansicht_icon_pdf', "<a href=\"pdf_gen.php?lid=$lid\" target='_blank'><img src=\"images/ico_pdf.gif\" border=\"0\"></a>");
|
|
}
|
|
|
|
if (rore($user_admin, 'a_wortbear', 'RE')) {
|
|
$smarty->assign('ansicht_icon_edit_right', "1");
|
|
$smarty->assign('ansicht_icon_edit', "<a href=\"wort_bearbeiten.php?action=bearbeiten1&wort=$lid\" target=\"_parent\"><img src=\"images/edit.png\" border=\"0\"></a>");
|
|
}
|
|
|
|
|
|
if (rore($user_admin, 'a_outlook', 'RE')) {
|
|
$smarty->assign('ansicht_icon_outlook_right', "1");
|
|
$smarty->assign('ansicht_icon_outlook', "<a href=\"outlook.php?lid=$lid&typ=1\"><img src=\"images/outlook.gif\" border=\"0\"></a>");
|
|
}
|
|
|
|
|
|
if (rore($user_admin, 'a_podcast', 'RE') and $filename != '' and $filename != '0') {
|
|
#echo "$row_podcast[dateiname]/$verzeichnis/$filename<br><br>";
|
|
$smarty->assign('ansicht_icon_podcast_right', "1");
|
|
$smarty->assign('ansicht_icon_podcast', "<a href=\"$row_podcast[dateiname]/$verzeichnis/$filename\" target='top'><img src=\"images/lautsprecher.gif\" border=\"0\"></a>");
|
|
}
|
|
|
|
|
|
|
|
$smarty->assign('ansicht_textwort_link', "$link");
|
|
|
|
if (isset($qv_vorhanden) AND $qv_vorhanden == '1') {
|
|
$smarty->assign('ansicht_qv_vorhanden', "1");
|
|
$smarty->assign('ansicht_qv_modus', "$row_verweis[querverweis]");
|
|
$smarty->assign('ansicht_qv_gen', "$querverweis");
|
|
}
|
|
|
|
$smarty->assign('ansicht_fp_gen', "$further_publication");
|
|
|
|
|
|
if ($row_lesung['lid'] != '') {
|
|
#echo "Lesung: $bibellesung<br>";
|
|
$smarty->assign('ansicht_lesung_vorhanden', "1");
|
|
$smarty->assign('ansicht_lesung_modus', "$row_lesung1[lesung]");
|
|
$smarty->assign('ansicht_lesung_gen', "$bibellesung");
|
|
|
|
}
|
|
|
|
if ($textwort != '') {
|
|
$textwort = $textwort;
|
|
$smarty->assign('ansicht_textwort', "$textwort");
|
|
}
|
|
|
|
if ($verweis != '') {
|
|
$kontext .= "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";
|
|
$kontext .= "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";
|
|
}
|
|
|
|
|
|
|
|
if ($lg_datum >= $switch_date AND $row['ukid'] == '37') {
|
|
$smarty->assign('ansicht_inhalt_exists', "2");
|
|
}
|
|
|
|
$result_vw = $db->query("SELECT inhalt
|
|
FROM quelle_cache
|
|
WHERE link = '$row_link_bibel[bibellink]'
|
|
AND lid='$lid'");
|
|
$row_cache_vw = $result_vw->fetch_array();
|
|
|
|
if ($row_cache_vw['inhalt'] != "") {
|
|
$smarty->assign('ansicht_inhalt_exists', "1"); # Variable muss nochmals gesetzt werden, da die Where Bedinung nicht greifen würde oben, da Variable im Cachemodus leer ist
|
|
$inhalt = base64_decode($row_cache_vw['inhalt']);
|
|
$smarty->assign('ansicht_inhalt_text', "$inhalt");
|
|
} elseif (trim($text2) != '<br/>' AND trim($text2) != '') {
|
|
$smarty->assign('ansicht_inhalt_exists', "1");
|
|
$text2_dec = base64_encode($text2);
|
|
$sql1 = $db->query("INSERT INTO quelle_cache ( lid, inhalt, link) VALUES ($lid, '$text2_dec', '$row_link_bibel[bibellink]')");
|
|
$cid = $db->insert_id;
|
|
$smarty->assign('ansicht_inhalt_text', "$text2");
|
|
}
|
|
|
|
|
|
|
|
if ($lg_datum >= $switch_date AND $row['ukid'] != '37') {
|
|
|
|
$result_vw = $db->query("SELECT vorwort
|
|
FROM quelle_cache
|
|
WHERE link = '$row_link_bibel[bibellink]'
|
|
AND lid='$lid'");
|
|
$row_cache_vw = $result_vw->fetch_array();
|
|
|
|
|
|
if ($row_cache_vw['vorwort'] != "") {
|
|
$smarty->assign('ansicht_vorwort_exists', "1"); # Variable muss nochmals gesetzt werden, da die Where Bedinung nicht greifen würde oben, da Variable im Cachemodus leer ist
|
|
$vorwort = base64_decode($row_cache_vw['vorwort']);
|
|
$smarty->assign('ansicht_vorwort_text', "$vorwort");
|
|
} elseif (trim($vorwort) != '<br/>' AND trim($vorwort) != '') {
|
|
$smarty->assign('ansicht_vorwort_exists', "1");
|
|
$smarty->assign('ansicht_vorwort_text', "$vorwort");
|
|
$vorwort_dec = base64_encode($vorwort);
|
|
$sql1 = $db->query("UPDATE quelle_cache SET vorwort='$vorwort_dec' WHERE cid=$cid");
|
|
}
|
|
}
|
|
|
|
|
|
if ($lg_datum >= $switch_date AND $row['ukid'] != '37') {
|
|
|
|
$result_vw = $db->query("SELECT botschaft
|
|
FROM quelle_cache
|
|
WHERE link = '$row_link_bibel[bibellink]'
|
|
AND lid='$lid'");
|
|
$row_cache_vw = $result_vw->fetch_array();
|
|
|
|
if ($row_cache_vw['botschaft'] != "") {
|
|
$smarty->assign('ansicht_botschaft_exists', "1");
|
|
$botschaft = base64_decode($row_cache_vw['botschaft']);
|
|
$smarty->assign('ansicht_botschaft_text', "$botschaft");
|
|
} elseif (trim($botschaft) != '<br/>' AND trim($botschaft) != '') {
|
|
$smarty->assign('ansicht_botschaft_exists', "1");
|
|
$botschaft_dec = base64_encode($botschaft);
|
|
$sql1 = $db->query("UPDATE quelle_cache SET botschaft='$botschaft_dec' WHERE cid=$cid");
|
|
$smarty->assign('ansicht_botschaft_text', "$botschaft");
|
|
}
|
|
|
|
}
|
|
|
|
|
|
if ($lg_datum >= $switch_date AND $row['ukid'] != '37') {
|
|
|
|
|
|
$result_vw = $db->query("SELECT zusammenfassung
|
|
FROM quelle_cache
|
|
WHERE link = '$row_link_bibel[bibellink]'
|
|
AND lid='$lid'");
|
|
$row_cache_vw = $result_vw->fetch_array();
|
|
|
|
|
|
if ($row_cache_vw['zusammenfassung'] != "") {
|
|
$smarty->assign('ansicht_zusammenfassung_exists', "1"); # Variable muss nochmals gesetzt werden, da die Where Bedinung nicht greifen würde oben, da Variable im Cachemodus leer ist
|
|
$zusammenfassung = base64_decode($row_cache_vw['zusammenfassung']);
|
|
$smarty->assign('ansicht_zusammenfassung_text', "$zusammenfassung");
|
|
} elseif (trim($zusammenfassung) != '<br/>' AND trim($zusammenfassung) != '') {
|
|
$smarty->assign('ansicht_zusammenfassung_exists', "1");
|
|
$zusammenfassung_dec = base64_encode($zusammenfassung);
|
|
$sql1 = $db->query("UPDATE quelle_cache SET zusammenfassung='$zusammenfassung_dec' WHERE cid=$cid");
|
|
$smarty->assign('ansicht_zusammenfassung_text', "$zusammenfassung");
|
|
}
|
|
|
|
|
|
}
|
|
|
|
if ($lg_datum >= $switch_date) {
|
|
|
|
$result_vw = $db->query("SELECT kontext
|
|
FROM quelle_cache
|
|
WHERE link = '$row_link_bibel[bibellink]'
|
|
AND lid='$lid'");
|
|
$row_cache_vw = $result_vw->fetch_array();
|
|
|
|
|
|
if ($row_cache_vw['kontext'] != "") {
|
|
$smarty->assign('ansicht_kontext_exists', "1");
|
|
$kontext = base64_decode($row_cache_vw['kontext']);
|
|
$smarty->assign('ansicht_kontext_text', "$kontext");
|
|
} elseif (trim($kontext) != '<br/>' AND trim($kontext) != '') {
|
|
$smarty->assign('ansicht_kontext_exists', "1");
|
|
$kontext_dec = base64_encode($kontext);
|
|
$sql1 = $db->query("UPDATE quelle_cache SET kontext='$kontext_dec' WHERE cid=$cid");
|
|
$smarty->assign('ansicht_kontext_text', "$kontext");
|
|
}
|
|
|
|
|
|
|
|
}
|
|
} //Ende Action
|
|
|
|
if ($action == 'thema') {
|
|
$tid = $_GET['tid'];
|
|
|
|
|
|
function kurzer_text($string, $laenge)
|
|
{
|
|
$origin = strlen($string);
|
|
$stri_arr = explode(" ", $string);
|
|
$anzzahl = count($stri_arr);
|
|
$gekuerzt = 0;
|
|
$string = "";
|
|
while ($gekuerzt < $anzzahl) {
|
|
$string_alt = $string;
|
|
$string = $string . " " . $stri_arr[$gekuerzt];
|
|
$gekuerzt++;
|
|
if (strlen($string) > $laenge) {
|
|
$gekuerzt = $anzzahl;
|
|
$string = $string_alt;
|
|
}
|
|
}
|
|
if ($laenge < $origin) {
|
|
$string = $string . "<nobr> <b>...</b></nobr>";
|
|
}
|
|
return $string;
|
|
}
|
|
|
|
|
|
$db = dbconnect();
|
|
$query = "SELECT a.lid, a.ueberschrift, a.textstelle, a.inhalt, DATE_Format(a.datum, '%d') tag, DATE_Format(a.datum, '%m') monat, DATE_Format(a.datum, '%Y') jahr, b.bezeichnung, c.bezeichnung, a.kid, a.ukid
|
|
FROM quelle a, kategorie b, unterkategorie c
|
|
WHERE a.kid=b.kid
|
|
AND a.ukid=c.ukid
|
|
AND thema = '$tid'
|
|
ORDER BY `a`.`lid` ASC
|
|
";
|
|
|
|
|
|
$result = $db->query($query);
|
|
$menge = $result->num_rows;
|
|
|
|
$ln_zaehler = 0;
|
|
|
|
#$abfrage = "SELECT id FROM links"
|
|
|
|
|
|
|
|
$smarty->assign('anzahltreffer', "$menge");
|
|
|
|
while ($row = $result->fetch_array()) {
|
|
|
|
|
|
|
|
if ($inhalt == '') {
|
|
##$preview = substr(strip_tags($row[inhalt]),0,200)." <b>...</b> ";
|
|
$preview = kurzer_text(strip_tags($row['inhalt']), 200);
|
|
|
|
} else {
|
|
#$preview = preview(strip_tags($row[inhalt]),trim($_POST[inhalt]));
|
|
##$preview = substr(strip_tags($row[inhalt]),0,200)." <b>...</b> ";
|
|
$preview = kurzer_text(strip_tags($row['inhalt']), 200);
|
|
}
|
|
|
|
|
|
$wochentag = date("l", mktime(0, 0, 0, $row['monat'], $row['tag'], $row['jahr']));
|
|
|
|
switch ($wochentag) {
|
|
case 'Sunday':
|
|
$wochentag = "So.";
|
|
break;
|
|
case 'Monday':
|
|
$wochentag = "Mo.";
|
|
break;
|
|
case 'Tuesday':
|
|
$wochentag = "Di.";
|
|
break;
|
|
case 'Wednesday':
|
|
$wochentag = "Mi.";
|
|
break;
|
|
case 'Thursday':
|
|
$wochentag = "Do.";
|
|
break;
|
|
case 'Friday':
|
|
$wochentag = "Fr.";
|
|
break;
|
|
case 'Saturday':
|
|
$wochentag = "Sa.";
|
|
break;
|
|
}
|
|
|
|
$result1 = $db->query("SELECT bezeichnung FROM kategorie WHERE kid='$row[kid]'");
|
|
$row1 = $result1->fetch_array();
|
|
|
|
$result2 = $db->query("SELECT bezeichnung FROM unterkategorie WHERE ukid='$row[ukid]'");
|
|
$row2 = $result2->fetch_array();
|
|
|
|
|
|
$ln_zaehler = $ln_zaehler + 1;
|
|
|
|
if ($art == 'exact') { // Übergabe für Highligthing. Wenn exact, dann darf bei Begriff nicht Gottesdienst hervorgehoben werden
|
|
$suchart = 0;
|
|
} else {
|
|
$suchart = 1;
|
|
}
|
|
|
|
$inhalt_hig = urlencode(serialize($_POST['inhalt']));
|
|
$row['suchart'] = $suchart;
|
|
$row['inhalt_hig'] = $inhalt_hig;
|
|
$row['kategorie'] = $row1['bezeichnung'];
|
|
$row['unterkategorie'] = $row2['bezeichnung'];
|
|
$row['preview'] = $preview;
|
|
$row['wochentag'] = $wochentag;
|
|
$value3[] = $row;
|
|
}
|
|
$smarty->assign('table_data3', $value3);
|
|
|
|
}
|
|
## Ausgabe Variablen Ende ##
|
|
|
|
$smarty->assign('action', "$action");
|
|
$smarty->display("$template/$templatename");
|
|
?>
|