Vergleich calendar.php - 1.6.2 - 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 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']);


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

	$query = $db->simple_select("events", "*", "eid='".intval($mybb->input['eid'])."'");
$event = $db->fetch_array($query);





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

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

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


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

	$new_calendar = $db->fetch_array($query);

	$new_calendar = $db->fetch_array($query);


if(!$new_calendar['cid'])
{
error($lang->invalid_calendar);


if(!$new_calendar['cid'])
{
error($lang->invalid_calendar);

	}

	}


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


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

Zeile 1076Zeile 1080
	}

$plugins->run_hooks("calendar_do_move_start");

	}

$plugins->run_hooks("calendar_do_move_start");





	$updated_event = array(
"cid" => $new_calendar['cid']
);

	$updated_event = array(
"cid" => $new_calendar['cid']
);

Zeile 1089Zeile 1093

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



$plugins->run_hooks("calendar_approve_start");


Zeile 1165Zeile 1169
	}

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

	}

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

	{

	{

		error_no_permission();
}


		error_no_permission();
}


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 1378Zeile 1382
		$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 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']);