Vergleich calendar.php - 1.4.4 - 1.4.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: calendar.php 4269 2008-11-13 05:48:19Z Tikitiki $

 * $Id: calendar.php 4673 2009-12-30 12:09:43Z RyanGordon $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 119Zeile 119
			"year" => $mybb->input['end_year'],
"time" => $mybb->input['end_time']
);

			"year" => $mybb->input['end_year'],
"time" => $mybb->input['end_time']
);

		$event['timezone'] = $mybb->input['timezone'];

		$event['timezone'] = intval($mybb->input['timezone']);

		$event['ignoretimezone'] =	intval($mybb->input['ignoretimezone']);
$repeats = array();
switch($mybb->input['repeats'])

		$event['ignoretimezone'] =	intval($mybb->input['ignoretimezone']);
$repeats = array();
switch($mybb->input['repeats'])

Zeile 137Zeile 137
				if(!is_array($mybb->input['repeats_3_days']))
{
$mybb->input['repeats_3_days'] = array();

				if(!is_array($mybb->input['repeats_3_days']))
{
$mybb->input['repeats_3_days'] = array();

				}

				}

				ksort($mybb->input['repeats_3_days']);
$days = array();
foreach($mybb->input['repeats_3_days'] as $weekday => $value)
{
if($value != 1) continue;
$days[] = $weekday;

				ksort($mybb->input['repeats_3_days']);
$days = array();
foreach($mybb->input['repeats_3_days'] as $weekday => $value)
{
if($value != 1) continue;
$days[] = $weekday;

				}

				}

				$repeats['days'] = $days;
break;
case 4:

				$repeats['days'] = $days;
break;
case 4:

Zeile 153Zeile 153
				{
$repeats['day'] = $mybb->input['repeats_4_day'];
$repeats['months'] = $mybb->input['repeats_4_months'];

				{
$repeats['day'] = $mybb->input['repeats_4_day'];
$repeats['months'] = $mybb->input['repeats_4_months'];

				}
else

				}
else

				{
$repeats['months'] = $mybb->input['repeats_4_months2'];
$repeats['occurance'] = $mybb->input['repeats_4_occurance'];

				{
$repeats['months'] = $mybb->input['repeats_4_months2'];
$repeats['occurance'] = $mybb->input['repeats_4_occurance'];

Zeile 170Zeile 170
					$repeats['years'] = $mybb->input['repeats_5_years'];
}
else

					$repeats['years'] = $mybb->input['repeats_5_years'];
}
else

				{

				{

					$repeats['occurance'] = $mybb->input['repeats_5_occurance'];
$repeats['weekday'] = $mybb->input['repeats_5_weekday'];
$repeats['month'] = $mybb->input['repeats_5_month2'];

					$repeats['occurance'] = $mybb->input['repeats_5_occurance'];
$repeats['weekday'] = $mybb->input['repeats_5_weekday'];
$repeats['month'] = $mybb->input['repeats_5_month2'];

Zeile 248Zeile 248
	}

if(isset($mybb->input['description']))

	}

if(isset($mybb->input['description']))

	{

	{

		$description = htmlspecialchars_uni($mybb->input['description']);
}


		$description = htmlspecialchars_uni($mybb->input['description']);
}


Zeile 274Zeile 274
		{
$type_ranged = "checked=\"checked\"";
$type = "ranged";

		{
$type_ranged = "checked=\"checked\"";
$type = "ranged";

		}

		}

		if($mybb->input['repeats'])

		if($mybb->input['repeats'])

		{

		{

			$repeats_sel[$mybb->input['repeats']] = " selected=\"selected\"";
}
$repeats_1_days = intval($mybb->input['repeats_1_days']);

			$repeats_sel[$mybb->input['repeats']] = " selected=\"selected\"";
}
$repeats_1_days = intval($mybb->input['repeats_1_days']);

Zeile 285Zeile 285
		{
foreach($mybb->input['repeats_3_days'] as $day => $val)
{

		{
foreach($mybb->input['repeats_3_days'] as $day => $val)
{

				if($val != 1) continue;





				if($val != 1)
{
continue;
}


				$day = intval($day);
$repeats_3_days[$day] = " checked=\"checked\"";
}

				$day = intval($day);
$repeats_3_days[$day] = " checked=\"checked\"";
}

Zeile 326Zeile 330
		if($mybb->input['day'])
{
$single_day = $start_day = $end_day = intval($mybb->input['day']);

		if($mybb->input['day'])
{
$single_day = $start_day = $end_day = intval($mybb->input['day']);

		}

		}

		else
{
$single_day = $start_day = $end_day = my_date("j");

		else
{
$single_day = $start_day = $end_day = my_date("j");

Zeile 376Zeile 380
		if($i == $single_year)
{
$single_years .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";

		if($i == $single_year)
{
$single_years .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";

		}
else
{

		}
else
{

			$single_years .= "<option value=\"{$i}\">{$i}</option>\n";
}
if($i == $start_year)

			$single_years .= "<option value=\"{$i}\">{$i}</option>\n";
}
if($i == $start_year)

Zeile 475Zeile 479
	{
error($lang->error_invalidevent);
}

	{
error($lang->error_invalidevent);
}



 

$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");
$calendar = $db->fetch_array($query);

// Invalid calendar?
if(!$calendar['cid'])


$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");
$calendar = $db->fetch_array($query);

// Invalid calendar?
if(!$calendar['cid'])

	{

	{

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


	{
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 508Zeile 511

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

 
	}

// Have we made a private event public?
if(!$mybb->input['private'])
{
$mybb->input['private'] = 0;

	}

$plugins->run_hooks("calendar_do_editevent_start");

	}

$plugins->run_hooks("calendar_do_editevent_start");

Zeile 533Zeile 542
			"day" => $mybb->input['single_day'],
"month" => $mybb->input['single_month'],
"year" => $mybb->input['single_year']

			"day" => $mybb->input['single_day'],
"month" => $mybb->input['single_month'],
"year" => $mybb->input['single_year']

		);
}


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

	else if($mybb->input['type'] == "ranged")
{
$event['start_date'] = array(

	else if($mybb->input['type'] == "ranged")
{
$event['start_date'] = array(

Zeile 948Zeile 958
		else
{
$end_days .= "<option value=\"{$i}\">{$i}</option>\n";

		else
{
$end_days .= "<option value=\"{$i}\">{$i}</option>\n";

		}
}

		}
}


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



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


	$plugins->run_hooks("calendar_editevent_end");


	$plugins->run_hooks("calendar_editevent_end");


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

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

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

if(!is_numeric($event['eid']))
{
error($lang->error_invalidevent);
}

$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");
$calendar = $db->fetch_array($query);

// Invalid calendar?

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

if(!is_numeric($event['eid']))
{
error($lang->error_invalidevent);
}

$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");
$calendar = $db->fetch_array($query);

// Invalid calendar?

	if(!$calendar['cid'])
{
error($lang->invalid_calendar);

	if(!$calendar['cid'])
{
error($lang->invalid_calendar);

Zeile 1016Zeile 1026

// Actually move the event
if($mybb->input['action'] == "do_move" && $mybb->request_method == "post")


// Actually move the event
if($mybb->input['action'] == "do_move" && $mybb->request_method == "post")

{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

if(!is_numeric($event['eid']))
{
error($lang->error_invalidevent);

{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

if(!is_numeric($event['eid']))
{
error($lang->error_invalidevent);

	}

$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");

	}

$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");

Zeile 1035Zeile 1045
	if(!$calendar['cid'])
{
error($lang->invalid_calendar);

	if(!$calendar['cid'])
{
error($lang->invalid_calendar);

	}

	}


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


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

	{
error_no_permission();
}

	{
error_no_permission();
}


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


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






$query = $db->simple_select("calendars", "*", "cid='".intval($mybb->input['new_calendar'])."'");


$query = $db->simple_select("calendars", "*", "cid='".intval($mybb->input['new_calendar'])."'");

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

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


if(!$new_calendar['cid'])


if(!$new_calendar['cid'])

	{

	{

		error($lang->invalid_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 1077Zeile 1087

// Approve an event
if($mybb->input['action'] == "approve")


// Approve an event
if($mybb->input['action'] == "approve")

{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

if(!is_numeric($event['eid']))
{
error($lang->error_invalidevent);
}

$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");
$calendar = $db->fetch_array($query);

// Invalid calendar?
if(!$calendar['cid'])
{
error($lang->invalid_calendar);
}

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

{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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

if(!is_numeric($event['eid']))
{
error($lang->error_invalidevent);
}

$query = $db->simple_select("calendars", "*", "cid='{$event['cid']}'");
$calendar = $db->fetch_array($query);

// Invalid calendar?
if(!$calendar['cid'])
{
error($lang->invalid_calendar);
}

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


if($calendar_permissions['canmoderateevents'] != 1)
{


if($calendar_permissions['canmoderateevents'] != 1)
{

Zeile 1155Zeile 1165
	if($calendar_permissions['canmoderateevents'] != 1)
{
error_no_permission();

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

	}

$plugins->run_hooks("calendar_unapprove_start");

	}

$plugins->run_hooks("calendar_unapprove_start");


$updated_event = array(
"visible" => 0


$updated_event = array(
"visible" => 0

Zeile 1729Zeile 1739
	$yearsel = '';
for($i = my_date("Y"); $i < (my_date("Y") + 5); ++$i)
{

	$yearsel = '';
for($i = my_date("Y"); $i < (my_date("Y") + 5); ++$i)
{

		if($i == my_date("Y"))
{
$yearsel .= "<option value=\"$i\">$i</option>\n";
}

		$yearsel .= "<option value=\"$i\">$i</option>\n";




	}

if($mybb->usergroup['canaddevents'] == 1)

	}

if($mybb->usergroup['canaddevents'] == 1)

Zeile 1783Zeile 1790
	}

$weekdays = fetch_weekday_structure($calendar['startofweek']);

	}

$weekdays = fetch_weekday_structure($calendar['startofweek']);

 
	
$yearsel = '';
for($i = my_date("Y"); $i < (my_date("Y") + 5); ++$i)
{
$yearsel .= "<option value=\"$i\">$i</option>\n";
}


// No incoming week, show THIS week
if(!$mybb->input['week'])


// No incoming week, show THIS week
if(!$mybb->input['week'])

Zeile 1791Zeile 1804
		$php_weekday = gmdate("w", gmmktime(0, 0, 0, $month, $day, $year));
$my_weekday = array_search($php_weekday, $weekdays);
// So now we have the start day of this week to show

		$php_weekday = gmdate("w", gmmktime(0, 0, 0, $month, $day, $year));
$my_weekday = array_search($php_weekday, $weekdays);
// So now we have the start day of this week to show

		$start_day = $day-$php_weekday;

		$start_day = $day-$my_weekday;

		$mybb->input['week'] = gmmktime(0, 0, 0, $month, $start_day, $year);
}
else

		$mybb->input['week'] = gmmktime(0, 0, 0, $month, $start_day, $year);
}
else

Zeile 1973Zeile 1986
		$weekday_year = $month[1];

// Fetch mini calendar for each month in this week

		$weekday_year = $month[1];

// Fetch mini calendar for each month in this week

		$mini_calendars .= build_mini_calendar($calendar, $month[0], $year[1], $events_cache)."<br />";

		$mini_calendars .= build_mini_calendar($calendar, $month[0], $weekday_year, $events_cache)."<br />";


// Fetch out the days for this month
$days = $day_bits[$month[0]];


// Fetch out the days for this month
$days = $day_bits[$month[0]];