Vergleich calendar.php - 1.4.0 - 1.4.11

  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 4037 2008-07-24 11:56:23Z ZiNgaBuRgA $

 * $Id: calendar.php 4656 2009-12-24 10:14:20Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

 
define('THIS_SCRIPT', 'calendar.php');


$templatelist = "calendar_weekdayheader,calendar_weekrow_day,calendar_weekrow,calendar_eventbit_public,calendar_eventbit_private,calendar";
$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,calendar_eventbit,calendar_addeventlink";


$templatelist = "calendar_weekdayheader,calendar_weekrow_day,calendar_weekrow,calendar_eventbit_public,calendar_eventbit_private,calendar";
$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,calendar_eventbit,calendar_addeventlink";

$templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_event,calendar_dayview_event,calendar_dayview,codebuttons,smilieinsert,calendar_editevent";

$templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_event,calendar_dayview_event,calendar_dayview,codebuttons,smilieinsert,calendar_editevent,calendar_dayview_birthdays_bday,calendar_dayview_birthdays,calendar_dayview_noevents,calendar_dayview_noevents";


require_once "./global.php";



require_once "./global.php";


Zeile 118Zeile 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 129Zeile 130
				break;
case 2:
$repeats['repeats'] = 2;

				break;
case 2:
$repeats['repeats'] = 2;

				break;

				break;

			case 3:
$repeats['repeats'] = 3;
$repeats['weeks'] = $mybb->input['repeats_3_weeks'];

			case 3:
$repeats['repeats'] = 3;
$repeats['weeks'] = $mybb->input['repeats_3_weeks'];

Zeile 149Zeile 150
			case 4:
$repeats['repeats'] = 4;
if($mybb->input['repeats_4_type'] == 1)

			case 4:
$repeats['repeats'] = 4;
if($mybb->input['repeats_4_type'] == 1)

				{

				{

					$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
{
$repeats['months'] = $mybb->input['repeats_4_months2'];

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

Zeile 180Zeile 181
				$repeats['repeats'] = 0;
}
$event['repeats'] = $repeats;

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

	}

	}


$eventhandler->set_data($event);



$eventhandler->set_data($event);


Zeile 242Zeile 243
	// Previous selections
$name = $description = '';
if(isset($mybb->input['name']))

	// Previous selections
$name = $description = '';
if(isset($mybb->input['name']))

	{

	{

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

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

	}


	}


	if(isset($mybb->input['description']))
{
$description = htmlspecialchars_uni($mybb->input['description']);

	if(isset($mybb->input['description']))
{
$description = htmlspecialchars_uni($mybb->input['description']);

Zeile 265Zeile 266
		$end_year = $mybb->input['end_year'];
$end_time = htmlspecialchars_uni($mybb->input['end_time']);
if($mybb->input['type'] == "single")

		$end_year = $mybb->input['end_year'];
$end_time = htmlspecialchars_uni($mybb->input['end_time']);
if($mybb->input['type'] == "single")

		{

		{

			$type_single = "checked=\"checked\"";
$type = "single";
}

			$type_single = "checked=\"checked\"";
$type = "single";
}

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

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

		}

		}

		if($mybb->input['repeats'])
{
$repeats_sel[$mybb->input['repeats']] = " selected=\"selected\"";

		if($mybb->input['repeats'])
{
$repeats_sel[$mybb->input['repeats']] = " selected=\"selected\"";

Zeile 333Zeile 334
		if($mybb->input['month'])
{
$month = intval($mybb->input['month']);

		if($mybb->input['month'])
{
$month = intval($mybb->input['month']);

		}
else
{

		}
else
{

			$month = my_date("n");
}
$single_month[$month] = $start_month[$month] = $end_month[$month] = "selected=\"selected\"";
if($mybb->input['year'])
{
$single_year = $start_year = $end_year = intval($mybb->input['year']);

			$month = my_date("n");
}
$single_month[$month] = $start_month[$month] = $end_month[$month] = "selected=\"selected\"";
if($mybb->input['year'])
{
$single_year = $start_year = $end_year = intval($mybb->input['year']);

		}
else

		}
else

		{
$single_year = $start_year = $end_year = my_date("Y");
}

		{
$single_year = $start_year = $end_year = my_date("Y");
}

Zeile 367Zeile 368
		$repeats_5_months2[1] = "selected=\"selected\"";
$repeats_5_years2 = 1;
$timezone = $mybb->user['timezone'];

		$repeats_5_months2[1] = "selected=\"selected\"";
$repeats_5_years2 = 1;
$timezone = $mybb->user['timezone'];

	}

// Construct option list for years
for($i = my_date('Y'); $i < (my_date('Y') + 5); ++$i)
{
if($i == $single_year)
{
$single_years .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";
}
else
{

	}

// Construct option list for years
for($i = my_date('Y'); $i < (my_date('Y') + 5); ++$i)
{
if($i == $single_year)
{
$single_years .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";
}
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 402Zeile 403
	for($i = 1; $i <= 31; ++$i)
{
if($i == $single_day)

	for($i = 1; $i <= 31; ++$i)
{
if($i == $single_day)

		{

		{

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

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

Zeile 410Zeile 411
			$single_days .= "<option value=\"{$i}\">{$i}</option>\n";
}
if($i == $start_day)

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

		{

		{

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

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

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

	if(!is_numeric($event['eid']))
{
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 483Zeile 483
	if(!$calendar['cid'])
{
error($lang->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)


// 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 499Zeile 499

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


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





	// Are we going to delete this event or just edit it?
if($mybb->input['delete'] == 1)
{

	// Are we going to delete this event or just edit it?
if($mybb->input['delete'] == 1)
{

Zeile 507Zeile 507

// 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 539
			"month" => $mybb->input['single_month'],
"year" => $mybb->input['single_year']
);

			"month" => $mybb->input['single_month'],
"year" => $mybb->input['single_year']
);

 
		$event['repeats'] = '';

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

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

Zeile 630Zeile 637
}

if($mybb->input['action'] == "editevent")

}

if($mybb->input['action'] == "editevent")

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


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

Zeile 733Zeile 740
		if($mybb->input['repeats_5_type'] == 1)
{
$repeats_5_type[1] = "checked=\"checked\"";

		if($mybb->input['repeats_5_type'] == 1)
{
$repeats_5_type[1] = "checked=\"checked\"";

		}
else
{

		}
else
{

			$repeats_5_type[2] = "checked=\"checked\"";
}
$repeats_5_day = intval($mybb->input['repeats_5_day']);

			$repeats_5_type[2] = "checked=\"checked\"";
}
$repeats_5_day = intval($mybb->input['repeats_5_day']);

Zeile 798Zeile 805
				{
case 1:
$repeats_1_days = $repeats['days'];

				{
case 1:
$repeats_1_days = $repeats['days'];

						$repeats_3_weeks = 1;
$repeats_4_type[1] = "checked=\"checked\"";

						$repeats_3_weeks = 1;
$repeats_4_type[1] = "checked=\"checked\"";

						$repeats_4_day = 1;
$repeats_4_months = 1;
$repeats_4_months2 = 1;

						$repeats_4_day = 1;
$repeats_4_months = 1;
$repeats_4_months2 = 1;

Zeile 896Zeile 903
	for($i = my_date('Y'); $i < (my_date('Y') + 5); ++$i)
{
if($i == $single_year)

	for($i = my_date('Y'); $i < (my_date('Y') + 5); ++$i)
{
if($i == $single_year)

		{

		{

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

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

		{

		{

			$start_years .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";

			$start_years .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";

		}
else
{

		}
else
{

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

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

Zeile 927Zeile 934
		if($i == $single_day)
{
$single_days .= "<option value=\"{$i}\" selected=\"selected\">{$i}</option>\n";

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

		}

		}

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

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

Zeile 1015Zeile 1022

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

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


		error($lang->error_invalidevent);
}


Zeile 1034Zeile 1041
	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();
}


Zeile 1047Zeile 1054
	{
error_no_permission();
}

	{
error_no_permission();
}






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

if(!$new_calendar['cid'])


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

if(!$new_calendar['cid'])

	{
error($lang->invalid_calendar);
}

	{
error($lang->invalid_calendar);
}


if($calendar_permissions[$mybb->input['new_calendar']]['canviewcalendar'] != 1)


if($calendar_permissions[$mybb->input['new_calendar']]['canviewcalendar'] != 1)

	{

	{

		error_no_permission();

		error_no_permission();

	}


	}


	$plugins->run_hooks("calendar_do_move_start");

$updated_event = array(

	$plugins->run_hooks("calendar_do_move_start");

$updated_event = array(

Zeile 1070Zeile 1077
	$db->update_query("events", $updated_event, "eid='{$event['eid']}'");

$plugins->run_hooks("calendar_do_move_end");

	$db->update_query("events", $updated_event, "eid='{$event['eid']}'");

$plugins->run_hooks("calendar_do_move_end");





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

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





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


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


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


Zeile 1152Zeile 1159
	}

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

	}

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

	{
error_no_permission();
}

$plugins->run_hooks("calendar_unapprove_start");

	{
error_no_permission();
}

$plugins->run_hooks("calendar_unapprove_start");


$updated_event = array(
"visible" => 0


$updated_event = array(
"visible" => 0

Zeile 1189Zeile 1196

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


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

	{

	{

		error($lang->invalid_calendar);
}


		error($lang->invalid_calendar);
}


Zeile 1252Zeile 1259
		}

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

		}

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

		{
$event['usertitle'] = $user_usergroup['usertitle'];
}

		{
$event['usertitle'] = $user_usergroup['usertitle'];
}

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

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

Zeile 1318Zeile 1325
	if($event['ignoretimezone'] == 0)
{
$offset = $event['timezone'];

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

	}
else

	}
else

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

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





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

// Events over more than one day

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

// Events over more than one day

Zeile 1350Zeile 1357
			else
{
$time_period .= ", {$lang->all_day}";

			else
{
$time_period .= ", {$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 1415Zeile 1422

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

{
// Showing a particular calendar

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

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

Zeile 1546Zeile 1553
			);

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

			);

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





			// Get the usergroup
if($event['username'])
{

			// Get the usergroup
if($event['username'])
{

Zeile 1562Zeile 1569
			}

if(!is_array($titles_cache))

			}

if(!is_array($titles_cache))

			{

			{

				// Get user titles (i guess we should improve this, maybe in version3.
$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));
while($usertitle = $db->fetch_array($query))

				// Get user titles (i guess we should improve this, maybe in version3.
$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));
while($usertitle = $db->fetch_array($query))

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

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

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

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

				{

				{

					$hascustomtitle = 1;
}


					$hascustomtitle = 1;
}


Zeile 1643Zeile 1650
				{
$event['usertitle'] = $lang->guest;
}

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

			}

			}


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


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

			{

			{

				$offset = $event['timezone'];
}
else

				$offset = $event['timezone'];
}
else

			{

			{

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


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


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

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

					}
else

					}
else

					{
$time_period .= ", {$lang->all_day}";
}

					{
$time_period .= ", {$lang->all_day}";
}

Zeile 1688Zeile 1695
				}
}
else

				}
}
else

			{

			{

				$time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']);
}


				$time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']);
}


Zeile 1708Zeile 1715
					{
$approve = $lang->unapprove_event;
$approve_value = "unapprove";

					{
$approve = $lang->unapprove_event;
$approve_value = "unapprove";

					}

					}

					else
{
$approve = $lang->approve_event;

					else
{
$approve = $lang->approve_event;

Zeile 1728Zeile 1735
	$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 1782Zeile 1786
	}

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

	{

	{

		list($day, $month, $year) = explode("-", my_date("j-n-Y"));
$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

		list($day, $month, $year) = explode("-", my_date("j-n-Y"));
$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);

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

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

	}

// This is where we've come from and where we're headed

	}

// This is where we've come from and where we're headed

Zeile 1803Zeile 1817

add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid']));
add_breadcrumb("{$monthnames[$week_from[1]]} {$week_from[2]}", get_calendar_link($calendar['cid'], $week_from[2], $week_from[1]));


add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid']));
add_breadcrumb("{$monthnames[$week_from[1]]} {$week_from[2]}", get_calendar_link($calendar['cid'], $week_from[2], $week_from[1]));

	add_breadcrumb("Weekly Overview");

	add_breadcrumb($lang->weekly_overview);


// Establish if we have a month ending in this week
if($week_from[1] != $week_to[1])


// Establish if we have a month ending in this week
if($week_from[1] != $week_to[1])

Zeile 1907Zeile 1921
						if($end_time == 2359)
{
$time_period = $lang->all_day;

						if($end_time == 2359)
{
$time_period = $lang->all_day;

						}

						}

						else
{
$time_period = $lang->finishes.gmdate($mybb->settings['timeformat'], $event['endtime_user']);

						else
{
$time_period = $lang->finishes.gmdate($mybb->settings['timeformat'], $event['endtime_user']);

Zeile 1918Zeile 1932
					{
$time_period = $lang->all_day;
}

					{
$time_period = $lang->all_day;
}

				}

				}

				$event_time = '';
if($time_period)

				$event_time = '';
if($time_period)

				{

				{

					$event_time = "<span class=\"smalltext\"> ({$time_period})</span>";
}
if($event['private'] == 1)

					$event_time = "<span class=\"smalltext\"> ({$time_period})</span>";
}
if($event['private'] == 1)

				{

				{

					$event_class = " private_event";
}
else

					$event_class = " private_event";
}
else

				{

				{

					$event_class = " public_event";
}
if($event['visible'] == 0)

					$event_class = " public_event";
}
if($event['visible'] == 0)

Zeile 1937Zeile 1951
					$event_class .= " trow_shaded";
}
eval("\$day_events .= \"".$templates->get("calendar_weekview_day_event")."\";");

					$event_class .= " trow_shaded";
}
eval("\$day_events .= \"".$templates->get("calendar_weekview_day_event")."\";");

			}
}


			}
}


		// Birthdays on this day?
$day_birthdays = "";
if($calendar['showbirthdays'] && is_array($birthdays) && array_key_exists("{$weekday_day}-{$weekday_month}", $birthdays))

		// Birthdays on this day?
$day_birthdays = "";
if($calendar['showbirthdays'] && is_array($birthdays) && array_key_exists("{$weekday_day}-{$weekday_month}", $birthdays))

Zeile 1968Zeile 1982
		$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]];

Zeile 2037Zeile 2051
	if($mybb->input['month'] >=1 && $mybb->input['month'] <= 12)
{
$month = intval($mybb->input['month']);

	if($mybb->input['month'] >=1 && $mybb->input['month'] <= 12)
{
$month = intval($mybb->input['month']);

	}
else

	}
else

	{
$month = my_date("n");
}

	{
$month = my_date("n");
}

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

// This is if we have days in the previous month to show

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

// This is if we have days in the previous month to show

	if($month_start_weekday != $weekdays[0])

	if($month_start_weekday != $weekdays[0] || $calendar['startofweek'] != 0)

	{
$day = gmdate("t", gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));
$day -= array_search(($month_start_weekday), $weekdays);

	{
$day = gmdate("t", gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));
$day -= array_search(($month_start_weekday), $weekdays);

Zeile 2099Zeile 2113
	{
$weekday_name = fetch_weekday_name($weekday);
eval("\$weekday_headers .= \"".$templates->get("calendar_weekdayheader")."\";");

	{
$weekday_name = fetch_weekday_name($weekday);
eval("\$weekday_headers .= \"".$templates->get("calendar_weekdayheader")."\";");

 
	}

// Fix offset for Start Of Week being Saturday
if($calendar_month == $prev_month['month'] && $calendar['startofweek'] > 0)
{
$day -= 7;

// Lets make sure we don't have a whole extra column for the last month
if($prev_month_days-7 >= ($day-1))
{
$day += 7;
}

	}

for($row = 0; $row < 6; ++$row) // Iterate weeks (each week gets a row)
{
foreach($weekdays as $weekday_id => $weekday)

	}

for($row = 0; $row < 6; ++$row) // Iterate weeks (each week gets a row)
{
foreach($weekdays as $weekday_id => $weekday)

		{

		{						

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

			{
$in_month = 1;

				$calendar_month = $month;
$calendar_year = $year;
}

				$calendar_month = $month;
$calendar_year = $year;
}

Zeile 2135Zeile 2161
			{
$week_stamp = gmmktime(0, 0, 0, $calendar_month, $day, $calendar_year);
$week_link = get_calendar_week_link($calendar['cid'], $week_stamp);

			{
$week_stamp = gmmktime(0, 0, 0, $calendar_month, $day, $calendar_year);
$week_link = get_calendar_week_link($calendar['cid'], $week_stamp);

			}


			}


			if($weekday_id == 0 && $calendar_month == $next_month['month'])
{
break;

			if($weekday_id == 0 && $calendar_month == $next_month['month'])
{
break;

Zeile 2162Zeile 2188
					foreach($events_cache["$day-$calendar_month-$calendar_year"] as $event)
{
$event['eventlink'] = get_event_link($event['eid']);

					foreach($events_cache["$day-$calendar_month-$calendar_year"] as $event)
{
$event['eventlink'] = get_event_link($event['eid']);

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

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


						if(my_strlen($event['name']) > 15)
{
$event['name'] = my_substr($event['name'], 0, 15) . "...";
}

						if(my_strlen($event['name']) > 15)
{
$event['name'] = my_substr($event['name'], 0, 15) . "...";
}

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

						if($event['private'] == 1)

						if($event['private'] == 1)

						{

						{

							$event_class = " private_event";
}
else

							$event_class = " private_event";
}
else

						{

						{

							$event_class = " public_event";
}
if($event['visible'] == 0)

							$event_class = " public_event";
}
if($event['visible'] == 0)

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

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

				}

				}

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

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

Zeile 2201Zeile 2227
			}

$day_link = get_calendar_link($calendar['cid'], $calendar_year, $calendar_month, $day);

			}

$day_link = get_calendar_link($calendar['cid'], $calendar_year, $calendar_month, $day);



			

			// Is the current day
if($day.$calendar_month.$year == $today && $month == $calendar_month)
{

			// Is the current day
if($day.$calendar_month.$year == $today && $month == $calendar_month)
{