Zeile 227 | Zeile 227 |
---|
$calendar = $db->fetch_array($query);
// Invalid calendar?
|
$calendar = $db->fetch_array($query);
// Invalid calendar?
|
if(!$calendar['cid'])
| if(!$calendar)
|
{ error($lang->invalid_calendar);
|
{ error($lang->invalid_calendar);
|
}
| }
|
// Do we have permission to view this calendar or post events? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1 || $calendar_permissions['canaddevents'] != 1)
|
// Do we have permission to view this calendar or post events? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1 || $calendar_permissions['canaddevents'] != 1)
|
{
| {
|
error_no_permission(); }
|
error_no_permission(); }
|
|
|
add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid'])); add_breadcrumb($lang->nav_addevent);
|
add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid'])); add_breadcrumb($lang->nav_addevent);
|
|
|
$plugins->run_hooks("calendar_addevent_start");
// If MyCode is on for this forum and the MyCode editor is enabled inthe Admin CP, draw the code buttons and smilie inserter.
| $plugins->run_hooks("calendar_addevent_start");
// If MyCode is on for this forum and the MyCode editor is enabled inthe Admin CP, draw the code buttons and smilie inserter.
|
Zeile 249 | Zeile 249 |
---|
{ $codebuttons = build_mycode_inserter("message", $calendar['allowsmilies']); if($calendar['allowsmilies'] == 1)
|
{ $codebuttons = build_mycode_inserter("message", $calendar['allowsmilies']); if($calendar['allowsmilies'] == 1)
|
{
| {
|
$smilieinserter = build_clickable_smilies(); } }
| $smilieinserter = build_clickable_smilies(); } }
|
Zeile 257 | Zeile 257 |
---|
// Previous selections $name = $description = ''; if(isset($mybb->input['name']))
|
// Previous selections $name = $description = ''; if(isset($mybb->input['name']))
|
{
| {
|
$name = htmlspecialchars_uni($mybb->get_input('name'));
|
$name = htmlspecialchars_uni($mybb->get_input('name'));
|
}
| }
|
if(isset($mybb->input['description'])) { $description = htmlspecialchars_uni($mybb->get_input('description'));
| if(isset($mybb->input['description'])) { $description = htmlspecialchars_uni($mybb->get_input('description'));
|
Zeile 272 | Zeile 272 |
---|
$single_month[$number] = $start_month[$number] = $end_month[$number] = $repeats_5_month[$number] = $repeats_5_month2[$number] = ''; } foreach(range(1, 5) as $number)
|
$single_month[$number] = $start_month[$number] = $end_month[$number] = $repeats_5_month[$number] = $repeats_5_month2[$number] = ''; } foreach(range(1, 5) as $number)
|
{
| {
|
$repeats_sel[$number] = ''; } foreach(range(0, 6) as $number)
| $repeats_sel[$number] = ''; } foreach(range(0, 6) as $number)
|
Zeile 411 | Zeile 411 |
---|
$timezone = $mybb->user['timezone']; }
|
$timezone = $mybb->user['timezone']; }
|
$single_years = $start_years = $end_years = '';
// Construct option list for years for($year = my_date('Y'); $year < (my_date('Y') + 5); ++$year) { if($year == $single_year) { $selected = "selected=\"selected\""; eval("\$single_years .= \"".$templates->get("calendar_year")."\";"); } else { $selected = ""; eval("\$single_years .= \"".$templates->get("calendar_year")."\";"); }
if($year == $start_year) { $selected = "selected=\"selected\""; eval("\$start_years .= \"".$templates->get("calendar_year")."\";"); } else { $selected = ""; eval("\$start_years .= \"".$templates->get("calendar_year")."\";"); }
if($year == $end_year) { $selected = "selected=\"selected\""; eval("\$end_years .= \"".$templates->get("calendar_year")."\";"); } else { $selected = ""; eval("\$end_years .= \"".$templates->get("calendar_year")."\";"); } }
$single_days = $start_days = $end_days = '';
// Construct option list for days for($day = 1; $day <= 31; ++$day) { if($day == $single_day) { $selected = "selected=\"selected\""; eval("\$single_days .= \"".$templates->get("calendar_day")."\";"); } else { $selected = ""; eval("\$single_days .= \"".$templates->get("calendar_day")."\";"); }
if($day == $start_day) { $selected = "selected=\"selected\""; eval("\$start_days .= \"".$templates->get("calendar_day")."\";"); } else { $selected = ""; eval("\$start_days .= \"".$templates->get("calendar_day")."\";"); }
if($day == $end_day) { $selected = "selected=\"selected\""; eval("\$end_days .= \"".$templates->get("calendar_day")."\";"); } else { $selected = ""; eval("\$end_days .= \"".$templates->get("calendar_day")."\";"); } }
| $single_years = $start_years = $end_years = '';
// Construct option list for years for($year = my_date('Y'); $year < (my_date('Y') + 5); ++$year) { if($year == $single_year) { $selected = "selected=\"selected\""; eval("\$single_years .= \"".$templates->get("calendar_year")."\";"); } else { $selected = ""; eval("\$single_years .= \"".$templates->get("calendar_year")."\";"); }
if($year == $start_year) { $selected = "selected=\"selected\""; eval("\$start_years .= \"".$templates->get("calendar_year")."\";"); } else { $selected = ""; eval("\$start_years .= \"".$templates->get("calendar_year")."\";"); }
if($year == $end_year) { $selected = "selected=\"selected\""; eval("\$end_years .= \"".$templates->get("calendar_year")."\";"); } else { $selected = ""; eval("\$end_years .= \"".$templates->get("calendar_year")."\";"); } }
$single_days = $start_days = $end_days = '';
// Construct option list for days for($day = 1; $day <= 31; ++$day) { if($day == $single_day) { $selected = "selected=\"selected\""; eval("\$single_days .= \"".$templates->get("calendar_day")."\";"); } else { $selected = ""; eval("\$single_days .= \"".$templates->get("calendar_day")."\";"); }
if($day == $start_day) { $selected = "selected=\"selected\""; eval("\$start_days .= \"".$templates->get("calendar_day")."\";"); } else { $selected = ""; eval("\$start_days .= \"".$templates->get("calendar_day")."\";"); }
if($day == $end_day) { $selected = "selected=\"selected\""; eval("\$end_days .= \"".$templates->get("calendar_day")."\";"); } else { $selected = ""; eval("\$end_days .= \"".$templates->get("calendar_day")."\";"); } }
|
$timezones = build_timezone_select("timezone", $timezone);
if($mybb->get_input('ignoretimezone', MyBB::INPUT_INT) == 1)
| $timezones = build_timezone_select("timezone", $timezone);
if($mybb->get_input('ignoretimezone', MyBB::INPUT_INT) == 1)
|
Zeile 552 | Zeile 552 |
---|
eval("\$addevent = \"".$templates->get("calendar_addevent")."\";"); output_page($addevent);
|
eval("\$addevent = \"".$templates->get("calendar_addevent")."\";"); output_page($addevent);
|
}
| }
|
// Delete an event if($mybb->input['action'] == "do_deleteevent" && $mybb->request_method == "post")
|
// Delete an event if($mybb->input['action'] == "do_deleteevent" && $mybb->request_method == "post")
|
{ $query = $db->simple_select("events", "*", "eid='{$mybb->input['eid']}'"); $event = $db->fetch_array($query);
if(!$event) { error($lang->error_invalidevent); }
$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'"); $calendar = $db->fetch_array($query);
// Invalid calendar? if(!$calendar) { error($lang->invalid_calendar); }
// Do we have permission to view this calendar or post events? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1 || $calendar_permissions['canaddevents'] != 1) { error_no_permission(); }
if(($event['uid'] != $mybb->user['uid'] || $mybb->user['uid'] == 0) && $calendar_permissions['canmoderateevents'] != 1) { error_no_permission(); }
| { $query = $db->simple_select("events", "*", "eid='{$mybb->input['eid']}'"); $event = $db->fetch_array($query);
if(!$event) { error($lang->error_invalidevent); }
$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'"); $calendar = $db->fetch_array($query);
// Invalid calendar? if(!$calendar) { error($lang->invalid_calendar); }
// Do we have permission to view this calendar or post events? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1 || $calendar_permissions['canaddevents'] != 1) { error_no_permission(); }
if(($event['uid'] != $mybb->user['uid'] || $mybb->user['uid'] == 0) && $calendar_permissions['canmoderateevents'] != 1) { error_no_permission(); }
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
$plugins->run_hooks("calendar_do_deleteevent_start");
// Is the checkbox set?
| $plugins->run_hooks("calendar_do_deleteevent_start");
// Is the checkbox set?
|
Zeile 596 | Zeile 596 |
---|
{ $db->delete_query("events", "eid='{$event['eid']}'"); $plugins->run_hooks("calendar_do_deleteevent_end");
|
{ $db->delete_query("events", "eid='{$event['eid']}'"); $plugins->run_hooks("calendar_do_deleteevent_end");
|
|
|
// Redirect back to the main calendar view. redirect("calendar.php", $lang->redirect_eventdeleted); }
| // Redirect back to the main calendar view. redirect("calendar.php", $lang->redirect_eventdeleted); }
|
Zeile 615 | Zeile 615 |
---|
if(!$event) { error($lang->error_invalidevent);
|
if(!$event) { error($lang->error_invalidevent);
|
}
| }
|
$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'"); $calendar = $db->fetch_array($query);
| $query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'"); $calendar = $db->fetch_array($query);
|
Zeile 624 | Zeile 624 |
---|
if(!$calendar) { error($lang->invalid_calendar);
|
if(!$calendar) { error($lang->invalid_calendar);
|
}
| }
|
// Do we have permission to view this calendar or post events? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1 || $calendar_permissions['canaddevents'] != 1)
|
// Do we have permission to view this calendar or post events? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1 || $calendar_permissions['canaddevents'] != 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
if(($event['uid'] != $mybb->user['uid'] || $mybb->user['uid'] == 0) && $calendar_permissions['canmoderateevents'] != 1) { error_no_permission();
| if(($event['uid'] != $mybb->user['uid'] || $mybb->user['uid'] == 0) && $calendar_permissions['canmoderateevents'] != 1) { error_no_permission();
|
Zeile 640 | Zeile 640 |
---|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
$plugins->run_hooks("calendar_do_editevent_start");
// Set up event handler.
| $plugins->run_hooks("calendar_do_editevent_start");
// Set up event handler.
|
Zeile 648 | Zeile 648 |
---|
require_once MYBB_ROOT."inc/datahandlers/event.php"; $eventhandler = new EventDataHandler("update"); $mybb->input['type'] = $mybb->get_input('type');
|
require_once MYBB_ROOT."inc/datahandlers/event.php"; $eventhandler = new EventDataHandler("update"); $mybb->input['type'] = $mybb->get_input('type');
|
|
|
// Prepare an array for the eventhandler. $event = array( "eid" => $event['eid'],
| // Prepare an array for the eventhandler. $event = array( "eid" => $event['eid'],
|
Zeile 744 | Zeile 744 |
---|
$repeats['repeats'] = 0; } $event['repeats'] = $repeats;
|
$repeats['repeats'] = 0; } $event['repeats'] = $repeats;
|
}
| }
|
$eventhandler->set_data($event);
| $eventhandler->set_data($event);
|
Zeile 780 | Zeile 780 |
---|
$calendar = $db->fetch_array($query);
// Invalid calendar?
|
$calendar = $db->fetch_array($query);
// Invalid calendar?
|
if(!$calendar['cid'])
| if(!$calendar)
|
{ error($lang->invalid_calendar); }
| { error($lang->invalid_calendar); }
|
Zeile 1259 | Zeile 1259 |
---|
}
if($calendar_permissions[$calendar['cid']]['canmoderateevents'] != 1)
|
}
if($calendar_permissions[$calendar['cid']]['canmoderateevents'] != 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('new_calendar', MyBB::INPUT_INT)."'"); $new_calendar = $db->fetch_array($query);
if(!$new_calendar) { error($lang->invalid_calendar);
|
$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('new_calendar', MyBB::INPUT_INT)."'"); $new_calendar = $db->fetch_array($query);
if(!$new_calendar) { error($lang->invalid_calendar);
|
}
| }
|
if($calendar_permissions[$mybb->input['new_calendar']]['canviewcalendar'] != 1) { error_no_permission();
| if($calendar_permissions[$mybb->input['new_calendar']]['canviewcalendar'] != 1) { error_no_permission();
|
Zeile 1291 | Zeile 1291 |
---|
// Approve an event if($mybb->input['action'] == "approve")
|
// Approve an event if($mybb->input['action'] == "approve")
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
$query = $db->simple_select("events", "*", "eid='{$mybb->input['eid']}'");
| { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
$query = $db->simple_select("events", "*", "eid='{$mybb->input['eid']}'");
|
$event = $db->fetch_array($query);
if(!$event)
|
$event = $db->fetch_array($query);
if(!$event)
|
{
| {
|
error($lang->error_invalidevent); }
| error($lang->error_invalidevent); }
|
Zeile 1310 | Zeile 1310 |
---|
if(!$calendar) { error($lang->invalid_calendar);
|
if(!$calendar) { error($lang->invalid_calendar);
|
}
| }
|
// Do we have permission to view this calendar? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1)
|
// Do we have permission to view this calendar? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1)
|
{
| {
|
error_no_permission(); }
| error_no_permission(); }
|
Zeile 1326 | Zeile 1326 |
---|
$updated_event = array( "visible" => 1
|
$updated_event = array( "visible" => 1
|
);
| );
|
$plugins->run_hooks("calendar_approve_start");
$db->update_query("events", $updated_event, "eid='{$event['eid']}'");
|
$plugins->run_hooks("calendar_approve_start");
$db->update_query("events", $updated_event, "eid='{$event['eid']}'");
|
|
|
$plugins->run_hooks("calendar_approve_end");
|
$plugins->run_hooks("calendar_approve_end");
|
|
|
redirect(get_event_link($event['eid']), $lang->redirect_eventapproved); }
|
redirect(get_event_link($event['eid']), $lang->redirect_eventapproved); }
|
|
|
// Unapprove an event if($mybb->input['action'] == "unapprove") {
| // Unapprove an event if($mybb->input['action'] == "unapprove") {
|
Zeile 1347 | Zeile 1347 |
---|
$event = $db->fetch_array($query);
if(!$event)
|
$event = $db->fetch_array($query);
if(!$event)
|
{ error($lang->error_invalidevent); }
$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'"); $calendar = $db->fetch_array($query);
// Invalid calendar? if(!$calendar) { error($lang->invalid_calendar); }
| { error($lang->error_invalidevent); }
$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'"); $calendar = $db->fetch_array($query);
// Invalid calendar? if(!$calendar) { error($lang->invalid_calendar); }
|
// Do we have permission to view this calendar? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1)
| // Do we have permission to view this calendar? $calendar_permissions = get_calendar_permissions($calendar['cid']); if($calendar_permissions['canviewcalendar'] != 1)
|
Zeile 1432 | Zeile 1432 |
---|
"allow_videocode" => $calendar['allowvideocode'] );
|
"allow_videocode" => $calendar['allowvideocode'] );
|
if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
| if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0)
|
{ $event_parser_options['allow_imgcode'] = 0; }
|
{ $event_parser_options['allow_imgcode'] = 0; }
|
if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
| if($mybb->user['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
|
{ $event_parser_options['allow_videocode'] = 0; }
| { $event_parser_options['allow_videocode'] = 0; }
|
Zeile 1521 | Zeile 1521 |
---|
} } // Created by a guest or an unknown user
|
} } // Created by a guest or an unknown user
|
else {
| else {
|
if(!$event['username']) { $event['username'] = $lang->guest;
| if(!$event['username']) { $event['username'] = $lang->guest;
|
Zeile 1586 | Zeile 1586 |
---|
$time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']).", ".gmdate($mybb->settings['timeformat'], $event['starttime_user']); $time_period .= " - "; $time_period .= gmdate($mybb->settings['dateformat'], $event['endtime_user']).", ".gmdate($mybb->settings['timeformat'], $event['endtime_user']);
|
$time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']).", ".gmdate($mybb->settings['timeformat'], $event['starttime_user']); $time_period .= " - "; $time_period .= gmdate($mybb->settings['dateformat'], $event['endtime_user']).", ".gmdate($mybb->settings['timeformat'], $event['endtime_user']);
|
} }
| } }
|
else { $time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']);
| else { $time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']);
|
Zeile 1651 | Zeile 1651 |
---|
if($mybb->input['calendar']) { $query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'");
|
if($mybb->input['calendar']) { $query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'");
|
$calendar = $db->fetch_array($query); }
| $calendar = $db->fetch_array($query); }
|
// Showing the default calendar else {
| // Showing the default calendar else {
|
Zeile 1717 | Zeile 1717 |
---|
$birthdays2 = get_birthdays($month, $day); $bdayhidden = 0; if(is_array($birthdays2))
|
$birthdays2 = get_birthdays($month, $day); $bdayhidden = 0; if(is_array($birthdays2))
|
{
| {
|
foreach($birthdays2 as $birthday) { if($birthday['birthdayprivacy'] == 'all')
| foreach($birthdays2 as $birthday) { if($birthday['birthdayprivacy'] == 'all')
|
Zeile 1780 | Zeile 1780 |
---|
"allow_imgcode" => $calendar['allowimgcode'], "allow_videocode" => $calendar['allowvideocode'] );
|
"allow_imgcode" => $calendar['allowimgcode'], "allow_videocode" => $calendar['allowvideocode'] );
|
if($mybb->user['showimages'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0) {
| if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $mybb->settings['guestimages'] != 1 && $mybb->user['uid'] == 0) {
|
$event_parser_options['allow_imgcode'] = 0; }
|
$event_parser_options['allow_imgcode'] = 0; }
|
if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
| if($mybb->user['uid'] != 0 && $mybb->user['showvideos'] != 1 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
|
{ $event_parser_options['allow_videocode'] = 0; }
| { $event_parser_options['allow_videocode'] = 0; }
|
Zeile 2300 | Zeile 2300 |
---|
}
// Invalid calendar?
|
}
// Invalid calendar?
|
if(!$calendar['cid'])
| if(!$calendar)
|
{ error($lang->invalid_calendar); }
| { error($lang->invalid_calendar); }
|