Subversion Repositories personal-webbase

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 daniel-mar 1
<?php
2
 
3
if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
4
 
5
echo $header;
6
 
7
function martinus_parse_url($input) {
8
        return '<a target="_blank" href="'.deferer('http://www.daskirchenjahr.de/tag.php'.$input[1]).'"';
9
}
10
 
11
// Ich suche mir das aktuelle Kirchenfest von daskirchenjahr.de
12
 
13
$eingangsseite = my_get_contents('http://www.daskirchenjahr.de/index.php');
14
 
15
if ($eingangsseite == '') die('<b>Fehler: Konnte Ressourcen nicht beziehen!</b><br><br>Wenn das Problem weiterhin besteht, pr&uuml;fen Sie bitte Ihre PHP-Konfiguration.'.$footer);
16
 
17
preg_match_all('/Aktuelles Fest: <A HREF="(.+?)"(.+?)><B>(.+?)<\/B><\/A>/im', $eingangsseite, $omatches);
18
echo '<h1>'.htmlentities($module_information->caption).'</h1>';
19
 
20
$festseite = my_get_contents('http://www.daskirchenjahr.de/'.$omatches[1][0].'&amp;typ=proprium');
21
preg_match_all('/<\/A><\/P><BR>(.+?)<CENTER><TABLE WIDTH="90%" CELLSPACING="4" ALIGN=CENTER><TR><TD style="text-align:center; background-color:#dcdcee"><FONT SIZE="-1">Zuletzt/is', $festseite, $matches);
22
echo '<h2>Proprium</h2>';
23
$txt = $matches[1][0];
24
 
25
$txt = str_replace('<A HREF="', '<a target="_blank" href="', $txt);
26
$txt = preg_replace_callback('/<a target="_blank" href="tag.php(.+?)"/ism', 'martinus_parse_url', $txt);
27
 
28
$txt = str_replace('#DCDCDC', '#F4F4F4', $txt);
29
$txt = str_replace(' <FONT SIZE=2>()</FONT>', '', $txt);
30
if (strpos($festseite, '<TD style="header;text-align=center;background-color:purple">')) $farbe = 'Violett';
31
if (strpos($festseite, '<TD style="header;text-align=center;background-color:white">')) $farbe = 'Weiß';
32
if (strpos($festseite, '<TD style="header;text-align=center;background-color:black">')) $farbe = 'Schwarz';
33
if (strpos($festseite, '<TD style="header;text-align=center;background-color:green">')) $farbe = 'Grün';
34
if (strpos($festseite, '<TD style="header;text-align=center;background-color:red">')) $farbe = 'Rot';
35
 
36
preg_match_all('/<A class="mainmenu" style="background-color:#DCDCDC" href="(.+?)" title="(.+?)">(.+?)<\/A><BR><P style="text-align:center;background-color:#DFEAFF"><A class="submenu" style="background-color:#DFEAFF" href="tag.php(.+?)"/is', $festseite, $matches);
37
$ary = explode('"', $matches[3][0]);
38
$einordnung = '<a target="_blank" href="'.deferer('http://www.daskirchenjahr.de/'.$ary[count($ary)-4]).'">'.$ary[count($ary)-2].'</a>';
39
 
40
$dazwischen = '';
41
$dazwischen .= '<TR VALIGN="TOP"><TD WIDTH="22%" STYLE="background-color:#F4F4F4"><P ALIGN="RIGHT"><STRONG>Name:</STRONG></P></TD><TD WIDTH="78%" STYLE="background-color:#F4F4F4"><P>'.$omatches[3][0].'</P></TD></TR>';
42
$dazwischen .= '<TR VALIGN="TOP"><TD WIDTH="22%" STYLE="background-color:#F4F4F4"><P ALIGN="RIGHT"><STRONG>Einordnung:</STRONG></P></TD><TD WIDTH="78%" STYLE="background-color:#F4F4F4"><P>'.$einordnung.'</P></TD></TR>';
43
$dazwischen .= '<TR VALIGN="TOP"><TD WIDTH="22%" STYLE="background-color:#F4F4F4"><P ALIGN="RIGHT"><STRONG>Farbe:</STRONG></P></TD><TD WIDTH="78%" STYLE="background-color:#F4F4F4"><P>'.$farbe.'</P></TD></TR>';
44
$txt = str_replace('<COL WIDTH="201*"><TR VALIGN="TOP">', '<COL WIDTH="201*">'.$dazwischen.'<TR VALIGN="TOP">', $txt);
45
$txt = preg_replace('/<FONT SIZE=2>(.+?)<\/FONT>/is', '$1', $txt);
46
 
47
// Sonderzeichen
48
$txt = str_replace('&', '&amp;', $txt);
49
$txt = str_replace('Ä', '&Auml;', $txt);
50
$txt = str_replace('Ö', '&Ouml;', $txt);
51
$txt = str_replace('Ü', '&Uuml;', $txt);
52
$txt = str_replace('ä', '&auml;', $txt);
53
$txt = str_replace('ö', '&ouml;', $txt);
54
$txt = str_replace('ü', '&uuml;', $txt);
55
$txt = str_replace('ß', '&szlig;', $txt);
56
 
57
echo decode_critical_html_characters($txt);
58
 
59
echo '<h2>Weitere Informationen</h2>';
60
echo '<ul>';
61
 
62
preg_match_all('/<p class="topmenu" style="background-color:#DCDCDC">(.+?)<\/P>/is', $festseite, $matches);
63
$txt = $matches[1][0];
64
$txt = preg_replace('/<A(.+?)>Proprium<\/A> \| /is', '', $txt);
65
$txt = str_replace(' | ', '</li><li>', $txt);
66
 
67
$txt = str_replace('<A HREF="', '<a target="_blank" href="', $txt);
68
$txt = preg_replace_callback('/<a target="_blank" href="tag.php(.+?)"/ism', 'martinus_parse_url', $txt);
69
 
70
echo '<li>';
71
 
72
// Sonderzeichen
73
$txt = str_replace('&', '&amp;', $txt);
74
$txt = str_replace('Ä', '&Auml;', $txt);
75
$txt = str_replace('Ö', '&Ouml;', $txt);
76
$txt = str_replace('Ü', '&Uuml;', $txt);
77
$txt = str_replace('ä', '&auml;', $txt);
78
$txt = str_replace('ö', '&ouml;', $txt);
79
$txt = str_replace('ü', '&uuml;', $txt);
80
$txt = str_replace('ß', '&szlig;', $txt);
81
 
82
echo decode_critical_html_characters($txt);
83
 
84
echo '</li>';
85
echo '</ul>Diese Informationen wurden zusammengetragen aus <a target="_blank" href="'.deferer('http://www.daskirchenjahr.de/').'">Das Kirchenjahr</a> von Dr. Martinus.';
86
 
87
echo $footer;
88
 
89
?>