Пример #1
0
    echo CALENDAR_siteFooter();
    exit;
}
if (isset($_POST['savecal'])) {
    echo CALENDAR_siteHeader();
    echo plugin_savesubmission_calendar($_POST);
    echo CALENDAR_siteFooter();
    exit;
}
if ($mode != 'personal' && $mode != 'quickadd') {
    $mode = '';
}
if ($mode == 'personal') {
    $display .= CALENDAR_siteHeader($LANG_CAL_1[42]);
} else {
    $display .= CALENDAR_siteHeader($LANG_CAL_1[41]);
}
// Set mode back to master if user refreshes screen after their session expires
if ($mode == 'personal' && COM_isAnonUser()) {
    $mode = '';
}
if ($mode == 'personal' and $_CA_CONF['personalcalendars'] == 0) {
    // User is trying to use the personal calendar feature even though it isn't
    // turned on.
    $display .= $LANG_CAL_2[37];
    $display .= CALENDAR_siteFooter();
    echo $display;
    exit;
}
// after this point, we can safely assume that if $mode == 'personal',
// the current user is actually allowed to use this personal calendar
Пример #2
0
     }
     $month = 0;
     if (isset($_GET['month'])) {
         $month = COM_applyFilter($_GET['month'], true);
     }
     $day = 0;
     if (isset($_GET['day'])) {
         $day = COM_applyFilter($_GET['day'], true);
     }
     if ($year == 0 || $month == 0 || $day == 0) {
         $year = date('Y');
         $month = date('n');
         $day = date('j');
     }
     $pagetitle = $LANG_CAL_2[10] . ' ' . strftime('%x', mktime(0, 0, 0, $month, $day, $year));
     $display .= CALENDAR_siteHeader($pagetitle);
     $display .= COM_startBlock($pagetitle);
     $thedate = sprintf('%4d-%02d-%02d', $year, $month, $day);
     $datesql = "SELECT * FROM {$_TABLES['events']} " . "WHERE \"{$thedate}\" BETWEEN DATE_FORMAT(datestart,'%Y-%m-%d') " . "and DATE_FORMAT(dateend,'%Y-%m-%d') " . "ORDER BY datestart ASC,timestart ASC,title";
 }
 $cal_templates = new Template($_CONF['path'] . 'plugins/calendar/templates/');
 $cal_templates->set_file(array('events' => 'events.thtml', 'details' => 'eventdetails.thtml', 'addremove' => 'addremoveevent.thtml'));
 $cal_templates->set_var('xhtml', XHTML);
 if ($mode != 'personal') {
     if ($_CA_CONF['only_admin_submit'] == 1) {
         if (SEC_hasRights('calendar.edit')) {
             $cal_templates->set_var('lang_addevent', $LANG_CAL_1[6]);
         }
     } else {
         $cal_templates->set_var('lang_addevent', $LANG_CAL_1[6]);
     }