Vergleich inc/functions_calendar.php - 1.8.4 - 1.8.20

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
/**
* Build a mini calendar for a specific month
*

/**
* Build a mini calendar for a specific month
*

 * @param array The calendar array for the calendar
* @param int The month of the year
* @param int The year
* @param array Optional events cache for this calendar

 * @param array $calendar The calendar array for the calendar
* @param int $month The month of the year
* @param int $year The year
* @param array $events_cache Optional events cache for this calendar

 * @return string The built mini calendar
*/
function build_mini_calendar($calendar, $month, $year, &$events_cache)

 * @return string The built mini calendar
*/
function build_mini_calendar($calendar, $month, $year, &$events_cache)

Zeile 43Zeile 43
	$prev_month = get_prev_month($month, $year);

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

	$prev_month = get_prev_month($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']));

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

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

		$day = gmdate("t", gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));

		$prev_days = $day = gmdate("t", gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));

		$day -= array_search(($month_start_weekday), $weekdays);
$day += $calendar['startofweek']+1;

		$day -= array_search(($month_start_weekday), $weekdays);
$day += $calendar['startofweek']+1;

 
		if($day > $prev_month_days+1)
{
// Go one week back
$day -= 7;
}

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

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


if($day > 31 && $calendar['startofweek'] == 1 && $prev_month_days == 30)
{
// We need to fix it for these days
$day = 25;
}
}

	}







	else
{
$day = $calendar['startofweek']+1;
$calendar_month = $month;
$calendar_year = $year;
}

	else
{
$day = $calendar['startofweek']+1;
$calendar_month = $month;
$calendar_year = $year;
}


$prev_month_days = gmdate("t", gmmktime(0, 0, 0, $prev_month['month'], 1, $prev_month['year']));

 

// So now we fetch events for this month
$start_timestamp = gmmktime(0, 0, 0, $calendar_month, $day, $year);


// So now we fetch events for this month
$start_timestamp = gmmktime(0, 0, 0, $calendar_month, $day, $year);

Zeile 153Zeile 152
			}
if($link_to_day)
{

			}
if($link_to_day)
{

				$day_link = "<a href=\"".get_calendar_link($calendar['cid'], $calendar_year, $calendar_month, $day)."\">{$day}</a>";


				$calendar['link'] = get_calendar_link($calendar['cid'], $calendar_year, $calendar_month, $day);
eval("\$day_link = \"".$templates->get("calendar_mini_weekrow_day_link")."\";");

			}
else
{

			}
else
{

Zeile 198Zeile 198
/**
* Fetch the calendar permissions for the current user for one or more calendars
*

/**
* Fetch the calendar permissions for the current user for one or more calendars
*

 * @param int Optional calendar ID. If none specified, permissions for all calendars are returned

 * @param int $cid Optional calendar ID. If none specified, permissions for all calendars are returned

 * @return array Array of permissions
*/
function get_calendar_permissions($cid=0)

 * @return array Array of permissions
*/
function get_calendar_permissions($cid=0)

Zeile 286Zeile 286
/**
* Fetch the calendar permissions
*

/**
* Fetch the calendar permissions
*

 * @param int Calendar ID
* @param mixed User group ID
* @return array Array of permissions for this calendar and group
* @return array Array of current permissions

 * @param int $cid Calendar ID
* @param string $gid User group ID, comma seperated
* @param array Array of permissions for this calendar and group
* @return array|void Array of current permissions or nothing if an error occured

 */
function fetch_calendar_permissions($cid, $gid, $calendar_permissions)
{

 */
function fetch_calendar_permissions($cid, $gid, $calendar_permissions)
{

Zeile 328Zeile 328
/**
* Build a calendar select list to jump between calendars
*

/**
* Build a calendar select list to jump between calendars
*

 * @param int The selected calendar ID

 * @param int $selected The selected calendar ID

 * @return string The calendar select
*/
function build_calendar_jump($selected=0)

 * @return string The calendar select
*/
function build_calendar_jump($selected=0)

Zeile 369Zeile 369
/**
* Fetch the next calendar month from a specified month/year
*

/**
* Fetch the next calendar month from a specified month/year
*

 * @param int The month
* @param int The year

 * @param int $month The month
* @param int $year The year

 * @return array Array of the next month and next year
*/
function get_next_month($month, $year)

 * @return array Array of the next month and next year
*/
function get_next_month($month, $year)

Zeile 394Zeile 394
/**
* Fetch the previous calendar month from a specified month/year
*

/**
* Fetch the previous calendar month from a specified month/year
*

 * @param int The month
* @param int The year

 * @param int $month The month
* @param int $year The year

 * @return array Array of the previous month and previous year
*/
function get_prev_month($month, $year)

 * @return array Array of the previous month and previous year
*/
function get_prev_month($month, $year)

Zeile 419Zeile 419
/**
* Fetch the events for a specific calendar and date range
*

/**
* Fetch the events for a specific calendar and date range
*

 * @param int The calendar ID
* @param int Start time stamp
* @param int End time stmap
* @param int 1 to fetch unapproved events too
* @param int The user ID to fetch private events for (0 fetches none)

 * @param int $calendar The calendar ID
* @param int $start Start time stamp
* @param int $end End time stmap
* @param int $unapproved 1 to fetch unapproved events too
* @param int $private The user ID to fetch private events for (0 fetches none)

 * @return array Array of events
*/
function get_events($calendar, $start, $end, $unapproved=0, $private=1)
{
global $db, $mybb;


 * @return array Array of events
*/
function get_events($calendar, $start, $end, $unapproved=0, $private=1)
{
global $db, $mybb;


	// We take in to account timezones here - we add/subtract 12 hours from our GMT time ranges

	// We take in to account timezones here - we either add 14 hours or subtract 12 hours from our GMT time ranges

	$start -= 12*3600;

	$start -= 12*3600;

	$end += 12*3600;

	$end += 14*3600;


$visible_where = '';
if($unapproved != 1)


$visible_where = '';
if($unapproved != 1)

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

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

			$offset = $event['timezone'];

			$offset = (float)$event['timezone'];

		}
else
{

		}
else
{

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

			$offset = (float)$mybb->user['timezone'];

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


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


Zeile 514Zeile 514
					}
else if(!$first)
{

					}
else if(!$first)
{

						if(!isset($events_cache[$day_date]))

						if(!isset($events_cache[$day_date]) || !is_array($events_cache[$day_date]))

						{
$events_cache[$day_date] = array();
}

						{
$events_cache[$day_date] = array();
}

Zeile 540Zeile 540
/**
* Fetch the birthdays for one or more months or a specific day
*

/**
* Fetch the birthdays for one or more months or a specific day
*

 * @param mixed Integer of the month or array of months
* @param int Day of the specific month (if only one month specified above)

 * @param int|array $months Integer of the month or array of months
* @param int $day Day of the specific month (if only one month specified above)

 * @return array Array of birthdays
*/

 * @return array Array of birthdays
*/

function get_birthdays($months, $day="")

function get_birthdays($months, $day=0)

{
global $db;


{
global $db;


Zeile 608Zeile 608
/**
* Fetch an ordered list of weekdays depended on a specified starting day
*

/**
* Fetch an ordered list of weekdays depended on a specified starting day
*

 * @param int The weekday we want to start the week with

 * @param int $week_start The weekday we want to start the week with

 * @return array Ordered list of weekdays dependant on start of week
*/
function fetch_weekday_structure($week_start)

 * @return array Ordered list of weekdays dependant on start of week
*/
function fetch_weekday_structure($week_start)

Zeile 643Zeile 643
/**
* Fetch a weekday name based on a number
*

/**
* Fetch a weekday name based on a number
*

 * @param int The weekday number
* @param boolean True to fetch the short name ('S'), false to fetch full name

 * @param int $weekday The weekday number
* @param boolean $short True to fetch the short name ('S'), false to fetch full name

 * @return string The weekday name
*/
function fetch_weekday_name($weekday, $short=false)

 * @return string The weekday name
*/
function fetch_weekday_name($weekday, $short=false)

Zeile 695Zeile 695
/**
* Fetches the next occurance for a repeating event.
*

/**
* Fetches the next occurance for a repeating event.
*

 * @param array The event array
* @param array The range of start/end timestamps
* @param int The last occurance of this event
* @param boolean True if this is our first iteration of this function (Does some special optimised calculations on false)

 * @param array $event The event array
* @param array $range The range of start/end timestamps
* @param int $last_occurance The last occurance of this event
* @param boolean $first True if this is our first iteration of this function (Does some special optimised calculations on false)

 * @return int The next occurance timestamp
*/
function fetch_next_occurance($event, $range, $last_occurance, $first=false)

 * @return int The next occurance timestamp
*/
function fetch_next_occurance($event, $range, $last_occurance, $first=false)

Zeile 921Zeile 921
/**
* Fetch a friendly repetition value for a specific event (Repeats every x months etc)
*

/**
* Fetch a friendly repetition value for a specific event (Repeats every x months etc)
*

 * @param array The array of the event

 * @param array $event The array of the event

 * @return string The friendly repetition string
*/
function fetch_friendly_repetition($event)

 * @return string The friendly repetition string
*/
function fetch_friendly_repetition($event)

Zeile 1069Zeile 1069
/**
* Fetch a timestamp for "the first/second etc weekday" for a month.
*

/**
* Fetch a timestamp for "the first/second etc weekday" for a month.
*

 * @param array The repetition array from the event
* @param int The month of the year
* @param int The year

 * @param array $repeats The repetition array from the event
* @param int $month The month of the year
* @param int $year The year

 * @return int The UNIX timestamp
*/
function fetch_weekday_monthly_repetition($repeats, $month, $year)

 * @return int The UNIX timestamp
*/
function fetch_weekday_monthly_repetition($repeats, $month, $year)