', template_show_month_grid('prev'), ' ', template_show_month_grid('current'), ' ', template_show_month_grid('next'), '
', $context['view_week'] ? template_show_week_grid('main') : template_show_month_grid('main'); // Build the calendar button array. $calendar_buttons = array( 'post_event' => array('test' => 'can_post', 'text' => 'calendar_post_event', 'image' => 'calendarpe.png', 'lang' => true, 'url' => $scripturl . '?action=calendar;sa=post;month=' . $context['current_month'] . ';year=' . $context['current_year'] . ';' . $context['session_var'] . '=' . $context['session_id']), ); template_button_strip($calendar_buttons, 'right'); // Show some controls to allow easy calendar navigation. echo '
'; echo '

'; } // Template for posting a calendar event. function template_event_post() { global $context, $settings, $options, $txt, $scripturl, $modSettings; // Start the javascript for drop down boxes... echo '
'; if (!empty($context['event']['new'])) echo ' '; // Start the main table. echo '

', $context['page_title'], '

'; if (!empty($context['post_error']['messages'])) { echo '
', $context['error_type'] == 'serious' ? '' . $txt['error_while_submitting'] . '' : '', '
', implode('
', $context['post_error']['messages']), '
'; } echo '
', $txt['calendar_event_title'], '
', $txt['calendar_year'], ' ', $txt['calendar_month'], ' ', $txt['calendar_day'], '
'; if (!empty($modSettings['cal_allowspan']) || $context['event']['new']) echo '
', $txt['calendar_event_options'], '
    '; // If events can span more than one day then allow the user to select how long it should last. if (!empty($modSettings['cal_allowspan'])) { echo '
  • ', $txt['calendar_numb_days'], '
  • '; } // If this is a new event let the user specify which board they want the linked post to be put into. if ($context['event']['new']) { echo '
  • ', $txt['calendar_link_event'], '
  • ', $txt['calendar_post_in'], '
  • '; } if (!empty($modSettings['cal_allowspan']) || $context['event']['new']) echo '
'; echo '
'; // Delete button? if (empty($context['event']['new'])) echo ' '; echo '

'; } // Display a monthly calendar grid. function template_show_month_grid($grid_name) { global $context, $settings, $options, $txt, $scripturl, $modSettings, $smcFunc; if (!isset($context['calendar_grid_' . $grid_name])) return false; $calendar_data = &$context['calendar_grid_' . $grid_name]; $colspan = !empty($calendar_data['show_week_links']) ? 8 : 7; if (empty($calendar_data['disable_title'])) { echo '

'; if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev']) echo ' «'; if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev']) echo ' »'; if ($calendar_data['show_next_prev']) echo ' ', $txt['months_titles'][$calendar_data['current_month']], ' ', $calendar_data['current_year']; else echo ' ', $txt['months_titles'][$calendar_data['current_month']], ' ', $calendar_data['current_year'], ''; echo '

'; } echo ' '; // Show each day of the week. if (empty($calendar_data['disable_day_titles'])) { echo ' '; if (!empty($calendar_data['show_week_links'])) echo ' '; foreach ($calendar_data['week_days'] as $day) { echo ' '; } echo ' '; } /* Each week in weeks contains the following: days (a list of days), number (week # in the year.) */ foreach ($calendar_data['weeks'] as $week) { echo ' '; if (!empty($calendar_data['show_week_links'])) echo ' '; /* Every day has the following: day (# in month), is_today (is this day *today*?), is_first_day (first day of the week?), holidays, events, birthdays. (last three are lists.) */ foreach ($week['days'] as $day) { // If this is today, make it a different color and show a border. echo ' '; } echo ' '; } echo '
 ', !empty($calendar_data['short_day_titles']) ? ($smcFunc['substr']($txt['days'][$day], 0, 1)) : $txt['days'][$day], '
» '; // Skip it if it should be blank - it's not a day if it has no number. if (!empty($day['day'])) { // Should the day number be a link? if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) echo ' ', $day['day'], ''; else echo ' ', $day['day']; // Is this the first day of the week? (and are we showing week numbers?) if ($day['is_first_day'] && $calendar_data['size'] != 'small') echo ' - ', $txt['calendar_week'], ' ', $week['number'], ''; // Are there any holidays? if (!empty($day['holidays'])) echo '
', $txt['calendar_prompt'], ' ', implode(', ', $day['holidays']), '
'; // Show any birthdays... 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; $count = 0; foreach ($day['birthdays'] as $member) { echo ' ', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '', $member['is_last'] || ($count == 10 && $use_js_hide)? '' : ', '; // Stop at ten? if ($count == 10 && $use_js_hide) echo '...
(', sprintf($txt['calendar_click_all'], count($day['birthdays'])), ')
'; echo '
'; } // Any special posted events? if (!empty($day['events'])) { echo '
', $txt['events'], ''; /* 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 a star they can click on.... if ($event['can_edit']) echo ' *'; echo ' ', $event['link'], $event['is_last'] ? '' : ', '; } echo '
'; } } echo '
'; } // Or show a weekly one? function template_show_week_grid($grid_name) { global $context, $settings, $options, $txt, $scripturl, $modSettings; if (!isset($context['calendar_grid_' . $grid_name])) return false; $calendar_data = &$context['calendar_grid_' . $grid_name]; // Loop through each month (At least one) and print out each day. foreach ($calendar_data['months'] as $month_data) { echo '

'; if (empty($calendar_data['previous_calendar']['disabled']) && $calendar_data['show_next_prev'] && empty($done_title)) echo ' «'; if (empty($calendar_data['next_calendar']['disabled']) && $calendar_data['show_next_prev'] && empty($done_title)) echo ' »'; echo ' ', $txt['months_titles'][$month_data['current_month']], ' ', $month_data['current_year'], '', empty($done_title) && !empty($calendar_data['week_number']) ? (' - ' . $txt['calendar_week'] . ' ' . $calendar_data['week_number']) : '', '

'; $done_title = true; echo ' '; foreach ($month_data['days'] as $day) { echo ' '; } echo '

', $txt['days'][$day['day_of_week']], '

'; // Should the day number be a link? if (!empty($modSettings['cal_daysaslink']) && $context['can_post']) echo ' ', $day['day'], ''; else echo ' ', $day['day']; echo ' '; // Are there any holidays? if (!empty($day['holidays'])) echo '
', $txt['calendar_prompt'], ' ', implode(', ', $day['holidays']), '
'; // Show any birthdays... 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?) */ foreach ($day['birthdays'] as $member) echo ' ', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '', $member['is_last'] ? '' : ', '; echo '
'; } // Any special posted events? if (!empty($day['events'])) { echo '
', $txt['events'], ''; /* 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 a star they can click on.... if ($event['can_edit']) echo ' * '; echo ' ', $event['link'], $event['is_last'] ? '' : ', '; } echo '
'; } echo '
'; } } function template_bcd() { global $context, $scripturl; echo ' '; $alt = false; foreach ($context['clockicons'] as $t => $v) { echo ' '; $alt = !$alt; } echo '
BCD Clock
'; foreach ($v as $i) echo '
'; echo '

Are you hardcore?

'; } function template_hms() { global $context, $scripturl; echo ' '; $alt = false; foreach ($context['clockicons'] as $t => $v) { echo ' '; $alt = !$alt; } echo '
Binary Clock
'; foreach ($v as $i) echo ' '; echo '
Too tough for you?
'; echo ' '; } function template_omfg() { global $context, $scripturl; echo ' '; $alt = false; foreach ($context['clockicons'] as $t => $v) { echo ' '; $alt = !$alt; } echo '
OMFG Binary Clock
'; foreach ($v as $i) echo ' '; echo '
'; echo ' '; } function template_thetime() { global $context, $scripturl; echo ' '; $alt = false; foreach ($context['clockicons'] as $t => $v) { echo ' '; $alt = !$alt; } echo '
The time you requested
'; foreach ($v as $i) echo ' '; echo '
'; } ?>