Vergleich calendar.php - 1.6.0 - 1.6.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: calendar.php 5125 2010-07-27 07:28:03Z RyanGordon $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 673Zeile 673
		error_no_permission();
}


		error_no_permission();
}


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


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

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

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

	add_breadcrumb($event['name'], get_event_link($event['eid']));

	add_breadcrumb($lang->nav_editevent);

$plugins->run_hooks("calendar_editevent_start");

	add_breadcrumb($lang->nav_editevent);

$plugins->run_hooks("calendar_editevent_start");

Zeile 789Zeile 791
		$start_year = $start_date[2];
if($event['usingtime'])
{

		$start_year = $start_date[2];
if($event['usingtime'])
{

			$start_time = $start_date[3];

			$start_time = gmdate($mybb->settings['timeformat'], $event['starttime']+$event['timezone']*3600);

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

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

Zeile 799Zeile 801
			$end_year = $end_date[2];
if($event['usingtime'])
{

			$end_year = $end_date[2];
if($event['usingtime'])
{

				$end_time = $end_date[3];

				$end_time = gmdate($mybb->settings['timeformat'], $event['endtime']+$event['timezone']*3600);

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

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

Zeile 1002Zeile 1004
	{
error_no_permission();
}

	{
error_no_permission();
}

 

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


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


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

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

	add_breadcrumb($event['name'], get_event_link($event['eid']));

	add_breadcrumb($lang->nav_move_event);

$plugins->run_hooks("calendar_move_start");

	add_breadcrumb($lang->nav_move_event);

$plugins->run_hooks("calendar_move_start");





	// Build calendar select
$query = $db->simple_select("calendars", "*", "", array("order_by" => "name", "order_dir" => "asc"));
while($calendar_option = $db->fetch_array($query))

	// Build calendar select
$query = $db->simple_select("calendars", "*", "", array("order_by" => "name", "order_dir" => "asc"));
while($calendar_option = $db->fetch_array($query))

Zeile 1021Zeile 1025
	}

$plugins->run_hooks("calendar_move_end");

	}

$plugins->run_hooks("calendar_move_end");





	eval("\$moveevent = \"".$templates->get("calendar_move")."\";");
output_page($moveevent);
}

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

	eval("\$moveevent = \"".$templates->get("calendar_move")."\";");
output_page($moveevent);
}

// 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'])."'");

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

	$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 1051Zeile 1055

// Do we have permission to view this calendar?
$calendar_permissions = get_calendar_permissions();


// Do we have permission to view this calendar?
$calendar_permissions = get_calendar_permissions();

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


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


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

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

	{
error_no_permission();
}


	{
error_no_permission();
}



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


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

Zeile 1070Zeile 1074
		error($lang->invalid_calendar);
}


		error($lang->invalid_calendar);
}


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

$plugins->run_hooks("calendar_do_move_start");

$updated_event = array(

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

$plugins->run_hooks("calendar_do_move_start");

$updated_event = array(

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

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

Zeile 1086Zeile 1090

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

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


	$plugins->run_hooks("calendar_approve_start");

$updated_event = array(

	$plugins->run_hooks("calendar_approve_start");

$updated_event = array(

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

$plugins->run_hooks("calendar_approve_end");

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

$plugins->run_hooks("calendar_approve_end");





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

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





// Unapprove an event
if($mybb->input['action'] == "unapprove")
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

// Unapprove an event
if($mybb->input['action'] == "unapprove")
{
// 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']))

	$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 1209Zeile 1213
	// Do we have permission to view this calendar?
$calendar_permissions = get_calendar_permissions($calendar['cid']);
if($calendar_permissions['canviewcalendar'] != 1 || ($calendar_permissions['canmoderateevents'] != 1 && $event['visible'] == 0))

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

	{
error_no_permission();

	{
error_no_permission();

	}

	}

 

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


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


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

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

	add_breadcrumb($event['name'], get_event_link($event['eid']));


$plugins->run_hooks("calendar_event_start");


$plugins->run_hooks("calendar_event_start");


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

 

$event_parser_options = array(
"allow_html" => $calendar['allowhtml'],


$event_parser_options = array(
"allow_html" => $calendar['allowhtml'],

Zeile 1234Zeile 1238
	if($event['username'])
{
if(!$event['displaygroup'])

	if($event['username'])
{
if(!$event['displaygroup'])

		{

		{

			$event['displaygroup'] = $event['usergroup'];
}
$user_usergroup = $groupscache[$event['displaygroup']];

			$event['displaygroup'] = $event['usergroup'];
}
$user_usergroup = $groupscache[$event['displaygroup']];

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

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

		}
else

		}
else

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

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

Zeile 1367Zeile 1371
			}
}
else

			}
}
else

		{

		{

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

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

Zeile 1376Zeile 1380
	else
{
$time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']);

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

	}

	}





	$repeats = fetch_friendly_repitition($event);

	$repeats = fetch_friendly_repetition($event);

	if($repeats)
{
$repeats = "<span class=\"smalltext\"><strong>{$lang->repeats}</strong><br />{$repeats}</span>";

	if($repeats)
{
$repeats = "<span class=\"smalltext\"><strong>{$lang->repeats}</strong><br />{$repeats}</span>";

Zeile 1390Zeile 1394
		if($calendar_permissions['canmoderateevents'] == 1)
{
if($event['visible'] == 1)

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

			{

			{

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

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

Zeile 1434Zeile 1438
	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'])."'");

		$calendar = $db->fetch_array($query);
}

		$calendar = $db->fetch_array($query);
}

	// Showing the default calendar
else
{

	// Showing the default calendar
else
{

Zeile 1568Zeile 1572
				if(!$event['displaygroup'])
{
$event['displaygroup'] = $event['usergroup'];

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

				}

				}

				$user_usergroup = $groupscache[$event['displaygroup']];
}
else

				$user_usergroup = $groupscache[$event['displaygroup']];
}
else

Zeile 1630Zeile 1634
				}

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

				}

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

				{

				{

					$event['userstars'] .= "<img src=\"".$event['starimage']."\" border=\"0\" alt=\"*\" />";

					$event['userstars'] .= "<img src=\"".$event['starimage']."\" border=\"0\" alt=\"*\" />";

				}

				}

				
if($event['userstars'] && $event['starimage'] && $event['stars'])

				
if($event['userstars'] && $event['starimage'] && $event['stars'])

				{

				{

					$event['userstars'] .= "<br />";

					$event['userstars'] .= "<br />";

				}

				}

			}
// Created by a guest or an unknown user
else
{
if(!$event['username'])

			}
// Created by a guest or an unknown user
else
{
if(!$event['username'])

				{

				{

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


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


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

if($user_usergroup['usertitle'])

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

if($user_usergroup['usertitle'])

				{

				{

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

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

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

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

					}

					}

				}
else
{

				}
else
{

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


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


			$repeats = fetch_friendly_repitition($event);

			$repeats = fetch_friendly_repetition($event);

			if($repeats)
{
$repeats = "<span class=\"smalltext\"><strong>{$lang->repeats}</strong><br />{$repeats}</span>";

			if($repeats)
{
$repeats = "<span class=\"smalltext\"><strong>{$lang->repeats}</strong><br />{$repeats}</span>";

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

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

		}
}

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

if($mybb->usergroup['canaddevents'] == 1)
{
eval("\$addevent = \"".$templates->get("calendar_addeventlink")."\";");

		}
}

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






	}

	}









if($mybb->usergroup['canaddevents'] == 1)
{
eval("\$addevent = \"".$templates->get("calendar_addeventlink")."\";");
}


	if(!$events)
{
$lang->no_events = $lang->sprintf($lang->no_events, $calendar['cid'], $day, $month, $year);

	if(!$events)
{
$lang->no_events = $lang->sprintf($lang->no_events, $calendar['cid'], $day, $month, $year);

Zeile 1758Zeile 1762
	}

// Now output the page

	}

// Now output the page

	$plugins->run_hooks("calendar_event_end");

	$plugins->run_hooks("calendar_dayview_end");


eval("\$day_view = \"".$templates->get("calendar_dayview")."\";");
output_page($day_view);


eval("\$day_view = \"".$templates->get("calendar_dayview")."\";");
output_page($day_view);

Zeile 1818Zeile 1822
	
// This is where we've come from and where we're headed
$week_from = explode("-", gmdate("j-n-Y", $mybb->input['week']));

	
// This is where we've come from and where we're headed
$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 = explode("-", gmdate("j-n-Y-t", $week_to_stamp));

	$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 = explode("-", gmdate("j-n-Y-t", $week_to_stamp));

Zeile 2104Zeile 2109
	$end_timestamp = gmmktime(23, 59, 59, $next_month['month'], $num_days, $next_month['year']);

$num_days = gmdate("t", gmmktime(0, 0, 0, $month, 1, $year));

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

$num_days = gmdate("t", gmmktime(0, 0, 0, $month, 1, $year));

 

if($day > 31 && in_array($next_month['month'], array(4, 6, 11, 9)))
{
// If we're a day over a 30 day month, gather the events from a week before too.
// Otherwise it will start on events for the 2nd - not the 'start' date for the month.
$start_timestamp -= (86400 * 7);
}


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



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