'; // Show the mini-blocks if they're enabled. if (empty($context['blocks_disabled'])) { echo '
'; // Now, loop through each actual day of the week. foreach ($calendar_data['week_days'] as $day) { echo ' | ', !empty($calendar_data['short_day_titles']) || $is_mini === true ? $txt['days_short'][$day] : $txt['days'][$day], ' | '; } echo '
---|---|
» | '; } // Now loop through each day in the week we're on. foreach ($week['days'] as $day) { // What classes should each day inherit? Day is default. $classes = array('days'); if (!empty($day['day'])) { // Default Classes (either compact or comfortable and either calendar_today or windowbg). $classes[] = !empty($calendar_data['size']) && $calendar_data['size'] == 'small' ? 'compact' : 'comfortable'; $classes[] = !empty($day['is_today']) ? 'calendar_today' : 'windowbg'; // Additional classes are given for events, holidays, and birthdays. if (!empty($day['events']) && !empty($calendar_data['highlight']['events'])) { if ($is_mini === true && in_array($calendar_data['highlight']['events'], array(1,3))) $classes[] = 'events'; elseif ($is_mini === false && in_array($calendar_data['highlight']['events'], array(2,3))) $classes[] = 'events'; } if (!empty($day['holidays']) && !empty($calendar_data['highlight']['holidays'])) { if ($is_mini === true && in_array($calendar_data['highlight']['holidays'], array(1,3))) $classes[] = 'holidays'; elseif ($is_mini === false && in_array($calendar_data['highlight']['holidays'], array(2,3))) $classes[] = 'holidays'; } if (!empty($day['birthdays']) && !empty($calendar_data['highlight']['birthdays'])) { if ($is_mini === true && in_array($calendar_data['highlight']['birthdays'], array(1,3))) $classes[] = 'birthdays'; elseif ($is_mini === false && in_array($calendar_data['highlight']['birthdays'], array(2,3))) $classes[] = 'birthdays'; } } else $classes[] = 'disabled'; // Now, implode the classes for each day. echo '';
// If it's within this current month, go ahead and begin.
if (!empty($day['day']))
{
// If it's the first day of this month and not a mini-calendar, we'll add the month title - whether short or full.
$title_prefix = !empty($day['is_first_of_month']) && $context['current_month'] == $calendar_data['current_month'] && $is_mini === false ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$calendar_data['current_month']] . ' ' : $txt['months_titles'][$calendar_data['current_month']] . ' ') : '';
// The actual day number - be it a link, or just plain old text!
if (!empty($modSettings['cal_daysaslink']) && $context['can_post'])
echo '', $title_prefix, $day['day'], '';
else
echo '', $title_prefix, $day['day'], '';
// A lot of stuff, we're not showing on mini-calendars to conserve space.
if ($is_mini === false)
{
// If this is the first day of a week and we're showing week numbers, go ahead and do so now.
if ($day['is_first_day'] && !empty($context['tpl_show_week_num']))
echo ' - ', $txt['calendar_week'], ' ', $week['number'], '';
// Holidays are always fun, let's show them!
if (!empty($day['holidays']))
echo ' ', $txt['calendar_prompt'], ' ', implode(', ', $day['holidays']), ' ';
// Happy Birthday Dear, Member!
if (!empty($day['birthdays']))
{
echo '
', $txt['birthdays'], '';
/* Each of the birthdays has:
id, name (person), age (if they have one set?), and is_last. (last in list?) */
$use_js_hide = empty($context['show_all_birthdays']) && count($day['birthdays']) > 15;
$birthday_count = 0;
foreach ($day['birthdays'] as $member)
{
echo '', $member['name'], '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', ';
// 9...10! Let's stop there.
if ($birthday_count == 10 && $use_js_hide)
// !!TODO - Inline CSS and JavaScript should be moved.
echo '... ';
}
// Any special posted events?
if (!empty($day['events']))
{
echo '
(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ') '; echo '
', $txt['events'], ' ';
}
}
$current_month_started = $count;
}
// Otherwise, assuming it's not a mini-calendar, we can show previous / next month days!
elseif ($is_mini === false)
{
if ($current_month_started === false && !empty($context['calendar_grid_prev']))
echo '', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- + 1, '';
elseif (!empty($context['calendar_grid_next']))
echo '', $current_month_started + 1 == $count ? (!empty($calendar_data['short_month_titles']) ? $txt['months_short'][$context['calendar_grid_next']['current_month']] . ' ' : $txt['months_titles'][$context['calendar_grid_next']['current_month']] . ' ') : '', $final_count++, '';
}
// Close this day and increase var count.
echo ''; /* The events are made up of: title, href, is_last, can_edit (are they allowed to?), and modify_href. */ foreach ($day['events'] as $event) { // If they can edit the event, show an icon they can click on.... if ($event['can_edit']) { echo ' '; } // Exporting! if ($event['can_export']) { echo ' '; } echo $event['is_selected'] ? ' ' . $event['link'] . ' ' : $event['link'], $event['is_last'] ? '' : ''; } echo ' | ';
++$count;
}
echo '
', $txt['calendar_day'], ' | ', $txt['events'], ' | ', $txt['calendar_prompt'], ' | ', $txt['birthdays'], ' |
---|---|---|---|
'; // Should the day number be a link? if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) echo '', $txt['days'][$day['day_of_week']], ' - ', $day['day'], ''; else echo $txt['days'][$day['day_of_week']], ' - ', $day['day']; echo ' | ';
// Show any events...
if (!empty($day['events']))
{
echo ' ';
foreach ($day['events'] as $event)
{
// If they can edit the event, show a star they can click on....
if (!empty($event['can_edit']))
{
echo '
';
}
// Can we export? Sweet.
if (!empty($event['can_export']))
{
echo '
';
}
echo $event['link'], $event['is_last'] ? '' : '
'; } echo ' '; } else { if (!empty($context['can_post'])) { echo ' '; } } echo ' |
';
// Show any holidays!
if (!empty($day['holidays']))
echo implode(' ', $day['holidays']); echo ' |
';
// Show any birthdays...
if (!empty($day['birthdays']))
{
foreach ($day['birthdays'] as $member)
{
echo '
', $member['name'], '
', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '
', $member['is_last'] ? '' : ' '; } } echo ' |
BCD Clock | |||||
---|---|---|---|---|---|
';
foreach ($v as $i)
{
echo ' '; } echo ' | ';
$alt = !$alt;
}
echo '|||||
Are you hardcore? |
Binary Clock |
---|
'; foreach ($v as $i) { echo ''; } echo ' |
Too tough for you? |
OMFG Binary Clock |
---|
'; foreach ($v as $i) { echo ''; } echo ' |
The time you requested |
---|
'; foreach ($v as $i) { echo ''; } echo ' |