Vergleich calendar.php - 1.8.10 - 1.8.21

  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_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_mini_weekrow_day_link,calendar_move";
$templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_dayview_event,calendar_dayview,codebuttons,calendar_weekrow_day_events,calendar_weekview_month,calendar_addeventlink";
$templatelist .= ",calendar_jump,calendar_jump_option,calendar_editevent,calendar_dayview_birthdays_bday,calendar_dayview_birthdays,calendar_dayview_noevents,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,calendar_weekview";

$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 "./global.php";
require_once MYBB_ROOT."inc/functions_calendar.php";

Zeile 1445Zeile 1445
	$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

	if($event['username'])

	if($event['usergroup'])

	{

	{

		if(!$event['displaygroup'])
{
$event['displaygroup'] = $event['usergroup'];
}
$user_usergroup = $groupscache[$event['displaygroup']];
}

		$user_usergroup = usergroup_permissions($event['usergroup']);
}





	else
{

	else
{

		$user_usergroup = $groupscache[1];














		$user_usergroup = usergroup_permissions(1);
}

$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$event['displaygroup'])
{
$event['displaygroup'] = $event['usergroup'];
}

$display_group = usergroup_displaygroup($event['displaygroup']);
if(is_array($display_group))
{
$user_usergroup = array_merge($user_usergroup, $display_group);

	}

$titles_cache = $cache->read("usertitles");

	}

$titles_cache = $cache->read("usertitles");

Zeile 1490Zeile 1499
		}

if($user_usergroup['stars'])

		}

if($user_usergroup['stars'])

		{

		{

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


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


Zeile 1555Zeile 1564
		$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']);

		$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['repeats'] = my_unserialize($event['repeats']);

// Event only runs over one day

		$event['repeats'] = my_unserialize($event['repeats']);

// Event only runs over one day

Zeile 1595Zeile 1604
	{
eval("\$edit_event = \"".$templates->get("calendar_event_editbutton")."\";");
if($calendar_permissions['canmoderateevents'] == 1)

	{
eval("\$edit_event = \"".$templates->get("calendar_event_editbutton")."\";");
if($calendar_permissions['canmoderateevents'] == 1)

		{

		{

			if($event['visible'] == 1)
{
$approve = $lang->unapprove_event;

			if($event['visible'] == 1)
{
$approve = $lang->unapprove_event;

Zeile 1613Zeile 1622
		{
$event_class = " trow_shaded";
}

		{
$event_class = " trow_shaded";
}

	}

$month = my_date("n");


	}

$month = my_date("n");


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

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

Zeile 1637Zeile 1646

// View all events on a specific day.
if($mybb->input['action'] == "dayview")


// View all events on a specific day.
if($mybb->input['action'] == "dayview")

{
// Showing a particular calendar
if($mybb->input['calendar'])
{
$query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'");
$calendar = $db->fetch_array($query);
}
// Showing the default calendar
else
{
$query = $db->simple_select("calendars", "*", "disporder='1'");
$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)
{

{
// Showing a particular calendar
if($mybb->input['calendar'])
{
$query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'");
$calendar = $db->fetch_array($query);
}
// Showing the default calendar
else
{
$query = $db->simple_select("calendars", "*", "disporder='1'");
$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)
{

		error_no_permission();
}

// Incoming year?

		error_no_permission();
}

// Incoming year?

	if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= 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->get_input('year', MyBB::INPUT_INT);
}

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

Zeile 1785Zeile 1794
			$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

			if($event['username'])

			if($event['usergroup'])

			{

			{

				if(!$event['displaygroup'])
{
$event['displaygroup'] = $event['usergroup'];
}
$user_usergroup = $groupscache[$event['displaygroup']];
}

				$user_usergroup = usergroup_permissions($event['usergroup']);
}





			else
{

			else
{

				$user_usergroup = $groupscache[1];














				$user_usergroup = usergroup_permissions(1);
}

$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

if(!$event['displaygroup'])
{
$event['displaygroup'] = $event['usergroup'];
}

$display_group = usergroup_displaygroup($event['displaygroup']);
if(is_array($display_group))
{
$user_usergroup = array_merge($user_usergroup, $display_group);

			}

$titles_cache = $cache->read("usertitles");

			}

$titles_cache = $cache->read("usertitles");

Zeile 1981Zeile 1999

// View all events for a specific week
if($mybb->input['action'] == "weekview")


// View all events for a specific week
if($mybb->input['action'] == "weekview")

{

{

	// Showing a particular calendar
if($mybb->input['calendar'])
{

	// Showing a particular calendar
if($mybb->input['calendar'])
{

Zeile 2006Zeile 2024
	if($calendar_permissions['canviewcalendar']  != 1)
{
error_no_permission();

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

	}

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

	}

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


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


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

Zeile 2029Zeile 2047
	else
{
$mybb->input['week'] = (int)str_replace("n", "-", $mybb->get_input('week'));

	else
{
$mybb->input['week'] = (int)str_replace("n", "-", $mybb->get_input('week'));

		// No negative years please ;)
if($mybb->input['week'] < -62167219200)

		// Nothing before 1901 please ;)
if($mybb->input['week'] < -2177625600)

		{

		{

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

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

		}
}


		}
}


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

$today = my_date("dnY");

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

$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 2091Zeile 2130
		$weekday_month = gmdate("n", $weekday_date);
$weekday_year = gmdate("Y", $weekday_date);
$weekday_day = gmdate("j", $weekday_date);

		$weekday_month = gmdate("n", $weekday_date);
$weekday_year = gmdate("Y", $weekday_date);
$weekday_day = gmdate("j", $weekday_date);





		// Special shading for today
$day_shaded = '';
if(gmdate("dnY", $weekday_date) == $today)

		// Special shading for today
$day_shaded = '';
if(gmdate("dnY", $weekday_date) == $today)

Zeile 2277Zeile 2316
	$plugins->run_hooks("calendar_main_view");

// Incoming year?

	$plugins->run_hooks("calendar_main_view");

// Incoming year?

	if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= 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->get_input('year', MyBB::INPUT_INT);
}

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

Zeile 2300Zeile 2339
	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



// Start constructing the calendar