// // ------------------------------------------------------------------------- // // Original Author: Nobse, Bama // Author Website : http://www.e-xoops.de, http://service.bama-webdesign.de // License Type : GPL: See /manual/LICENSES/GPL.txt // ------------------------------------------------------------------------- // include("header.php"); include(XOOPS_ROOT_PATH."/modules/ecal/cache/config.php"); if ($user_remind == 1) { include_once("include/remind_mail.php"); remindmail(); } $mytree = new XoopsTree($db->prefix("ecal_cat"), "cid", "pid"); $month = !empty($_POST['month']) ? $_POST['month'] : $_GET['month']; $year = !empty($_POST['year']) ? $_POST['year'] : $_GET['year']; $bcoosConfig['title'] .= " - "._CAL_ENDEVENT; if($bcoosConfig['startpage'] == "ecal"){ $xoopsOption['show_rblock'] =1; include(XOOPS_ROOT_PATH."/header.php"); make_cblock(); echo "
"; }else{ $xoopsOption['show_rblock'] =0; include(XOOPS_ROOT_PATH."/header.php"); } OpenTable(); $useroffset = ""; if ($xoopsUser) { $useroffset = $xoopsUser->getVar("timezone_offset"); } else { $useroffset = $bcoosConfig['default_TZ']; } $usertimevent = (time() + (($useroffset - ($bcoosConfig['server_TZ'] - date('I'))) * 3600)); $currentday = date("j", $usertimevent); $currentmonth = date("m", $usertimevent); $currentyear = date("Y", $usertimevent); $lastday = 1; if (!$month) { $month = date("m", $usertimevent); $year = date("Y", $usertimevent); } $Date = date('F', mktime(0,0,0,$month,1,$year)); if ($beginn == 0) { $firstday = date( 'w', mktime(0,0,0,$month,1,$year)); }else { $firstday = (date( 'w', mktime(0,0,0,$month,1,$year))+6)%7; } while (checkdate($month,$lastday,$year)) { $lastday++; } $nextmonth = $month+1; $nextyear = $year; if ($nextmonth == 13) { $nextmonth = 1; $nextyear = $year + 1; } $lastmonth = $month-1; $lastyear = $year; if ($lastmonth == 0) { $lastmonth = 12; $lastyear = $year-1; } // Array Termine *********** $result1=$db->query("SELECT subject,stamp,privat,username FROM ".$db->prefix("ecal")." WHERE stamp >= \"$year-$month-01 00:00:00\" AND stamp <=\"$year-$month-31 23:59:00\" AND valid='yes' order by stamp DESC"); while ( list($subject,$stamp,$privat,$username) = $db->fetchRow($result1) ){ $jahr = substr($stamp,0,4); $monat = substr($stamp,5,2); if (substr($stamp,8,1) == 0) { $tag = substr($stamp,9,1); } else { $tag = substr($stamp,8,2); } if ($zaehler[$tag] < 4) { if ($xoopsUser) { if ($privat == 1 and $username == $xoopsUser->uname()) { $text[$tag] .= ""; $text[$tag] .= ""._CAL_TERMIN." ".$subject."
"; } } if($privat == 0) { $text[$tag] .= ""; $text[$tag] .= ""._CAL_TERMIN." ".$subject."
"; } $zaehler[$tag] = $zaehler[$tag]+1; } else { $zaehler[$tag] = $zaehler[$tag]+1; } if ($zaehler[$tag] == 5) { $text[$tag] .= ""; $text[$tag] .= _CAL_WEITER.""; $zaehler[$tag] = $zaehler[$tag]+1; } } //End Array ***************** // NEWS Array ************** if ($shownews ==1) { $result=$db->query("SELECT storyid, published, title FROM ".$db->prefix("stories")." WHERE published >= ".strtotime("$year/$month/1")." and published <= ".strtotime("$year/$month/31 23:59:59")." and published <= ". time().""); while (list( $storyid, $published, $title) = $db->fetchRow($result)){ $ist = date("j",$published); //$newsid[$ist] .= $storyid; $text[$ist] .= ""._CAL_NEWS." $title
"; } } //**************************** define("_NAVPAGE","MON"); include ("include/nav.php"); echo "
"._CALMONTH."

"; echo ""; echo "
"; form_last_month($lastmonth, $lastyear, $pid); echo "
"; echo " 
 "; form_next_month($nextmonth, $nextyear, $pid); echo "
"; echo ""; if ($beginn == 0) { echo ""; }else { echo ""; } for ($i=0; $i<7; $i++) { if ($i < $firstday) { echo ""; } else { $thisday = ($i+1)-$firstday; //$h11 = $thisday - $firstday; $xy = strtotime("$year/$month/$thisday"); $wochentag = date("l", $xy); if ($currentyear > $year) { if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; } } echo "\n"; $nextday = ($i+1)-$firstday; for ($j = 0; $j<5; $j++) { //echo ""; for ($k = 0; $k<7; $k++) { if ($nextday < $lastday) { $xy = strtotime("$year/$month/$nextday"); $wochentag = date("l", $xy); if ($currentyear > $year) { if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; $nextday++; } } echo "\n"; } echo "
"._SUN.""._MON." "._TUE.""._WED." "._THU.""._FRI." "._SAT."
"._MON.""._TUE." "._WED.""._THU." "._FRI.""._SAT." "._SUN."
"; }else{ echo " $month && $currentyear == $year) { if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; }else{ echo ""; } } else if ($currentmonth == $month && $currentday > $thisday && $currentyear == $year) { if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; }else{ echo ""; } } else if ($currentmonth == $month && $currentday == $thisday && $currentyear == $year) { echo ""; } else if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; }else { echo ""; } echo "$thisday

"; if ($text[$thisday] == "") { echo "




"; } else { echo $text[$thisday]; } echo "
"; }else{ echo ""; } } else if ($currentmonth > $month && $currentyear == $year) { if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; }else{ echo ""; } } else if ($currentmonth == $month && $currentday > $nextday && $currentyear == $year) { if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; }else{ echo ""; } } else if ($currentmonth == $month && $currentday == $nextday && $currentyear == $year) { echo ""; } else if ($wochentag == "Saturday" or $wochentag == "Sunday") { echo ""; }else { echo ""; } echo "$nextday

"; if ($text[$nextday] == "") { echo "




"; } else { echo $text[$nextday]; } echo "
"; echo ""; } else { echo ""; } echo "
"; form_last_month($lastmonth, $lastyear, $pid); if ($xoopsUser) { $group = $xoopsUser->groups(); }else{ $group[] = 3; } $anno = explode("|", $anoevent); $is = array_intersect ($group, $anno); if (count($is) > 0) { echo ""; form_add_event($month, $year); echo " "; form_next_month($nextmonth, $nextyear, $pid); echo "
"; CloseTable(); include(XOOPS_ROOT_PATH."/footer.php"); ?>