Vergleich calendar.php - 1.8.6 - 1.8.8

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


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 945Zeile 945
		{
$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 962
		}
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 1461
	// 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 1517
			$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 1531
		$event['userstars'] = '';
}


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


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

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


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


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

Zeile 1714Zeile 1711
			foreach($birthdays2 as $birthday)
{
if($birthday['birthdayprivacy'] == 'all')

			foreach($birthdays2 as $birthday)
{
if($birthday['birthdayprivacy'] == 'all')

				{

				{

					$bday = explode("-", $birthday['birthday']);
if($bday[2] && $bday[2] < $year)

					$bday = explode("-", $birthday['birthday']);
if($bday[2] && $bday[2] < $year)

					{

					{

						$age = $year - $bday[2];
$age = " (".$lang->sprintf($lang->years_old, $age).")";
}

						$age = $year - $bday[2];
$age = " (".$lang->sprintf($lang->years_old, $age).")";
}

Zeile 1726Zeile 1723
						$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;

				}

				}

				else
{
++$bdayhidden;

				else
{
++$bdayhidden;

Zeile 1805Zeile 1802
			// 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 1843Zeile 1836
				if(empty($event['starimage']))
{
$event['starimage'] = $user_usergroup['starimage'];

				if(empty($event['starimage']))
{
$event['starimage'] = $user_usergroup['starimage'];

				}

				}


$event['userstars'] = '';
for($i = 0; $i < $event['stars']; ++$i)


$event['userstars'] = '';
for($i = 0; $i < $event['stars']; ++$i)

Zeile 1864Zeile 1857
					$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['usertitle'] = $user_usergroup['usertitle'];

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

if($user_usergroup['usertitle'])
{
$event['usertitle'] = $user_usergroup['usertitle'];

				}
else

				}
else

				{
$event['usertitle'] = $lang->guest;
}
$event['userstars'] = '';
}


				{
$event['usertitle'] = $lang->guest;
}
$event['userstars'] = '';
}


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

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


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


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

Zeile 1900Zeile 1893
				$end_day = 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 = 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
if($start_day == $end_day && $event['repeats']['repeats'] == 0)
{

				// Event only runs over one day
if($start_day == $end_day && $event['repeats']['repeats'] == 0)
{

Zeile 1909Zeile 1902
					if($start_time != 0000 && $end_time != 2359)
{
$time_period .= $lang->comma.gmdate($mybb->settings['timeformat'], $event['starttime_user'])." - ".gmdate($mybb->settings['timeformat'], $event['endtime_user']);

					if($start_time != 0000 && $end_time != 2359)
{
$time_period .= $lang->comma.gmdate($mybb->settings['timeformat'], $event['starttime_user'])." - ".gmdate($mybb->settings['timeformat'], $event['endtime_user']);

					}

					}

					else
{
$time_period .= $lang->comma.$lang->all_day;

					else
{
$time_period .= $lang->comma.$lang->all_day;

					}
}

					}
}

				else
{
$time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']).", ".gmdate($mybb->settings['timeformat'], $event['starttime_user']);

				else
{
$time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']).", ".gmdate($mybb->settings['timeformat'], $event['starttime_user']);

Zeile 1957Zeile 1950
				}
}
eval("\$events .= \"".$templates->get("calendar_dayview_event")."\";");

				}
}
eval("\$events .= \"".$templates->get("calendar_dayview_event")."\";");

		}
}

$yearsel = '';
for($year_sel = my_date("Y"); $year_sel < (my_date("Y") + 5); ++$year_sel)
{
eval("\$yearsel .= \"".$templates->get("calendar_year_sel")."\";");
}

		}
}

$yearsel = '';
for($year_sel = my_date("Y"); $year_sel < (my_date("Y") + 5); ++$year_sel)
{
eval("\$yearsel .= \"".$templates->get("calendar_year_sel")."\";");
}


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


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

Zeile 2201Zeile 2194
			if($bday_count > 1)
{
$birthday_lang = $lang->birthdays;

			if($bday_count > 1)
{
$birthday_lang = $lang->birthdays;

			}

			}

			else
{
$birthday_lang = $lang->birthday;

			else
{
$birthday_lang = $lang->birthday;

Zeile 2230Zeile 2223

// Fetch mini calendar for each month in this week
$mini_calendars .= build_mini_calendar($calendar, $month[0], $weekday_year, $events_cache)."<br />";


// Fetch mini calendar for each month in this week
$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]];

eval("\$weekday_bits .= \"".$templates->get("calendar_weekview_month")."\";");

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

eval("\$weekday_bits .= \"".$templates->get("calendar_weekview_month")."\";");

	}


	}


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

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

Zeile 2245Zeile 2238

// Now output the page
$plugins->run_hooks("calendar_weekview_end");


// Now output the page
$plugins->run_hooks("calendar_weekview_end");





	eval("\$weekview = \"".$templates->get("calendar_weekview")."\";");
output_page($weekview);
}

	eval("\$weekview = \"".$templates->get("calendar_weekview")."\";");
output_page($weekview);
}

Zeile 2260Zeile 2253
		$calendar = $db->fetch_array($query);
}
// Showing the default calendar

		$calendar = $db->fetch_array($query);
}
// Showing the default calendar

	else

	else

	{
$query = $db->simple_select("calendars", "*", "", array('order_by' => 'disporder', 'limit' => 1));
$calendar = $db->fetch_array($query);

	{
$query = $db->simple_select("calendars", "*", "", array('order_by' => 'disporder', 'limit' => 1));
$calendar = $db->fetch_array($query);

Zeile 2320Zeile 2313
	$month_start_weekday = gmdate("w", 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']));

	$month_start_weekday = gmdate("w", 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']));





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

Zeile 2334Zeile 2327
		}
$calendar_month = $prev_month['month'];
$calendar_year = $prev_month['year'];

		}
$calendar_month = $prev_month['month'];
$calendar_year = $prev_month['year'];

	}
else

	}
else

	{
$day = $calendar['startofweek']+1;
$calendar_month = $month;

	{
$day = $calendar['startofweek']+1;
$calendar_month = $month;

Zeile 2362Zeile 2355
	{
// We don't need days from the next month
$end_timestamp = gmmktime(23, 59, 59, $month, $num_days, $year);

	{
// We don't need days from the next month
$end_timestamp = 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']);


	// Fetch birthdays
if($calendar['showbirthdays'])
{

	// Fetch birthdays
if($calendar['showbirthdays'])
{

Zeile 2391Zeile 2384
		{
// Current month always starts on 1st row
if($row == 0 && $day == $calendar['startofweek']+1)

		{
// Current month always starts on 1st row
if($row == 0 && $day == $calendar['startofweek']+1)

			{
$in_month = 1;
$calendar_month = $month;
$calendar_year = $year;

			{
$in_month = 1;
$calendar_month = $month;
$calendar_year = $year;

			}
else if($calendar_month == $prev_month['month'] && $day > $prev_month_days)
{

			}
else if($calendar_month == $prev_month['month'] && $day > $prev_month_days)
{

Zeile 2425Zeile 2418
			{
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
{