'; // Show the mini-blocks if they're enabled. if (empty($context['blocks_disabled'])) echo '
', $date['date_local'], ': '; unset($date['date_local']); $birthdays = array(); foreach ($date as $member) $birthdays[] = '' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . ''; echo implode(', ', $birthdays); echo '
'; } echo ''; $holidays = array(); foreach ($calendar_data['holidays'] as $date) { $date_local = $date['date_local']; unset($date['date_local']); foreach ($date as $holiday) $holidays[] = $holiday . ' (' . $date_local . ')'; } echo implode(', ', $holidays); 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'])) { $classes[] = !empty($day['is_today']) ? 'calendar_today' : 'windowbg'; // Additional classes are given for events, holidays, and birthdays. foreach (array('events', 'holidays', 'birthdays') as $event_type) if (!empty($day[$event_type])) $classes[] = $event_type; } 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'], '';
elseif ($is_mini)
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)
{
// 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']))
{
// Sort events by start time (all day events will be listed first)
uasort(
$day['events'],
function($a, $b)
{
if ($a['start_timestamp'] == $b['start_timestamp'])
return 0;
return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
}
);
echo '
(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), '), '; ++$birthday_count; } if ($use_js_hide) echo ' '; 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 (empty($current_month_started) && !empty($context['calendar_grid_prev']))
echo '', $context['calendar_grid_prev']['last_of_month'] - $calendar_data['shift']-- +1, '';
elseif (!empty($current_month_started) && !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) { $event_icons_needed = ($event['can_edit'] || $event['can_export']) ? true : false; echo '
', $event['link'], ' ';
}
echo '
'; if (!empty($event['start_time_local']) && $event['starts_today'] == true) echo trim(str_replace(':00 ', ' ', $event['start_time_local'])); elseif (!empty($event['end_time_local']) && $event['ends_today'] == true) echo strtolower($txt['ends']), ' ', trim(str_replace(':00 ', ' ', $event['end_time_local'])); elseif (!empty($event['allday'])) echo $txt['calendar_allday']; echo ' '; if (!empty($event['location'])) echo ' ' . $event['location'] . ''; if ($event['can_edit'] || $event['can_export']) { echo ' '; // 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 ' '; } echo ' | ';
++$count;
}
echo '
', $txt['calendar_day'], ' | '; if (!empty($calendar_data['show_events'])) echo '', $txt['events'], ' | '; if (!empty($calendar_data['show_holidays'])) echo '', $txt['calendar_prompt'], ' | '; if (!empty($calendar_data['show_birthdays'])) echo '', $txt['birthdays'], ' | '; echo '
---|---|---|---|
'; // 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 ' | '; if (!empty($calendar_data['show_events'])) { echo '';
// Show any events...
if (!empty($day['events']))
{
// Sort events by start time (all day events will be listed first)
uasort(
$day['events'],
function($a, $b)
{
if ($a['start_timestamp'] == $b['start_timestamp'])
return 0;
return ($a['start_timestamp'] < $b['start_timestamp']) ? -1 : 1;
}
);
foreach ($day['events'] as $event)
{
echo '
';
$event_icons_needed = ($event['can_edit'] || $event['can_export']) ? true : false;
echo $event['link'], ' ';
}
if (!empty($context['can_post']))
{
echo '
'; if (!empty($event['start_time_local'])) echo trim($event['start_time_local']), !empty($event['end_time_local']) ? ' – ' . trim($event['end_time_local']) : ''; else echo $txt['calendar_allday']; echo ' '; if (!empty($event['location'])) echo ' ' . $event['location'] . ''; if (!empty($event_icons_needed)) { echo ' '; // 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 ' '; } echo ' '; } } else { if (!empty($context['can_post'])) echo ' '; } echo ' | ';
}
if (!empty($calendar_data['show_holidays']))
{
echo '
';
// Show any holidays!
if (!empty($day['holidays']))
echo implode(' ', $day['holidays']); echo ' | ';
}
if (!empty($calendar_data['show_birthdays']))
{
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 ' | ';
}
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 ' |