Vergleich calendar.php - 1.2.2 - 1.2.10

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: calendar.php 2429 2006-11-24 23:14:14Z chris $

 * $Id: calendar.php 3478 2007-11-15 04:11:36Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 41Zeile 41

// Make $eid an easy-to-use variable.
$eid = intval($mybb->input['eid']);


// Make $eid an easy-to-use variable.
$eid = intval($mybb->input['eid']);

 

$mybb->input['day'] = intval($mybb->input['day']);



/* If we are looking at an event, select the date for that event first. */



/* If we are looking at an event, select the date for that event first. */

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

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

{
$options = array(
"limit" => 1

{
$options = array(
"limit" => 1

Zeile 54Zeile 56
	if($event_date == FALSE)
{
error($lang->error_invalidevent);

	if($event_date == FALSE)
{
error($lang->error_invalidevent);

	}

	}

	list($day, $month, $year) = explode("-", $event_date);
}
else

	list($day, $month, $year) = explode("-", $event_date);
}
else

Zeile 64Zeile 66
	if($mybb->input['year'] && $mybb->input['year'] <= my_date("Y")+5)
{
$year = intval($mybb->input['year']);

	if($mybb->input['year'] && $mybb->input['year'] <= my_date("Y")+5)
{
$year = intval($mybb->input['year']);

	}
else

	}
else

	{
$year = my_date("Y");
}
// Then the month
if($mybb->input['month'] >=1 && $mybb->input['month'] <= 12)

	{
$year = my_date("Y");
}
// Then the month
if($mybb->input['month'] >=1 && $mybb->input['month'] <= 12)

	{

	{

		$month = intval($mybb->input['month']);
}
else

		$month = intval($mybb->input['month']);
}
else

Zeile 79Zeile 81
		$month = my_date("n");
}
// Find the number of days in that month

		$month = my_date("n");
}
// Find the number of days in that month

	$time = mktime(0, 0, 0, $month, 1, $year);

	$time = gmmktime(0, 0, 0, $month, 1, $year);

	$days = my_date("t", $time);
// Now the specific day
if(isset($mybb->input['day']) && $mybb->input['day'] >= 1 && $mybb->input['day'] <= $days)

	$days = my_date("t", $time);
// Now the specific day
if(isset($mybb->input['day']) && $mybb->input['day'] >= 1 && $mybb->input['day'] <= $days)

Zeile 88Zeile 90
	}
else
{

	}
else
{

 
		

		// Make the day the last day of the month, if the user overshot the number of days in the month
if(isset($mybb->input['day']) && $mybb->input['day'] > $days)
{

		// Make the day the last day of the month, if the user overshot the number of days in the month
if(isset($mybb->input['day']) && $mybb->input['day'] > $days)
{

Zeile 177Zeile 180
		$eventposter = $lang->guest;
}
$eventdate = explode("-", $event['date']);

		$eventposter = $lang->guest;
}
$eventdate = explode("-", $event['date']);

	$eventdate = mktime(0, 0, 0, $eventdate[1], $eventdate[0], $eventdate[2]);

	$eventdate = gmmktime(0, 0, 0, $eventdate[1], $eventdate[0], $eventdate[2]);

	$eventdate = my_date($mybb->settings['dateformat'], $eventdate, 0, 0);

add_breadcrumb($lang->nav_viewevent);

	$eventdate = my_date($mybb->settings['dateformat'], $eventdate, 0, 0);

add_breadcrumb($lang->nav_viewevent);

Zeile 205Zeile 208
		$bday_where = "birthday LIKE '$day-$month-%' OR birthday LIKE '$day-$month'";
$feb_fix = 0;
}

		$bday_where = "birthday LIKE '$day-$month-%' OR birthday LIKE '$day-$month'";
$feb_fix = 0;
}

 


	$query = $db->simple_select(TABLE_PREFIX."users", "uid, username, birthday, usergroup, displaygroup", $bday_where);

$alterbg = $theme['trow1'];

	$query = $db->simple_select(TABLE_PREFIX."users", "uid, username, birthday, usergroup, displaygroup", $bday_where);

$alterbg = $theme['trow1'];

Zeile 213Zeile 217
	while($bdays = $db->fetch_array($query))
{
$bday = explode("-", $bdays['birthday']);

	while($bdays = $db->fetch_array($query))
{
$bday = explode("-", $bdays['birthday']);

 


		if($bday[2] && $bday[2] < $year)
{
$age = $year - $bday[2];

		if($bday[2] && $bday[2] < $year)
{
$age = $year - $bday[2];

Zeile 221Zeile 226
		else
{
$age = '';

		else
{
$age = '';

		}

		}

		$bdays['username'] = format_name($bdays['username'], $bdays['usergroup'], $bdays['displaygroup']);
eval("\$birthdays .= \"".$templates->get("calendar_dayview_birthdays_bday", 1, 0)."\";");

if($alterbg == $theme['trow1'])

		$bdays['username'] = format_name($bdays['username'], $bdays['usergroup'], $bdays['displaygroup']);
eval("\$birthdays .= \"".$templates->get("calendar_dayview_birthdays_bday", 1, 0)."\";");

if($alterbg == $theme['trow1'])

		{

		{

			$alterbg = $theme['trow2'];
}
else

			$alterbg = $theme['trow2'];
}
else

Zeile 248Zeile 253
	while($event = $db->fetch_array($query))
{
$plugins->run_hooks("calendar_dayview_event");

	while($event = $db->fetch_array($query))
{
$plugins->run_hooks("calendar_dayview_event");





		if(($event['author'] == $mybb->user['uid'] && $mybb->user['uid'] != 0) || $mybb->usergroup['cancp'] == "yes")
{
$editbutton = "<a href=\"calendar.php?action=editevent&amp;eid=$event[eid]\"><img src=\"$theme[imglangdir]/postbit_edit.gif\" border=\"0\" alt=\"$lang->alt_edit\" /></a>";

		if(($event['author'] == $mybb->user['uid'] && $mybb->user['uid'] != 0) || $mybb->usergroup['cancp'] == "yes")
{
$editbutton = "<a href=\"calendar.php?action=editevent&amp;eid=$event[eid]\"><img src=\"$theme[imglangdir]/postbit_edit.gif\" border=\"0\" alt=\"$lang->alt_edit\" /></a>";

Zeile 266Zeile 271
			$eventposter = $lang_guest;
}
$eventdate = explode("-", $event['date']);

			$eventposter = $lang_guest;
}
$eventdate = explode("-", $event['date']);

		$eventdate = mktime(0, 0, 0, $eventdate[1], $eventdate[0], $eventdate[2]);

		$eventdate = gmmktime(0, 0, 0, $eventdate[1], $eventdate[0], $eventdate[2]);

		$eventdate = my_date($mybb->settings['dateformat'], $eventdate, 0, 0);
eval("\$events .= \"".$templates->get("calendar_dayview_event")."\";");
}

		$eventdate = my_date($mybb->settings['dateformat'], $eventdate, 0, 0);
eval("\$events .= \"".$templates->get("calendar_dayview_event")."\";");
}

Zeile 277Zeile 282
	}
if($birthdays)
{

	}
if($birthdays)
{

		$eventdate = mktime(0, 0, 0, $month, $day, $year);

		$eventdate = gmmktime(0, 0, 0, $month, $day, $year);

		$bdaydate = my_date($mybb->settings['dateformat'], $eventdate, 0, 0);
$lang->birthdays_on_day = sprintf($lang->birthdays_on_day, $bdaydate);
eval("\$bdaylist = \"".$templates->get("calendar_dayview_birthdays")."\";");

		$bdaydate = my_date($mybb->settings['dateformat'], $eventdate, 0, 0);
$lang->birthdays_on_day = sprintf($lang->birthdays_on_day, $bdaydate);
eval("\$bdaylist = \"".$templates->get("calendar_dayview_birthdays")."\";");

Zeile 454Zeile 459

// Now let the eventhandler do all the hard work.
if(!$eventhandler->validate_event())


// Now let the eventhandler do all the hard work.
if(!$eventhandler->validate_event())

		{

		{

			$event_errors = $eventhandler->get_friendly_errors();
$event_errors = inline_error($event_errors);
$mybb->input['action'] = "editevent";

			$event_errors = $eventhandler->get_friendly_errors();
$event_errors = inline_error($event_errors);
$mybb->input['action'] = "editevent";

Zeile 563Zeile 568
	$plugins->run_hooks("calendar_start");

$time = mktime(0, 0, 0, $month, 1, $year);

	$plugins->run_hooks("calendar_start");

$time = mktime(0, 0, 0, $month, 1, $year);

	$days = date("t", $time);

	$days = my_date("t", $time);

	$bdays = array();

// Load Birthdays

	$bdays = array();

// Load Birthdays

Zeile 574Zeile 579
		$feb_fix = 1;
}
else // Fetch only for this day

		$feb_fix = 1;
}
else // Fetch only for this day

	{

	{

		$bday_where = "birthday LIKE '%-$month-%' OR birthday LIKE '%-$month'";
$feb_fix = 0;

		$bday_where = "birthday LIKE '%-$month-%' OR birthday LIKE '%-$month'";
$feb_fix = 0;

	}

	}


$query = $db->simple_select(TABLE_PREFIX."users", "uid, username, birthday, usergroup, displaygroup", $bday_where);
while($user = $db->fetch_array($query))
{
$bday = explode("-", $user['birthday']);
if($feb_fix == 1 && $bday[0] == 29 && $bday[1] == 2)


$query = $db->simple_select(TABLE_PREFIX."users", "uid, username, birthday, usergroup, displaygroup", $bday_where);
while($user = $db->fetch_array($query))
{
$bday = explode("-", $user['birthday']);
if($feb_fix == 1 && $bday[0] == 29 && $bday[1] == 2)

		{

		{

			$bdays[1]++;
}
else

			$bdays[1]++;
}
else

Zeile 592Zeile 597
			$bdays[$bday[0]]++;
}
}

			$bdays[$bday[0]]++;
}
}

 


	$events = array();
// Load Events
$query = $db->simple_select(TABLE_PREFIX."events", "subject, private, date, eid", "date LIKE '%-{$month}-{$year}' AND ((author='{$mybb->user['uid']}' AND private='yes') OR (private!='yes'))");

	$events = array();
// Load Events
$query = $db->simple_select(TABLE_PREFIX."events", "subject, private, date, eid", "date LIKE '%-{$month}-{$year}' AND ((author='{$mybb->user['uid']}' AND private='yes') OR (private!='yes'))");

Zeile 615Zeile 621
	}
$daybits = "<tr>\n";
$count = 0;

	}
$daybits = "<tr>\n";
$count = 0;

	$sblanks = date("w", $time);

	$sblanks = my_date("w", $time);

	// Blank space before first day
if($sblanks)
{

	// Blank space before first day
if($sblanks)
{