Vergleich calendar.php - 1.8.6 - 1.8.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'calendar.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'calendar.php');


$templatelist = "calendar_weekdayheader,calendar_weekrow_day,calendar_weekrow,calendar,calendar_addevent,calendar_move,calendar_year,calendar_day,calendar_select,calendar_repeats,calendar_weekview_day_event_time";
$templatelist .= ",calendar_weekview_day,calendar_weekview_day_event,calendar_mini_weekdayheader,calendar_mini_weekrow_day,calendar_mini_weekrow,calendar_mini,calendar_weekview_month,calendar_weekview";
$templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_dayview_event,calendar_dayview,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty";
$templatelist .= ",calendar_jump,calendar_jump_option,calendar_editevent,calendar_dayview_birthdays_bday,calendar_dayview_birthdays,calendar_dayview_noevents,calendar_addeventlink,calendar_addevent_calendarselect_hidden";
$templatelist .= ",calendar_weekrow_day_birthdays,calendar_weekview_day_birthdays,calendar_year_sel,calendar_event_userstar,calendar_addevent_calendarselect,calendar_eventbit,calendar_event";

$templatelist = "calendar_weekdayheader,calendar_weekrow_day,calendar_weekrow,calendar,calendar_addevent,calendar_year,calendar_day,calendar_select,calendar_repeats,calendar_weekview_day_event_time,calendar_weekview_nextlink";
$templatelist .= ",calendar_weekview_day,calendar_weekview_day_event,calendar_mini_weekdayheader,calendar_mini_weekrow_day,calendar_mini_weekrow,calendar_mini,calendar_mini_weekrow_day_link,calendar_weekview_prevlink";
$templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_dayview_event,calendar_dayview,codebuttons,calendar_weekrow_day_events,calendar_weekview_month,calendar_addeventlink,calendar_weekview";
$templatelist .= ",calendar_jump,calendar_jump_option,calendar_editevent,calendar_dayview_birthdays_bday,calendar_dayview_birthdays,calendar_dayview_noevents,calendar_addevent_calendarselect_hidden,calendar_nextlink";
$templatelist .= ",calendar_weekrow_day_birthdays,calendar_weekview_day_birthdays,calendar_year_sel,calendar_event_userstar,calendar_addevent_calendarselect,calendar_eventbit,calendar_event,calendar_move,calendar_prevlink";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_calendar.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_calendar.php";
require_once MYBB_ROOT."inc/functions_post.php";

 
require_once MYBB_ROOT."inc/functions_time.php";

require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;


require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;


Zeile 798Zeile 799
	}

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

	}

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

 
	$event['timezone'] = (float)$event['timezone'];


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


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

Zeile 945Zeile 947
		{
$privatecheck = '';
}

		{
$privatecheck = '';
}

		$start_date = explode("-", gmdate("j-n-Y-g:i A", $event['starttime']+$event['timezone']*3600));

		$start_date = explode("-", gmdate("j-n-Y", $event['starttime']+$event['timezone']*3600));

		$single_day = $start_date[0];
$single_month[$start_date[1]] = " selected=\"selected\"";
$single_year = $start_date[2];

		$single_day = $start_date[0];
$single_month[$start_date[1]] = " selected=\"selected\"";
$single_year = $start_date[2];

Zeile 962Zeile 964
		}
if($event['endtime'])
{

		}
if($event['endtime'])
{

			$end_date = explode("-", gmdate("j-n-Y-g:i A", $event['endtime']+$event['timezone']*3600));

			$end_date = explode("-", gmdate("j-n-Y", $event['endtime']+$event['timezone']*3600));

			$end_day = $end_date[0];
$end_month[$end_date[1]] = " selected=\"selected\"";
$end_year = $end_date[2];

			$end_day = $end_date[0];
$end_month[$end_date[1]] = " selected=\"selected\"";
$end_year = $end_date[2];

Zeile 1461Zeile 1463
	// Event made by registered user
if($event['uid'] > 0 && $event['username'])
{

	// Event made by registered user
if($event['uid'] > 0 && $event['username'])
{

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

		$event['profilelink'] = build_profile_link(format_name($event['username'], $event['usergroup'], $event['displaygroup']), $event['uid']);


		$event['profilelink'] = build_profile_link(format_name($event['username'], $event['usergroup'], $event['displaygroup']), $event['uid']);


		$hascustomtitle = 0;

 
		if(trim($event['usertitle']) != "")
{

		if(trim($event['usertitle']) != "")
{

			$hascustomtitle = 1;

			// Do nothing, no need for an extra variable..

		}

		}


if($user_usergroup['usertitle'] != "" && !$hascustomtitle)
{

		elseif($user_usergroup['usertitle'] != "")
{


			$event['usertitle'] = $user_usergroup['usertitle'];
}
elseif(is_array($titles_cache) && !$user_usergroup['usertitle'])
{
reset($titles_cache);

			$event['usertitle'] = $user_usergroup['usertitle'];
}
elseif(is_array($titles_cache) && !$user_usergroup['usertitle'])
{
reset($titles_cache);

			foreach($titles_cache as $key => $title)

			foreach($titles_cache as $title)

			{

			{

				if($event['postnum'] >= $key)

				if($event['postnum'] >= $title['posts'])

				{

				{

					if(!$hascustomtitle)
{
$event['usertitle'] = $title['title'];
}

					$event['usertitle'] = $title['title'];




					$event['stars'] = $title['stars'];
$event['starimage'] = $title['starimage'];
break;

					$event['stars'] = $title['stars'];
$event['starimage'] = $title['starimage'];
break;

Zeile 1521Zeile 1519
			$event['username'] = $lang->guest;
}


			$event['username'] = $lang->guest;
}


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

		$event['profilelink'] = format_name($event['username'], 1);

if($user_usergroup['usertitle'])

		$event['profilelink'] = format_name($event['username'], 1);

if($user_usergroup['usertitle'])

Zeile 1534Zeile 1533
		$event['userstars'] = '';
}


		$event['userstars'] = '';
}


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

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


if($event['ignoretimezone'] == 0)
{


if($event['ignoretimezone'] == 0)
{

		$offset = $event['timezone'];

		$offset = (float)$event['timezone'];

	}
else
{

	}
else
{

		$offset = $mybb->user['timezone'];

		$offset = (float)$mybb->user['timezone'];

	}

$event['starttime_user'] = $event['starttime']+$offset*3600;

	}

$event['starttime_user'] = $event['starttime']+$offset*3600;

Zeile 1552Zeile 1551
	if($event['endtime'] > 0 && $event['endtime'] != $event['starttime'])
{
$event['endtime_user'] = $event['endtime']+$offset*3600;

	if($event['endtime'] > 0 && $event['endtime'] != $event['starttime'])
{
$event['endtime_user'] = $event['endtime']+$offset*3600;

		$start_day = gmmktime(0, 0, 0, gmdate("n", $event['starttime_user']), gmdate("j", $event['starttime_user']), gmdate("Y", $event['starttime_user']));
$end_day = gmmktime(0, 0, 0, gmdate("n", $event['endtime_user']), gmdate("j", $event['endtime_user']), gmdate("Y", $event['endtime_user']));

		$start_day = adodb_gmmktime(0, 0, 0, gmdate("n", $event['starttime_user']), gmdate("j", $event['starttime_user']), gmdate("Y", $event['starttime_user']));
$end_day = adodb_gmmktime(0, 0, 0, gmdate("n", $event['endtime_user']), gmdate("j", $event['endtime_user']), gmdate("Y", $event['endtime_user']));

		$start_time = gmdate("Hi", $event['starttime_user']);
$end_time = gmdate("Hi", $event['endtime_user']);


		$start_time = gmdate("Hi", $event['starttime_user']);
$end_time = gmdate("Hi", $event['endtime_user']);


Zeile 1666Zeile 1665
	}

// Incoming year?

	}

// Incoming year?

	$mybb->input['year'] = $mybb->get_input('year', MyBB::INPUT_INT);
if($mybb->input['year'] && $mybb->input['year'] <= my_date("Y")+5)

	if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= my_date("Y")+5)


	{

	{

		$year = $mybb->input['year'];

		$year = $mybb->get_input('year', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 1689Zeile 1687

// And day?
$mybb->input['day'] = $mybb->get_input('day', MyBB::INPUT_INT);


// And day?
$mybb->input['day'] = $mybb->get_input('day', MyBB::INPUT_INT);

	if($mybb->input['day'] && $mybb->input['day'] <= gmdate("t", gmmktime(0, 0, 0, $month, 1, $year)))

	if($mybb->input['day'] && $mybb->input['day'] <= gmdate("t", adodb_gmmktime(0, 0, 0, $month, 1, $year)))

	{
$day = $mybb->input['day'];
}

	{
$day = $mybb->input['day'];
}

Zeile 1710Zeile 1708
		$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 1726Zeile 1724
						$age = '';
}


						$age = '';
}


					$birthday['username'] = format_name($birthday['username'], $birthday['usergroup'], $birthday['displaygroup']);

					$birthday['username'] = format_name(htmlspecialchars_uni($birthday['username']), $birthday['usergroup'], $birthday['displaygroup']);

					$birthday['profilelink'] = build_profile_link($birthday['username'], $birthday['uid']);
eval("\$birthday_list .= \"".$templates->get("calendar_dayview_birthdays_bday", 1, 0)."\";");
$comma = $lang->comma;

					$birthday['profilelink'] = build_profile_link($birthday['username'], $birthday['uid']);
eval("\$birthday_list .= \"".$templates->get("calendar_dayview_birthdays_bday", 1, 0)."\";");
$comma = $lang->comma;

Zeile 1738Zeile 1736
			}
}
if($bdayhidden > 0)

			}
}
if($bdayhidden > 0)

		{

		{

			if($birthday_list)
{
$birthday_list .= " - ";

			if($birthday_list)
{
$birthday_list .= " - ";

Zeile 1747Zeile 1745
		}
if($birthday_list)
{

		}
if($birthday_list)
{

			$bdaydate = my_date($mybb->settings['dateformat'], gmmktime(0, 0, 0, $month, $day, $year), 0, 0);

			$bdaydate = my_date($mybb->settings['dateformat'], adodb_gmmktime(0, 0, 0, $month, $day, $year), 0, 0);

			$lang->birthdays_on_day = $lang->sprintf($lang->birthdays_on_day, $bdaydate);
eval("\$birthdays = \"".$templates->get("calendar_dayview_birthdays", 1, 0)."\";");
}
}

// So now we fetch events for this month

			$lang->birthdays_on_day = $lang->sprintf($lang->birthdays_on_day, $bdaydate);
eval("\$birthdays = \"".$templates->get("calendar_dayview_birthdays", 1, 0)."\";");
}
}

// So now we fetch events for this month

	$start_timestamp = gmmktime(0, 0, 0, $month, $day, $year);
$end_timestamp = gmmktime(23, 59, 59, $month, $day, $year);

	$start_timestamp = adodb_gmmktime(0, 0, 0, $month, $day, $year);
$end_timestamp = adodb_gmmktime(23, 59, 59, $month, $day, $year);


$events_cache = get_events($calendar, $start_timestamp, $end_timestamp, $calendar_permissions['canmoderateevents']);



$events_cache = get_events($calendar, $start_timestamp, $end_timestamp, $calendar_permissions['canmoderateevents']);


Zeile 1782Zeile 1780
			if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
{
$event_parser_options['allow_videocode'] = 0;

			if($mybb->user['showvideos'] != 1 && $mybb->user['uid'] != 0 || $mybb->settings['guestvideos'] != 1 && $mybb->user['uid'] == 0)
{
$event_parser_options['allow_videocode'] = 0;

			}


			}


			$event['description'] = $parser->parse_message($event['description'], $event_parser_options);

// Get the usergroup

			$event['description'] = $parser->parse_message($event['description'], $event_parser_options);

// Get the usergroup

Zeile 1805Zeile 1803
			// Event made by registered user
if($event['uid'] > 0 && $event['username'])
{

			// Event made by registered user
if($event['uid'] > 0 && $event['username'])
{

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

				$event['profilelink'] = build_profile_link(format_name($event['username'], $event['usergroup'], $event['displaygroup']), $event['uid']);


				$event['profilelink'] = build_profile_link(format_name($event['username'], $event['usergroup'], $event['displaygroup']), $event['uid']);


				$hascustomtitle = 0;

 
				if(trim($event['usertitle']) != "")
{

				if(trim($event['usertitle']) != "")
{

					$hascustomtitle = 1;

					// Do nothing, no need for an extra variable..

				}

				}


if($user_usergroup['usertitle'] != "" && !$hascustomtitle)

				elseif($user_usergroup['usertitle'] != "")


				{
$event['usertitle'] = $user_usergroup['usertitle'];
}
elseif(is_array($titles_cache) && !$user_usergroup['usertitle'])
{
reset($titles_cache);

				{
$event['usertitle'] = $user_usergroup['usertitle'];
}
elseif(is_array($titles_cache) && !$user_usergroup['usertitle'])
{
reset($titles_cache);

					foreach($titles_cache as $key => $title)

					foreach($titles_cache as $title)

					{

					{

						if($event['postnum'] >= $key)

						if($event['postnum'] >= $title['posts'])

						{

						{

							if(!$hascustomtitle)
{
$event['usertitle'] = $title['title'];
}

							$event['usertitle'] = $title['title'];




							$event['stars'] = $title['stars'];
$event['starimage'] = $title['starimage'];
break;

							$event['stars'] = $title['stars'];
$event['starimage'] = $title['starimage'];
break;

Zeile 1836Zeile 1830
				}

if($user_usergroup['stars'])

				}

if($user_usergroup['stars'])

				{

				{

					$event['stars'] = $user_usergroup['stars'];
}


					$event['stars'] = $user_usergroup['stars'];
}


Zeile 1864Zeile 1858
					$event['username'] = $lang->guest;
}


					$event['username'] = $lang->guest;
}


				$event['username'] = $event['username'];

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

				$event['profilelink'] = format_name($event['username'], 1);

if($user_usergroup['usertitle'])

				$event['profilelink'] = format_name($event['username'], 1);

if($user_usergroup['usertitle'])

Zeile 1878Zeile 1872
				$event['userstars'] = '';
}


				$event['userstars'] = '';
}


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

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


if($event['ignoretimezone'] == 0)
{


if($event['ignoretimezone'] == 0)
{

				$offset = $event['timezone'];

				$offset = (float)$event['timezone'];

			}
else
{

			}
else
{

				$offset = $mybb->user['timezone'];

				$offset = (float)$mybb->user['timezone'];

			}

$event['starttime_user'] = $event['starttime']+$offset*3600;

			}

$event['starttime_user'] = $event['starttime']+$offset*3600;

Zeile 1896Zeile 1890
			if($event['endtime'] > 0 && $event['endtime'] != $event['starttime'])
{
$event['endtime_user'] = $event['endtime']+$offset*3600;

			if($event['endtime'] > 0 && $event['endtime'] != $event['starttime'])
{
$event['endtime_user'] = $event['endtime']+$offset*3600;

				$start_day = gmmktime(0, 0, 0, gmdate("n", $event['starttime_user']), gmdate("j", $event['starttime_user']), gmdate("Y", $event['starttime_user']));
$end_day = gmmktime(0, 0, 0, gmdate("n", $event['endtime_user']), gmdate("j", $event['endtime_user']), gmdate("Y", $event['endtime_user']));

				$start_day = adodb_gmmktime(0, 0, 0, gmdate("n", $event['starttime_user']), gmdate("j", $event['starttime_user']), gmdate("Y", $event['starttime_user']));
$end_day = adodb_gmmktime(0, 0, 0, gmdate("n", $event['endtime_user']), gmdate("j", $event['endtime_user']), gmdate("Y", $event['endtime_user']));

				$start_time = gmdate("Hi", $event['starttime_user']);
$end_time = gmdate("Hi", $event['endtime_user']);


				$start_time = gmdate("Hi", $event['starttime_user']);
$end_time = gmdate("Hi", $event['endtime_user']);


Zeile 2026Zeile 2020
	if(empty($mybb->input['week']))
{
list($day, $month, $year) = explode("-", my_date("j-n-Y"));

	if(empty($mybb->input['week']))
{
list($day, $month, $year) = explode("-", my_date("j-n-Y"));

		$php_weekday = gmdate("w", gmmktime(0, 0, 0, $month, $day, $year));

		$php_weekday = gmdate("w", adodb_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-$my_weekday;

		$my_weekday = array_search($php_weekday, $weekdays);
// So now we have the start day of this week to show
$start_day = $day-$my_weekday;

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

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

	}
else
{

	}
else
{

Zeile 2046Zeile 2040
	$week_from = explode("-", gmdate("j-n-Y", $mybb->input['week']));
$week_from_one = $week_from[1];
$friendly_week_from = gmdate($mybb->settings['dateformat'], $mybb->input['week']);

	$week_from = explode("-", gmdate("j-n-Y", $mybb->input['week']));
$week_from_one = $week_from[1];
$friendly_week_from = gmdate($mybb->settings['dateformat'], $mybb->input['week']);

	$week_to_stamp = gmmktime(0, 0, 0, $week_from[1], $week_from[0]+6, $week_from[2]);

	$week_to_stamp = adodb_gmmktime(0, 0, 0, $week_from[1], $week_from[0]+6, $week_from[2]);

	$week_to = explode("-", gmdate("j-n-Y-t", $week_to_stamp));
$friendly_week_to = gmdate($mybb->settings['dateformat'], $week_to_stamp);


	$week_to = explode("-", gmdate("j-n-Y-t", $week_to_stamp));
$friendly_week_to = gmdate($mybb->settings['dateformat'], $week_to_stamp);


Zeile 2071Zeile 2065

// Load Birthdays for this month
if($calendar['showbirthdays'] == 1)


// Load Birthdays for this month
if($calendar['showbirthdays'] == 1)

	{
$birthdays = get_birthdays($bday_months);
}


	{
$birthdays = get_birthdays($bday_months);
}


	// We load events for the entire month date range - for our mini calendars too

	// We load events for the entire month date range - for our mini calendars too

	$events_from = gmmktime(0, 0, 0, $week_from[1], 1, $week_from[2]);
$events_to = gmmktime(0, 0, 0, $week_to[1], $week_to[3], $week_to[2]);


	$events_from = adodb_gmmktime(0, 0, 0, $week_from[1], 1, $week_from[2]);
$events_to = adodb_gmmktime(0, 0, 0, $week_to[1], $week_to[3], $week_to[2]);


	$events_cache = get_events($calendar, $events_from, $events_to, $calendar_permissions['canmoderateevents']);

	$events_cache = get_events($calendar, $events_from, $events_to, $calendar_permissions['canmoderateevents']);





	$today = my_date("dnY");

	$today = my_date("dnY");


$next_week = $mybb->input['week'] + 604800;
$next_link = get_calendar_week_link($calendar['cid'], $next_week);





	$prev_week = $mybb->input['week'] - 604800;

	$prev_week = $mybb->input['week'] - 604800;

	$prev_link = get_calendar_week_link($calendar['cid'], $prev_week);

























$prev_week_link = '';
if(my_date("Y", $prev_week) >= 1901)
{
$prev_link = get_calendar_week_link($calendar['cid'], $prev_week);

eval("\$prev_week_link = \"".$templates->get("calendar_weekview_prevlink")."\";");
}

$next_week = $mybb->input['week'] + 604800;

$next_week_link = '';
if(my_date("Y", $next_week)+1 <= my_date("Y")+5)
{
$next_link = get_calendar_week_link($calendar['cid'], $next_week);

eval("\$next_week_link = \"".$templates->get("calendar_weekview_nextlink")."\";");
}

$sep = '';
if(!empty($prev_week_link) && !empty($next_week_link))
{
$sep = " | ";
}


$weekday_date = $mybb->input['week'];



$weekday_date = $mybb->input['week'];


Zeile 2123Zeile 2138
				$time_period = '';
if($event['endtime'] > 0 && $event['endtime'] != $event['starttime'])
{

				$time_period = '';
if($event['endtime'] > 0 && $event['endtime'] != $event['starttime'])
{

					$start_day = gmmktime(0, 0, 0, gmdate("n", $event['starttime_user']), gmdate("j", $event['starttime_user']), gmdate("Y", $event['starttime_user']));
$end_day = gmmktime(0, 0, 0, gmdate("n", $event['endtime_user']), gmdate("j", $event['endtime_user']), gmdate("Y", $event['endtime_user']));

					$start_day = adodb_gmmktime(0, 0, 0, gmdate("n", $event['starttime_user']), gmdate("j", $event['starttime_user']), gmdate("Y", $event['starttime_user']));
$end_day = adodb_gmmktime(0, 0, 0, gmdate("n", $event['endtime_user']), gmdate("j", $event['endtime_user']), gmdate("Y", $event['endtime_user']));

					$start_time = gmdate("Hi", $event['starttime_user']);
$end_time = gmdate("Hi", $event['endtime_user']);
// Event only runs over one day

					$start_time = gmdate("Hi", $event['starttime_user']);
$end_time = gmdate("Hi", $event['endtime_user']);
// Event only runs over one day

Zeile 2218Zeile 2233
		}
eval("\$day_bits[$weekday_month] .= \"".$templates->get("calendar_weekview_day")."\";");
$day_events = $day_birthdays = "";

		}
eval("\$day_bits[$weekday_month] .= \"".$templates->get("calendar_weekview_day")."\";");
$day_events = $day_birthdays = "";

		$weekday_date = gmmktime(0, 0, 0, $weekday_month, $weekday_day+1, $weekday_year);

		$weekday_date = adodb_gmmktime(0, 0, 0, $weekday_month, $weekday_day+1, $weekday_year);

	}

// Now we build our month headers

	}

// Now we build our month headers

Zeile 2283Zeile 2298
	$plugins->run_hooks("calendar_main_view");

// Incoming year?

	$plugins->run_hooks("calendar_main_view");

// Incoming year?

	$mybb->input['year'] = $mybb->get_input('year', MyBB::INPUT_INT);
if($mybb->input['year'] && $mybb->input['year'] <= my_date("Y")+5)

	if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= my_date("Y")+5 && $mybb->get_input('year', MyBB::INPUT_INT) >= 1901)


	{

	{

		$year = $mybb->input['year'];

		$year = $mybb->get_input('year', MyBB::INPUT_INT);

	}
else
{

	}
else
{

Zeile 2307Zeile 2321
	add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid']));
add_breadcrumb("$monthnames[$month] $year", get_calendar_link($calendar['cid'], $year, $month));


	add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid']));
add_breadcrumb("$monthnames[$month] $year", get_calendar_link($calendar['cid'], $year, $month));


	$next_month = get_next_month($month, $year);

 
	$prev_month = get_prev_month($month, $year);


	$prev_month = get_prev_month($month, $year);


	$prev_link = get_calendar_link($calendar['cid'], $prev_month['year'], $prev_month['month']);
$next_link = get_calendar_link($calendar['cid'], $next_month['year'], $next_month['month']);






















	$prev_month_link = '';
if($prev_month['year'] >= 1901)
{
$prev_link = get_calendar_link($calendar['cid'], $prev_month['year'], $prev_month['month']);

eval("\$prev_month_link = \"".$templates->get("calendar_prevlink")."\";");
}

$next_month = get_next_month($month, $year);

$next_month_link = '';
if($next_month['year'] <= my_date("Y")+5)
{
$next_link = get_calendar_link($calendar['cid'], $next_month['year'], $next_month['month']);

eval("\$next_month_link = \"".$templates->get("calendar_nextlink")."\";");
}

$sep = '';
if(!empty($prev_month_link) && !empty($next_month_link))
{
$sep = " | ";
}


// Start constructing the calendar

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



// Start constructing the calendar

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


	$month_start_weekday = gmdate("w", gmmktime(0, 0, 0, $month, $calendar['startofweek']+1, $year));

	$month_start_weekday = gmdate("w", adodb_gmmktime(0, 0, 0, $month, $calendar['startofweek']+1, $year));





	$prev_month_days = gmdate("t", gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));

	$prev_month_days = gmdate("t", adodb_gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));


// This is if we have days in the previous month to show
if($month_start_weekday != $weekdays[0] || $calendar['startofweek'] != 0)
{


// This is if we have days in the previous month to show
if($month_start_weekday != $weekdays[0] || $calendar['startofweek'] != 0)
{

		$prev_days = $day = gmdate("t", gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));

		$prev_days = $day = gmdate("t", adodb_gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));

		$day -= array_search(($month_start_weekday), $weekdays);
$day += $calendar['startofweek']+1;
if($day > $prev_month_days+1)

		$day -= array_search(($month_start_weekday), $weekdays);
$day += $calendar['startofweek']+1;
if($day > $prev_month_days+1)

Zeile 2343Zeile 2377
	}

// So now we fetch events for this month (nb, cache events for past month, current month and next month for mini calendars too)

	}

// So now we fetch events for this month (nb, cache events for past month, current month and next month for mini calendars too)

	$start_timestamp = gmmktime(0, 0, 0, $calendar_month, $day, $calendar_year);
$num_days = gmdate("t", gmmktime(0, 0, 0, $month, 1, $year));

	$start_timestamp = adodb_gmmktime(0, 0, 0, $calendar_month, $day, $calendar_year);
$num_days = gmdate("t", adodb_gmmktime(0, 0, 0, $month, 1, $year));





	$month_end_weekday = gmdate("w", gmmktime(0, 0, 0, $month, $num_days, $year));

	$month_end_weekday = gmdate("w", adodb_gmmktime(0, 0, 0, $month, $num_days, $year));

	$next_days = 6-$month_end_weekday+$calendar['startofweek'];

// More than a week? Go one week back

	$next_days = 6-$month_end_weekday+$calendar['startofweek'];

// More than a week? Go one week back

Zeile 2356Zeile 2390
	}
if($next_days > 0)
{

	}
if($next_days > 0)
{

		$end_timestamp = gmmktime(23, 59, 59, $next_month['month'], $next_days, $next_month['year']);

		$end_timestamp = adodb_gmmktime(23, 59, 59, $next_month['month'], $next_days, $next_month['year']);

	}
else
{
// We don't need days from the next month

	}
else
{
// We don't need days from the next month

		$end_timestamp = gmmktime(23, 59, 59, $month, $num_days, $year);

		$end_timestamp = adodb_gmmktime(23, 59, 59, $month, $num_days, $year);

	}

$events_cache = get_events($calendar, $start_timestamp, $end_timestamp, $calendar_permissions['canmoderateevents']);

	}

$events_cache = get_events($calendar, $start_timestamp, $end_timestamp, $calendar_permissions['canmoderateevents']);

Zeile 2417Zeile 2451

if($weekday_id == 0)
{


if($weekday_id == 0)
{

				$week_stamp = gmmktime(0, 0, 0, $calendar_month, $day, $calendar_year);

				$week_stamp = adodb_gmmktime(0, 0, 0, $calendar_month, $day, $calendar_year);

				$week_link = get_calendar_week_link($calendar['cid'], $week_stamp);
}


				$week_link = get_calendar_week_link($calendar['cid'], $week_stamp);
}


Zeile 2425Zeile 2459
			{
break;
}

			{
break;
}


$day_events = '';

 

// Any events on this specific day?


// Any events on this specific day?

 
			$day_events = $event_lang = '';

			if(is_array($events_cache) && array_key_exists("{$day}-{$calendar_month}-{$calendar_year}", $events_cache))
{
$total_events = count($events_cache["$day-$calendar_month-$calendar_year"]);
if($total_events > $calendar['eventlimit'] && $calendar['eventlimit'] != 0)
{
if($total_events > 1)

			if(is_array($events_cache) && array_key_exists("{$day}-{$calendar_month}-{$calendar_year}", $events_cache))
{
$total_events = count($events_cache["$day-$calendar_month-$calendar_year"]);
if($total_events > $calendar['eventlimit'] && $calendar['eventlimit'] != 0)
{
if($total_events > 1)

					{
$day_events = "<div style=\"margin-bottom: 4px;\"><a href=\"".get_calendar_link($calendar['cid'], $calendar_year, $calendar_month, $day)."\" class=\"smalltext\">{$total_events} {$lang->events}</a></div>\n";
}

					{
$event_lang = $lang->events;
}

					else
{

					else
{

						$day_events = "<div style=\"margin-bottom: 4px;\"><a href=\"".get_calendar_link($calendar['cid'], $calendar_year, $calendar_month, $day)."\" class=\"smalltext\">1 {$lang->event}</a></div>\n";

						$event_lang = $lang->event;

					}

					}

 

$calendar['link'] = get_calendar_link($calendar['cid'], $calendar_year, $calendar_month, $day);
eval("\$day_events = \"".$templates->get("calendar_weekrow_day_events")."\";");

				}
else
{

				}
else
{