Vergleich calendar.php - 1.8.31 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 227Zeile 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 249Zeile 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 257Zeile 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 272Zeile 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 411Zeile 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 501Zeile 501
	}

if($mybb->get_input('private', MyBB::INPUT_INT) == 1)

	}

if($mybb->get_input('private', MyBB::INPUT_INT) == 1)

	{

	{

		$privatecheck = " checked=\"checked\"";
}
else

		$privatecheck = " checked=\"checked\"";
}
else

	{

	{

		$privatecheck = '';
}


		$privatecheck = '';
}


Zeile 521Zeile 521
		{
$calendar_option['name'] = htmlspecialchars_uni($calendar_option['name']);
if($calendar_option['cid'] == $mybb->input['calendar'])

		{
$calendar_option['name'] = htmlspecialchars_uni($calendar_option['name']);
if($calendar_option['cid'] == $mybb->input['calendar'])

			{

			{

				$selected = " selected=\"selected\"";
}
else
{
$selected = "";
}

				$selected = " selected=\"selected\"";
}
else
{
$selected = "";
}





			++$calendarcount;
eval("\$select_calendar .= \"".$templates->get("calendar_select")."\";");
}

			++$calendarcount;
eval("\$select_calendar .= \"".$templates->get("calendar_select")."\";");
}

	}

	}


if($calendarcount > 1)
{


if($calendarcount > 1)
{

Zeile 552Zeile 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'));


Zeile 713Zeile 713
			case 4:
$repeats['repeats'] = 4;
if($mybb->get_input('repeats_4_type', MyBB::INPUT_INT) == 1)

			case 4:
$repeats['repeats'] = 4;
if($mybb->get_input('repeats_4_type', MyBB::INPUT_INT) == 1)

				{

				{

					$repeats['day'] = $mybb->get_input('repeats_4_day', MyBB::INPUT_INT);
$repeats['months'] = $mybb->get_input('repeats_4_months', MyBB::INPUT_INT);

					$repeats['day'] = $mybb->get_input('repeats_4_day', MyBB::INPUT_INT);
$repeats['months'] = $mybb->get_input('repeats_4_months', MyBB::INPUT_INT);

				}

				}

				else
{
$repeats['months'] = $mybb->get_input('repeats_4_months2', MyBB::INPUT_INT);

				else
{
$repeats['months'] = $mybb->get_input('repeats_4_months2', MyBB::INPUT_INT);

Zeile 744Zeile 744
				$repeats['repeats'] = 0;
}
$event['repeats'] = $repeats;

				$repeats['repeats'] = 0;
}
$event['repeats'] = $repeats;

	}


	}


	$eventhandler->set_data($event);

// Now let the eventhandler do all the hard work.
if(!$eventhandler->validate_event())

	$eventhandler->set_data($event);

// Now let the eventhandler do all the hard work.
if(!$eventhandler->validate_event())

	{

	{

		$event_errors = $eventhandler->get_friendly_errors();
$event_errors = inline_error($event_errors);
$mybb->input['action'] = "editevent";

		$event_errors = $eventhandler->get_friendly_errors();
$event_errors = inline_error($event_errors);
$mybb->input['action'] = "editevent";

	}

	}

	else
{
$details = $eventhandler->update_event();

	else
{
$details = $eventhandler->update_event();

Zeile 762Zeile 762
		redirect(get_event_link($event['eid']), $lang->redirect_eventupdated);
}
}

		redirect(get_event_link($event['eid']), $lang->redirect_eventupdated);
}
}





if($mybb->input['action'] == "editevent")
{
// Event already fetched in do_editevent?

if($mybb->input['action'] == "editevent")
{
// Event already fetched in do_editevent?

Zeile 770Zeile 770
	{
$query = $db->simple_select("events", "*", "eid='{$mybb->input['eid']}'");
$event = $db->fetch_array($query);

	{
$query = $db->simple_select("events", "*", "eid='{$mybb->input['eid']}'");
$event = $db->fetch_array($query);





		if(!$event)
{
error($lang->error_invalidevent);

		if(!$event)
{
error($lang->error_invalidevent);

Zeile 778Zeile 778

$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);





		// Invalid calendar?

		// Invalid calendar?

		if(!$calendar['cid'])

		if(!$calendar)

		{
error($lang->invalid_calendar);
}

		{
error($lang->invalid_calendar);
}

Zeile 973Zeile 973
				$end_time = gmdate($mybb->settings['timeformat'], $event['endtime']+$event['timezone']*3600);
}
else

				$end_time = gmdate($mybb->settings['timeformat'], $event['endtime']+$event['timezone']*3600);
}
else

			{

			{

				$end_time = '';
}
$type_ranged = "checked=\"checked\"";

				$end_time = '';
}
$type_ranged = "checked=\"checked\"";

Zeile 1005Zeile 1005
							{
$repeats_3_days[$weekday] = " checked=\"checked\"";
}

							{
$repeats_3_days[$weekday] = " checked=\"checked\"";
}

						}

						}

						$repeats_4_type[1] = "checked=\"checked\"";
$repeats_4_day = 1;
$repeats_4_months = 1;

						$repeats_4_type[1] = "checked=\"checked\"";
$repeats_4_day = 1;
$repeats_4_months = 1;

Zeile 1070Zeile 1070
				$timezone = $event['timezone'];
$ignore_timezone = '';
}

				$timezone = $event['timezone'];
$ignore_timezone = '';
}

		}

		}

		else
{
$type_single = "checked=\"checked\"";

		else
{
$type_single = "checked=\"checked\"";

Zeile 1084Zeile 1084
	}

$single_years = $start_years = $end_years = '';

	}

$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)

	// 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")."\";");
}

		{
$selected = "selected=\"selected\"";
eval("\$single_years .= \"".$templates->get("calendar_year")."\";");
}

		else
{
$selected = "";

		else
{
$selected = "";

Zeile 1101Zeile 1101

if($year == $start_year)
{


if($year == $start_year)
{

			$selected = "selected=\"selected\"";
eval("\$start_years .= \"".$templates->get("calendar_year")."\";");
}
else
{
$selected = "";

			$selected = "selected=\"selected\"";






			eval("\$start_years .= \"".$templates->get("calendar_year")."\";");

			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")."\";");






		}
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")."\";");

		}
}


		}
}


Zeile 1132Zeile 1132
			$selected = "selected=\"selected\"";
eval("\$single_days .= \"".$templates->get("calendar_day")."\";");
}

			$selected = "selected=\"selected\"";
eval("\$single_days .= \"".$templates->get("calendar_day")."\";");
}

		else
{
$selected = "";
eval("\$single_days .= \"".$templates->get("calendar_day")."\";");
}

		else
{
$selected = "";
eval("\$single_days .= \"".$templates->get("calendar_day")."\";");
}


if($day == $start_day)


if($day == $start_day)

		{
$selected = "selected=\"selected\"";
eval("\$start_days .= \"".$templates->get("calendar_day")."\";");
}
else
{
$selected = "";

		{
$selected = "selected=\"selected\"";






			eval("\$start_days .= \"".$templates->get("calendar_day")."\";");

			eval("\$start_days .= \"".$templates->get("calendar_day")."\";");

		}







		}
else
{
$selected = "";
eval("\$start_days .= \"".$templates->get("calendar_day")."\";");
}


		if($day == $end_day)
{
$selected = "selected=\"selected\"";

		if($day == $end_day)
{
$selected = "selected=\"selected\"";

			eval("\$end_days .= \"".$templates->get("calendar_day")."\";");

			eval("\$end_days .= \"".$templates->get("calendar_day")."\";");

		}
else
{

		}
else
{

Zeile 1160Zeile 1160
			eval("\$end_days .= \"".$templates->get("calendar_day")."\";");
}
}

			eval("\$end_days .= \"".$templates->get("calendar_day")."\";");
}
}





	$timezones = build_timezone_select("timezone", $timezone);

$plugins->run_hooks("calendar_editevent_end");

eval("\$editevent = \"".$templates->get("calendar_editevent")."\";");
output_page($editevent);

	$timezones = build_timezone_select("timezone", $timezone);

$plugins->run_hooks("calendar_editevent_end");

eval("\$editevent = \"".$templates->get("calendar_editevent")."\";");
output_page($editevent);

}

}


// Move an event to another calendar
if($mybb->input['action'] == "move")


// Move an event to another calendar
if($mybb->input['action'] == "move")

Zeile 1178Zeile 1178
	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 1189Zeile 1189
		error($lang->invalid_calendar);
}


		error($lang->invalid_calendar);
}


	// Do we have permission to view this calendar or post events?
$calendar_permissions = get_calendar_permissions();
if($calendar_permissions[$calendar['cid']]['canviewcalendar'] != 1)
{
error_no_permission();
}

if($calendar_permissions[$calendar['cid']]['canmoderateevents'] != 1)
{
error_no_permission();
}


	// Do we have permission to view this calendar or post events?
$calendar_permissions = get_calendar_permissions();
if($calendar_permissions[$calendar['cid']]['canviewcalendar'] != 1)
{
error_no_permission();
}

if($calendar_permissions[$calendar['cid']]['canmoderateevents'] != 1)
{
error_no_permission();
}


	$event['name'] = htmlspecialchars_uni($event['name']);

add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid']));

	$event['name'] = htmlspecialchars_uni($event['name']);

add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid']));

Zeile 1264Zeile 1264
	}

$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('new_calendar', MyBB::INPUT_INT)."'");

	}

$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('new_calendar', MyBB::INPUT_INT)."'");

	$new_calendar = $db->fetch_array($query);

	$new_calendar = $db->fetch_array($query);


if(!$new_calendar)
{


if(!$new_calendar)
{

Zeile 1782Zeile 1782
			);

if($mybb->user['uid'] != 0 && $mybb->user['showimages'] != 1 || $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;
}


Zeile 2300Zeile 2300
	}

// Invalid calendar?

	}

// Invalid calendar?

	if(!$calendar['cid'])

	if(!$calendar)

	{
error($lang->invalid_calendar);
}

	{
error($lang->invalid_calendar);
}