terms('day-shortest'); $marray = e107::getDate()->terms('month'); // what day does the week start on? switch($ws) { case "monday": $ws = "1"; break; case "sunday": array_unshift($darray, array_pop($darray)); $ws = "0"; } // what's the padding we should use for the cells? $padding = (isset($pref['blogcal_padding']) && $pref['blogcal_padding']) ? $pref['blogcal_padding']: "2"; $date = mktime(0, 0, 0, $req_month, 1, $req_year); $last_day = date('t', $date); $date_info = getdate($date); $day_of_week = $date_info['wday']; if ($ws && $day_of_week == 0) { $day_of_week = 7; } // print the daynames $calendar = ""; $calendar .= ''; foreach($darray as $dheader) { $calendar .= ""; } $calendar .= ""; $calendar .= ''; $day_of_month = 1; $tablerow = 1; // take care of the first "empty" days of the month if ($day_of_week-$ws > 0) { $calendar .= ""; } // print the days of the month (take the $ws into account) while ($day_of_month <= $last_day) { if ($day_of_week-$ws == 7) { #start a new week $calendar .= ""; $day_of_week = 0+$ws; $tablerow++; } if ($day_of_month == $req_day) { $day_style = isset($links[$day_of_month]) ? "indent blogcalendar-day-active" : "forumheader3 blogcalendar-day"; } else { $day_style = isset($links[$day_of_month]) ? "indent blogcalendar-day-active " : "forumheader3 blogcalendar-day"; } $label_style = isset($links[$day_of_month]) ? 'label label-info' : ''; //TODO A pref in admin to choose between info, danger, etc. $calendar .= ""; $day_of_month++; $day_of_week++; } if ($day_of_week-$ws != 7) { $calendar .= ''; } $calendar .= ""; if ($tablerow != 6) { $calendar .= ""; } $calendar .= "
$dheader
 
"; $calendar .= isset($links[$day_of_month]) ? "":""; $calendar .= ""; $calendar .= $day_of_month; $calendar .= ""; $calendar .= isset($links[$day_of_month]) ? "" : ""; $calendar .= " 
 
"; // $calendar .= "tablerow = ".$tablerow; if(deftrue('BOOTSTRAP')) { $active = date("n-Y") == ($req_month."-".$req_year) ? 'active' : ''; $text = "
"; $text .= "
".$marray[$req_month]." ".$req_year."
"; $text .= $calendar; $text .= "
"; } else // BC { $text = $calendar; } return $text; } ?>