Example #1
0
File: index.php Project: rair/yacs
include_once '../shared/global.php';
include_once 'dates.php';
// load the skin
load_skin('dates');
// the title of the page
$context['page_title'] = i18n::s('Dates');
// count dates in the database
$stats = Dates::stat();
if ($stats['count']) {
    $context['page_menu'] += array('_count' => sprintf(i18n::ns('%d date', '%d dates', $stats['count']), $stats['count']));
}
// page main content
$cache_id = 'dates/index.php#text';
if (!($text = Cache::get($cache_id))) {
    // get and draw upcoming events with links to global calendars
    if ($items =& Dates::list_future(0, 200, 'links')) {
        $text = Dates::build_months($items, TRUE);
    } else {
        $text = i18n::s('No event has been planned so far');
    }
    // cache, whatever changes, for 1 minute
    Cache::put($cache_id, $text, 'stable', 60);
}
$context['text'] .= $text;
// page tools
if (Surfer::is_associate()) {
    $context['page_tools'][] = Skin::build_link('dates/check.php', i18n::s('Maintenance'), 'basic');
}
// subscribe to this calendar
if (!isset($context['skins_general_without_feed']) || $context['skins_general_without_feed'] != 'Y') {
    $lines = array();