hallo ihr profis...ich bin´s mal wieder...
hab mal wieder n problem...
am besten ihr schaut es euch erstmal an:
externer Link
der kalender sollte folgendermaßen aufgebaut sein:
aktueller monat: (zb februar)
termine
termine
termine
nächster monat: (zb märz)
termine
termine
längerfristige Termine: (april bis ende was in der db eingetragen ist)
termine
termine
ein freund der das (php) mal gelernt hat saß da auch schon einige zeit dran...irgendwie will das ding nicht.
kann vll jemand nen hinweis geben wonach man schaun könnte?
hier mal die quelltexte:
die content:
<?php
# Kalender Script © by Nickel
defined ('main') or die ( 'no direct access' );
//-----------------------------------------------------------|
$title = $allgAr['title'].' :: Kalender';
$hmenu = 'Kalender';
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ( 'kalender.htm' );
//-----------------------------------------------------------|
//Daten
$month = date('n');
$year = date('Y');
$gday = 0;
$view = 1;
$eid = 0;
if ($menu->getA(2) == 'm' AND is_numeric($menu->getE(2)) AND $menu->getE(2) > 0 AND $menu->getE(2) < 13) {
$month = $menu->getE(2);
}
if ($menu->getA(4) == 'd' AND is_numeric($menu->getE(4)) AND $menu->getE(4) > 0 AND $menu->getE(4) < 32) {
$gday = $menu->getE(4);
}
if ($menu->getA(3) == 'y' AND is_numeric($menu->getE(3)) AND $menu->getE(3) > 2000 AND $menu->getE(3) < date('Y', (time()+pow(8,9)))) {
$year = $menu->getE(3);
}
if ($menu->getA(2) == 'e' AND is_numeric($menu->getE(1))) {
$eid = $menu->getE(2);
}
$arr_month = array('1'=>'Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember');
$arr_day = array('So','Mo','Di','Mi','Do','Fr','Sa');
$days = date('t',mktime(0,0,0,$month,1,$year));
$start_col = date('w',mktime(0,0,0,$month,1,$year))-1;
$rows = ceil($days/7);
$day=1;
$data = array ();
$data_id = array ();
$aus = array();
//Daten aus der MySQL
$where1 = mktime(0 ,0,0,$month,1,$year);
$where2 = mktime(24,0,0,$month,date('t',$where1),$year);
$where3 = mktime(0 ,0,0,$month+1,1,$year);
$where4 = mktime(24,0,0,$month+1,date('t',$where3),$year);
$result = db_query("SELECT *
FROM prefix_kalender
WHERE ((time > ".$where1." AND time < ".$where2.") OR id = ".$eid.")
AND ".$_SESSION['authright']." <= recht
ORDER BY time LIMIT 200");
while ($row = db_fetch_assoc($result)) {
$t_id = $row['id'];
$t_d = date('j', $row['time']);
$t_m = date('n', $row['time']);
$t_y = date('Y', $row['time']);
$date = mktime(0,0,0,$t_m,$t_d,$t_y);
$data_id[$t_id] = $row;
$data[$date][] = $row;
}
$result2 = db_query("SELECT *
FROM prefix_kalender
WHERE (time > ".$where3." AND time < ".$where4.")
AND ".$_SESSION['authright']." <= recht
ORDER BY time LIMIT 200");
while ($row2 = db_fetch_assoc($result2)) {
$t2_id = $row2['id'];
$t2_d = date('j', $row2['time']);
$t2_m = date('n', $row2['time']);
$t2_y = date('Y', $row2['time']);
$date2 = mktime(0,0,0,$t_m,$t_d,$t_y);
$data2_id[$t2_id] = $row2;
$data2[$date2][] = $row2;
}
$result3 = db_query("SELECT *
FROM prefix_kalender
WHERE time > ".$where4."
AND ".$_SESSION['authright']." <= recht
ORDER BY time LIMIT 200");
while ($row3 = db_fetch_assoc($result3)) {
$t3_id = $row3['id'];
$t3_d = date('j', $row3['time']);
$t3_m = date('n', $row3['time']);
$t3_y = date('Y', $row3['time']);
$date3 = mktime(0,0,0,$t_m,$t_d,$t_y);
$data3_id[$t3_id] = $row3;
$data3[$date3][] = $row3;
}
$title_liste = 'aktueller Monat: '.$arr_month[$month].' '.$year;
$title_liste2 = 'nächster Monat: '.$arr_month[$month+1].' '.$year;
$title_liste3 = 'längerfristige Termine '.$year;
//Template Ausgabe
$aus['MONTH'] = $arr_month[$month];
$aus['YEAR'] = $year;
$aus['TITLE'] = ($eid) ? $data_id[$eid]['title'] : $title_liste;
$aus['TITLE2'] = ($eid) ? $data_id[$eid]['title'] : $title_liste2;
$aus['TITLE3'] = ($eid) ? $data_id[$eid]['title'] : $title_liste3;
$aus['TITLE_ALIGN'] = ($eid) ? '' : ' align="center"';
$tpl->set_ar_out($aus,0);
unset($aus);
//Deatilansicht
if ($eid) {
$aus['DEATIL_DATE'] = date('d.m.Y',$data_id[$eid]['time']);
$aus['DEATIL_TIME'] = date('H:i',$data_id[$eid]['time']);
$aus['DEATIL_TEXT'] = BBcode($data_id[$eid]['text']);
$tpl->set_ar_out($aus,2);
unset($aus);
}
//Liste der Tage (Listenansicht)
elseif ($view == 1) {
//Nur ein Tag
if (isset($data) && !empty($gday)) {
$date = mktime(0,0,0,$month,$gday,$year,$time);
$i = 1;
if (isset($data[$date])) {
foreach($data[$date] as $info) {
$text = '';
$text .= '<a href="?kalender-v'.$view.'-e'.$info['id'].'">'.$info['title'].'</a>';
$aus['LIST_I'] = $arr_day[date('w',$date)];
$aus['LIST_D'] = date('H:i',$info['time']);;
$aus['LIST_T'] = $text;
$class = ($i % 2) ? 'Cnorm' : 'Cmite' ;
$aus['LIST_CLASS'] = ($i+1 == date('j') && $month == date('n') && $year == date('Y')) ? 'Cdark' : $class;
$tpl->set_ar_out($aus,1);
unset($aus);
$i++;
}
}
//Ganze Liste
} elseif (isset($data)) {
$i = 1;
foreach($data as $date => $dataA) {
$text = '';
foreach($dataA as $info) {
$text .= '<a href="?kalender-v'.$view.'-e'.$info['id'].'">'.$info['title'].'</a>';
}
$aus['LIST_I'] = date('d.m.Y',$date);
$aus['LIST_D'] = $arr_day[date('w',$date)];
$aus['LIST_T'] = $text;
$class = ($i % 2) ? 'Cnorm' : 'Cmite' ;
$aus['LIST_CLASS'] = ($i+1 == date('j') && $month == date('n') && $year == date('Y')) ? 'Cdark' : $class;
$tpl->set_ar_out($aus,1);
unset($aus);
$i++;
}
foreach($data2 as $date2 => $dataB) {
$text = '';
foreach($dataB as $ino) {
$text .= '<a href="?kalender-v'.$view.'-e'.$info['id'].'">'.$info['title'].'</a>';
}
$aus['LIST2_I'] = date('d.m.Y',$date);
$aus['LIST2_D'] = $arr_day[date('w',$date)];
$aus['LIST2_T'] = $text;
$class = ($i % 2) ? 'Cnorm' : 'Cmite' ;
$aus['LIST2_CLASS'] = ($i+1 == date('j') && $month == date('n') && $year == date('Y')) ? 'Cdark' : $class;
$tpl->set_ar_out($aus,4);
unset($aus);
$i++;
}
foreach($data3 as $date3 => $dataC) {
$text = '';
foreach($dataC as $info) {
$text .= '<a href="?kalender-v'.$view.'-e'.$info['id'].'">'.$info['title'].'</a>';
}
$aus['LIST3_I'] = date('d.m.Y',$date);
$aus['LIST3_D'] = $arr_day[date('w',$date)];
$aus['LIST3_T'] = $text;
$class = ($i % 2) ? 'Cnorm' : 'Cmite' ;
$aus['LIST3_CLASS'] = ($i+1 == date('j') && $month == date('n') && $year == date('Y')) ? 'Cdark' : $class;
$tpl->set_ar_out($aus,6);
unset($aus);
$i++;
}
} else {
$aus['LIST_I'] = '-';
$aus['LIST_D'] = '-';
$aus['LIST_T'] = '-';
$aus['LIST_CLASS'] = 'Cnorm';
$tpl->set_ar_out($aus,1);
unset($aus);
}
}
# kalender
$tpl->set('calender', getCalendar($month,$year, 'index.php?kalender-v1-m{mon}-y{jahr}-d{tag}', 'index.php?kalender-v'.$view.'-m{mon}-y{jahr}', $data));
$tpl->out(3);
$design->footer();
?>
die template:
<!-- Kalender Script © by Nickel -->
<table width="100%" cellpadding="0" border="0" cellspacing="0">
<tr>
<td width="100%" valign="top">
<table width="100%" cellpadding="3" border="0" cellspacing="1" class="border">
<tr class="Chead">
<td {TITLE_ALIGN} colspan="3"><b>{TITLE}</b></td>
</tr>
{EXPLODE}
<tr class="{LIST_CLASS}">
<td align="center" valign="top" width="25" nowrap="nowrap">{LIST_I}</td>
<td align="center" valign="top" width="25" nowrap="nowrap">{LIST_D}</td>
<td width="100%">{LIST_T}</td>
</tr>
{EXPLODE}</table>
<table width="100%" cellpadding="3" border="0" cellspacing="1" class="border">
<tr class="Chead">
<td {TITLE_ALIGN} colspan="3"><b>{TITLE2}</b></td>
</tr>
{EXPLODE}
<tr class="{LIST_CLASS}">
<td align="center" valign="top" width="25" nowrap="nowrap">{LIST2_I}</td>
<td align="center" valign="top" width="25" nowrap="nowrap">{LIST2_D}</td>
<td width="100%">{LIST2_T}</td>
</tr>
{EXPLODE}
</table>
<table width="100%" cellpadding="3" border="0" cellspacing="1" class="border">
<tr class="Chead">
<td {TITLE_ALIGN} colspan="3"><b>{TITLE3}</b></td>
</tr>
{EXPLODE}
<tr class="{LIST_CLASS}">
<td align="center" valign="top" width="25" nowrap="nowrap">{LIST3_I}</td>
<td align="center" valign="top" width="25" nowrap="nowrap">{LIST3_D}</td>
<td width="100%">{LIST3_T}</td>
</tr>
{EXPLODE}
</table>
<table width="100%" cellpadding="3" border="0" cellspacing="1" class="border">
<tr class="Cmite">
<td colspan="3"><font style="font-size: 10px">{DEATIL_DATE}</font></td>
</tr>
<tr class="Cnorm">
<td colspan="3">{DEATIL_TEXT}</td>
</tr>
<tr class="Cnorm">
<td colspan="3" align="center"><a href="javascript:history.back()">{_lang_back}</a></td>
</tr>
{EXPLODE}
</table>
</td>
</tr>
</table>
<!-- Kalender Script © by Nickel -->
bitte bitte helft uns!
Zuletzt modifiziert von kwinzi85 am 20.02.2008 - 02:17:41