
Code: Alles auswählen
<?php
// Konfigurations-Files einlesen
define("IN_EASYHP", true);
session_start();
include "includes/mysql.php";
// Query for config
$query[config] = mysql_query("SELECT frontpage, default_style, default_language, email, comments_per_site, comments FROM " . CONFIG_TABLE);
while ($config = mysql_fetch_object($query[config])) {
include "common.php";
include "includes/website.php";
// Header
?>
<!-- <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Eventkalender</title>
</head> -->
<body link="<? echo $font_color; ?>" vlink="<? echo $font_color; ?>" alink="<? echo $font_color_head; ?>">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="50%"><font face="<? echo $font; ?>"><center><h1>Veranstaltungskalender</h1></center></font></td>
<td width="50%">
</td>
</tr>
</table>
</body>
</html>
<?
// Alte Events löschen
$tstamp = mktime(0, 0, 0, date("m"), date("d")-1, date("Y"));
$gestern = date("Y-m-d", $tstamp); // ISO-8601 Format
$abfrage = "SELECT event_id FROM jgs_event WHERE datum <= '$gestern'";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis))
{
}
$loeschen = "DELETE FROM jgs_event WHERE datum <= '$gestern'";
$loesch = mysql_query($loeschen);
// Zeilenumbruch definieren
function replace($beschreibung_lang) {
$beschreibung_lang = str_replace("\r\n", "<br>", $beschreibung_lang);
return $beschreibung_lang;
}
// Datenbank auslesen und Kalenderblatt aufbereiten
$abfrage = "SELECT * FROM jgs_event ORDER BY datum";
$ergebnis = mysql_query($abfrage);
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="6" >
<?
while($row = mysql_fetch_object($ergebnis))
{
setlocale(LC_TIME, "de_DE");
$zeit_h = strftime("%H", strtotime("$row->zeit"));
if ($zeit_h == "00"){$zeit_h = "0";}
if ($zeit_h == "01"){$zeit_h = "1";}
if ($zeit_h == "02"){$zeit_h = "2";}
if ($zeit_h == "03"){$zeit_h = "3";}
if ($zeit_h == "04"){$zeit_h = "4";}
if ($zeit_h == "05"){$zeit_h = "5";}
if ($zeit_h == "06"){$zeit_h = "6";}
if ($zeit_h == "07"){$zeit_h = "7";}
if ($zeit_h == "08"){$zeit_h = "8";}
if ($zeit_h == "09"){$zeit_h = "9";}
//Meins ANFANG
$wtag = strftime("%A", strtotime("$row->datum"));
$monat = strftime("%B", strtotime("$row->datum"));
$tag = strftime("%e", strtotime("$row->datum"));
$jahr = strftime("%Y", strtotime("$row->datum"));
//meins ENDE
$event_id = $row->event_id;
$zeit_m = strftime("%M", strtotime("$row->zeit"));
$zeit = $zeit_h.":".$zeit_m;
$beschreibung = $row->beschreibung;
$treffpunkt = $row->treffpunkt;
$beschreibung_lang = $row->beschreibung_lang;
$link = $row->link;
$leer = "1";
if ($treffpunkt == "")
{
$treffpunkt1 = "";
}
else
{
$treffpunkt1 = "Treffpunkt: ".$treffpunkt;
}
if ($zeit == "0:00")
{
$zeit1 = "";
}
else
{
$zeit1 = $zeit." Uhr";
}
// Zeilenumbruch innerhalb der Schleife erzeugen
$beschreibung_lang = replace($beschreibung_lang);
// Zeilenumbruch Ende
?>
<!-- <html>
<body text="<? //echo $font_color; ?>" bgcolor="<?// echo $bc_color; ?>" background="<?// echo $image_bg; ?>"> -->
<tr>
<td width="12%" height="1" >
</td>
<td width="88%" height="1" background="#000000" >
<p align="center">
<b><? echo $beschreibung; ?></b>
</td>
</tr>
<tr>
<td width="12%" height="24" valign="top">
<p align="center">
<? echo $tag.".".$monat.".".$jahr."<br />"; echo $zeit1;?>
</td>
<td width="88%" height="39" valign="top">
<p align="center">
<? echo $beschreibung_lang; ?></p>
<p align="center">
<? echo $treffpunkt1; ?></p>
<p align="center"><a target="_blank" href="http://<? echo $link; ?>">
<? echo $link; ?></a>
</td>
</tr>
<tr>
<td width="12%" height="1" >
</td>
<td width="88%" height="1" background="#000000" >
</td>
</tr>
<?
}
?>
</table>
<?
// Prüfen, ob akuelle Termine in der Datenbank sind
if ($leer != "1") {
?>
<!-- <html>
<body text="<?// echo $font_color; ?>" bgcolor="<? echo $bc_color; ?>" background="<? echo $image_bg; ?>"> -->
<table border="1" cellpadding="0" cellspacing="0" >
<tr>
<td width="100%" height="1" background="<? echo $image_head; ?>" style="border-right: 1px solid <? echo $frame_color; ?>; ">
<p align="center">
<font face="<? echo $font_head; ?>" color="<? echo $font_color_head; ?>" size="<? echo $font_size_head; ?>">
Zur Zeit befinden sich keine aktuellen Termine in der Datenbank!</td>
</tr>
</table>
<? }
// Footer
?>
<html>
<body text="<? echo $font_color; ?>" bgcolor="<? echo $bc; ?>" background="<? echo $image_bg; ?>">
<body>
<p align="center">
<font size="2">powered by <a target="_blank" href="http://www.jgs-event.soehlde.org">jgs-event</a>
v1.2 2004</font></p>
</body>
</html>
<?
include "includes/footer.php";
}
mysql_close($connection);
?>
</body>
</html>
mir geht es nun eigentlich darum daraus einen Kalender zu basteln, der alle Tage eines Monats anzeigt und an den entsprechenden Tagen die Termine.
kann mir dabei jemand helfen?
PS.: wenn jemand diesen Kalender für EasyHP haben will, kann ich auch die komplette Mod mit Admin-Dateien zum Download bereitstellen.