本文整理匯總了PHP中calendar::event_is_subscribed方法的典型用法代碼示例。如果您正苦於以下問題:PHP calendar::event_is_subscribed方法的具體用法?PHP calendar::event_is_subscribed怎麽用?PHP calendar::event_is_subscribed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類calendar
的用法示例。
在下文中一共展示了calendar::event_is_subscribed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: calendar
*/
//date('Ymd', time())
require "../../Group-Office.php";
if ($calendar_module = $GO_MODULES->get_module('calendar')) {
require $calendar_module['path'] . "classes/calendar.class.inc";
}
$cal = new calendar();
require $GO_LANGUAGE->get_language_file('calendar');
//echo '1=='.$_REQUEST['event_id'];
$getevent = $cal->get_event($_REQUEST['event_id']);
//echo '2=='.$getevent['end_time'].'-->'.time();
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if (isset($_POST['calendars'])) {
$cal->set_event_status($_REQUEST['event_id'], '1', $_POST['email']);
while ($calendar_id = array_shift($_POST['calendars'])) {
if (!$cal->event_is_subscribed($_POST['event_id'], $calendar_id)) {
if ($cal->subscribe_event($_POST['event_id'], $calendar_id)) {
if (!$cal->set_event_status($_POST['event_id'], '1', $_POST['email'])) {
$error = true;
}
} else {
$error = true;
}
}
}
require $GO_THEME->theme_path . 'header.inc';
require_once $GO_CONFIG->root_path . 'lib/tkdlib.php';
if ($getevent['end_time'] <= time()) {
alert($sc_no_ok_in_past);
}
echo '<table border="0" cellpadding="10" cellspacing="0"><tr><td><h1>' . $sc_accept_title . '</h1>';
示例2: calendar
$GO_SECURITY->add_group_to_acl($GO_CONFIG->group_everyone, $acl_read);
break;
case 'everybody_write':
$GO_SECURITY->add_group_to_acl($GO_CONFIG->group_everyone, $acl_write);
break;
}
}
}
if (!isset($feedback)) {
//enter the event in all selected calendars
$cal2 = new calendar();
$cal->get_authorised_calendars($GO_SECURITY->user_id);
while ($cal->next_record()) {
if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $cal->f('acl_write'))) {
if (in_array($cal->f('id'), $_POST['calendars'])) {
if (!$cal2->event_is_subscribed($event_id, $cal->f('id'))) {
$cal2->subscribe_event($event_id, $cal->f('id'));
}
} else {
if ($cal2->event_is_subscribed($event_id, $cal->f('id'))) {
$cal2->unsubscribe_event($event_id, $cal->f('id'));
}
}
}
}
//set the reminder
if ($_POST['reminder'] > 0) {
$next_recurrence_time = $cal->get_next_recurrence_time($event_id);
$remind_time = $next_recurrence_time - $_POST['reminder'];
$cal->insert_reminder($GO_SECURITY->user_id, $event_id, $remind_time);
}