".$months[$datearray[mon]-1]." ".$current_year.""; // ----------------------------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------------------- // show events------------------------------------------------------------------------------------------- // get first and last days of month in unix format--------------------------------------------------- $monthstart= mktime(0,0,0,$month,1,$year); $firstdayarray = getdate($monthstart); $monthend = mktime(0,0,0,$month+1,1,$year); $lastdayarray = getdate($monthend); // ---------------------------------------------------------------------------------------------------------- // echo current month with links to previous/next months ---------------------------------------- $prevmonth = ($month-1); $prevyear = $year; if ($prevmonth == 0) { $prevmonth = 12; $prevyear = ($year-1); } $previous = mktime(0,0,0,$prevmonth,1, $prevyear); $nextmonth = ($month+1); $nextyear = $year; if ($nextmonth == 13) { $nextmonth = 1; $nextyear = ($year+1); } $next = mktime(0,0,0,$nextmonth,1, $nextyear); $py = $year-1; $prevlink = mktime(0,0,0,$month,1, $py); $ny = $year+1; $nextlink = mktime(0,0,0,$month,1, $ny); $cal_text = "
<< ".$months[($prevmonth-1)]." ".$months[($month-1)]." ".$year." ".$months[($nextmonth-1)]." >>
<< ".$py." "; for ($ii = 0; $ii < 13; $ii++){ $m = $ii+1; $monthjump= mktime(0,0,0,$m,1,$year); $cal_text .= "".$monthabb[$ii]." "; } $cal_text .= " ".$ny." >>
"; $cal_text .= "
"; $prop = mktime(0,0,0,$month, 1, $year); $nowarray = getdate(); $nowmonth = $nowarray['mon']; $nowyear = $nowarray['year']; $nowday = $nowarray['mday']; $current = mktime(0,0,0,$nowmonth, 1, $nowyear); ##### Check for access. //------------ Navigation Buttons. ------------------------------------------------------ $nav_text = "
"; if(check_class($pref['eventpost_admin']) || getperms('0')){ // start no admin preference $nav_text .= ""; } // end admin preference activated. $nav_text .= "

"; //-------------------------------------------------------------------------------- if ($month != $nowmonth || $year != $nowyear) { $nav_text .= " ".EC_LAN_40.""; } $nav_text .= "

"; // get events from current month---------------------------------------------------------------------- $sql -> db_Select("event", "*", "(event_start>='$monthstart' AND event_start<= '$monthend') ORDER BY event_start ASC"); while ($row = $sql -> db_Fetch()) { extract($row); $evf = getdate($event_start); $tmp = $evf['mday']; $eve = getdate($event_end); $tmp2 = $eve['mday']; $cevent_title[$tmp] = $event_title; $event_true[$tmp] = $event_start; for ($i=($tmp+1); $i<($tmp2+1); $i++) { $event_true_end[$i] = $i != $tmp2 ? 1:2; $cevent_title[$i] = $event_title; } } // ----------------------------------------------------------------------------------------------------------- $start = $monthstart; $text .= "
"; foreach($week as $day){ $text .= ""; } $text .= ""; $calmonth = $datearray['mon']; $calday = $datearray['mday']; $calyear = $datearray['year']; for ($c=0; $c<$firstdayarray['wday']; $c++) { $text .= ""; } $loop = $firstdayarray['wday']; for ($c=1; $c<=31; $c++) { $dayarray = getdate($start+(($c-1)*86400)); $stopp = mktime(24,0,0,$calmonth,$c,$calyear); $startt = mktime(0,0,0,$calmonth,$c,$calyear); $sql2 = new db; $sql2 -> db_Select("event_cat", "*", "event_cat_id!='' "); while($event_cat = $sql2-> db_Fetch()){ extract($event_cat); $category_icon[$event_cat_id]= $event_cat_icon; $category_title[$event_cat_id]= $event_cat_name; } $sql -> db_Select("event", "*", "event_start>='$startt' AND event_start<='$stopp' ORDER BY event_start"); $events = $sql -> db_Rows(); // Highlight the current day. if ($dayarray['mon'] == $calmonth) { if ($nowday == $c && $calmonth == $nowmonth && $calyear == $nowyear && !$event_true[($c)]&& !$event_true_end[($c)]) { $text .="'; } $loop++; if ($loop == 7) { $loop = 0; $text .= ''; } } $text .= "
".$day."
"; $text .="
".$c." [today]
"; } elseif($event_true[($c)] || $event_true_end[($c)]) { $text .="
"; $text .=" ".$c." "; }else { $text .=""; $text .=" ".$c." "; } if ($event_true_end[($c)]) { $indicat = $event_true_end[($c)]==1? "->":"|"; $text .="
 ".$cevent_title[$c]."".$indicat; } while($row = $sql -> db_Fetch()){ extract($row); $event_title = $cevent_title[$c]; if (strlen($event_title) > 9){ $oevent_title = substr($event_title,0,10)."
".substr($event_title,10,9); if (strlen($event_title) > 15){ $oevent_title .= ".."; } } else { $oevent_title = $event_title; } if ($event_true[($c)]) { $linkut = mktime(0 ,0 ,0 ,$datearray['mon'], $c, $datearray['year']); if(($_POST['do'] == NULL || $_POST['event_cat_ids'] == "all") || ($_POST['event_cat_ids'] == $event_cat_id)){ $text .="
  ".$oevent_title." "; } } } $text .= '
"; $caption = EC_LAN_79; // "Calendar View"; $nav = $cal_text .$nav_text. $text; $ns -> tablerender($caption, $nav); // echo $text; require_once(FOOTERF); ?>