Zeile 11 | Zeile 11 |
---|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'calendar.php');
|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'calendar.php');
|
$templatelist = "calendar_weekdayheader,calendar_weekrow_day,calendar_weekrow,calendar,calendar_addevent,calendar_year,calendar_day,calendar_select,calendar_repeats,calendar_weekview_day_event_time"; $templatelist .= ",calendar_weekview_day,calendar_weekview_day_event,calendar_mini_weekdayheader,calendar_mini_weekrow_day,calendar_mini_weekrow,calendar_mini,calendar_mini_weekrow_day_link,calendar_move"; $templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_dayview_event,calendar_dayview,codebuttons,calendar_weekrow_day_events,calendar_weekview_month,calendar_addeventlink"; $templatelist .= ",calendar_jump,calendar_jump_option,calendar_editevent,calendar_dayview_birthdays_bday,calendar_dayview_birthdays,calendar_dayview_noevents,calendar_addevent_calendarselect_hidden"; $templatelist .= ",calendar_weekrow_day_birthdays,calendar_weekview_day_birthdays,calendar_year_sel,calendar_event_userstar,calendar_addevent_calendarselect,calendar_eventbit,calendar_event,calendar_weekview";
| $templatelist = "calendar_weekdayheader,calendar_weekrow_day,calendar_weekrow,calendar,calendar_addevent,calendar_year,calendar_day,calendar_select,calendar_repeats,calendar_weekview_day_event_time,calendar_weekview_nextlink"; $templatelist .= ",calendar_weekview_day,calendar_weekview_day_event,calendar_mini_weekdayheader,calendar_mini_weekrow_day,calendar_mini_weekrow,calendar_mini,calendar_mini_weekrow_day_link,calendar_weekview_prevlink"; $templatelist .= ",calendar_event_editbutton,calendar_event_modoptions,calendar_dayview_event,calendar_dayview,codebuttons,calendar_weekrow_day_events,calendar_weekview_month,calendar_addeventlink,calendar_weekview"; $templatelist .= ",calendar_jump,calendar_jump_option,calendar_editevent,calendar_dayview_birthdays_bday,calendar_dayview_birthdays,calendar_dayview_noevents,calendar_addevent_calendarselect_hidden,calendar_nextlink"; $templatelist .= ",calendar_weekrow_day_birthdays,calendar_weekview_day_birthdays,calendar_year_sel,calendar_event_userstar,calendar_addevent_calendarselect,calendar_eventbit,calendar_event,calendar_move,calendar_prevlink";
|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_calendar.php";
| require_once "./global.php"; require_once MYBB_ROOT."inc/functions_calendar.php";
|
Zeile 799 | Zeile 799 |
---|
}
$event['name'] = htmlspecialchars_uni($event['name']);
|
}
$event['name'] = htmlspecialchars_uni($event['name']);
|
| $event['timezone'] = (float)$event['timezone'];
|
add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid'])); add_breadcrumb($event['name'], get_event_link($event['eid']));
| add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid'])); add_breadcrumb($event['name'], get_event_link($event['eid']));
|
Zeile 1444 | Zeile 1445 |
---|
$event['description'] = $parser->parse_message($event['description'], $event_parser_options);
// Get the usergroup
|
$event['description'] = $parser->parse_message($event['description'], $event_parser_options);
// Get the usergroup
|
if($event['username'])
| if($event['usergroup'])
|
{
|
{
|
if(!$event['displaygroup']) { $event['displaygroup'] = $event['usergroup']; } $user_usergroup = $groupscache[$event['displaygroup']]; }
| $user_usergroup = usergroup_permissions($event['usergroup']); }
|
else {
|
else {
|
$user_usergroup = $groupscache[1];
| $user_usergroup = usergroup_permissions(1); }
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
if(!$event['displaygroup']) { $event['displaygroup'] = $event['usergroup']; }
$display_group = usergroup_displaygroup($event['displaygroup']); if(is_array($display_group)) { $user_usergroup = array_merge($user_usergroup, $display_group);
|
}
$titles_cache = $cache->read("usertitles");
| }
$titles_cache = $cache->read("usertitles");
|
Zeile 1489 | Zeile 1499 |
---|
}
if($user_usergroup['stars'])
|
}
if($user_usergroup['stars'])
|
{
| {
|
$event['stars'] = $user_usergroup['stars']; }
| $event['stars'] = $user_usergroup['stars']; }
|
Zeile 1536 | Zeile 1546 |
---|
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 1556 | Zeile 1566 |
---|
$end_time = gmdate("Hi", $event['endtime_user']);
$event['repeats'] = my_unserialize($event['repeats']);
|
$end_time = gmdate("Hi", $event['endtime_user']);
$event['repeats'] = my_unserialize($event['repeats']);
|
|
|
// Event only runs over one day if($start_day == $end_day && $event['repeats']['repeats'] == 0) {
| // Event only runs over one day if($start_day == $end_day && $event['repeats']['repeats'] == 0) {
|
Zeile 1565 | Zeile 1575 |
---|
if($start_time != 0000 && $end_time != 2359) { $time_period .= $lang->comma.gmdate($mybb->settings['timeformat'], $event['starttime_user'])." - ".gmdate($mybb->settings['timeformat'], $event['endtime_user']);
|
if($start_time != 0000 && $end_time != 2359) { $time_period .= $lang->comma.gmdate($mybb->settings['timeformat'], $event['starttime_user'])." - ".gmdate($mybb->settings['timeformat'], $event['endtime_user']);
|
}
| }
|
else { $time_period .= $lang->comma.$lang->all_day;
| else { $time_period .= $lang->comma.$lang->all_day;
|
Zeile 1585 | Zeile 1595 |
---|
$repeats = fetch_friendly_repetition($event); if($repeats)
|
$repeats = fetch_friendly_repetition($event); if($repeats)
|
{
| {
|
eval("\$repeats = \"".$templates->get("calendar_repeats")."\";"); }
| eval("\$repeats = \"".$templates->get("calendar_repeats")."\";"); }
|
Zeile 1612 | Zeile 1622 |
---|
{ $event_class = " trow_shaded"; }
|
{ $event_class = " trow_shaded"; }
|
}
$month = my_date("n");
| }
$month = my_date("n");
|
$yearsel = ''; for($year_sel = my_date("Y"); $year_sel < (my_date("Y") + 5); ++$year_sel) {
| $yearsel = ''; for($year_sel = my_date("Y"); $year_sel < (my_date("Y") + 5); ++$year_sel) {
|
Zeile 1636 | Zeile 1646 |
---|
// 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 if($mybb->input['calendar']) { $query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'"); $calendar = $db->fetch_array($query); } // Showing the default calendar else { $query = $db->simple_select("calendars", "*", "disporder='1'"); $calendar = $db->fetch_array($query); }
// Invalid calendar? if(!$calendar) { 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();
| { // Showing a particular calendar if($mybb->input['calendar']) { $query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'"); $calendar = $db->fetch_array($query); } // Showing the default calendar else { $query = $db->simple_select("calendars", "*", "disporder='1'"); $calendar = $db->fetch_array($query); }
// Invalid calendar? if(!$calendar) { 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();
|
}
// Incoming year?
|
}
// Incoming year?
|
if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= my_date("Y")+5)
| if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= my_date("Y")+5 && $mybb->get_input('year', MyBB::INPUT_INT) >= 1901)
|
{ $year = $mybb->get_input('year', MyBB::INPUT_INT); }
| { $year = $mybb->get_input('year', MyBB::INPUT_INT); }
|
Zeile 1784 | Zeile 1794 |
---|
$event['description'] = $parser->parse_message($event['description'], $event_parser_options);
// Get the usergroup
|
$event['description'] = $parser->parse_message($event['description'], $event_parser_options);
// Get the usergroup
|
if($event['username'])
| if($event['usergroup'])
|
{
|
{
|
if(!$event['displaygroup']) { $event['displaygroup'] = $event['usergroup']; } $user_usergroup = $groupscache[$event['displaygroup']]; }
| $user_usergroup = usergroup_permissions($event['usergroup']); }
|
else {
|
else {
|
$user_usergroup = $groupscache[1];
| $user_usergroup = usergroup_permissions(1); }
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
if(!$event['displaygroup']) { $event['displaygroup'] = $event['usergroup']; }
$display_group = usergroup_displaygroup($event['displaygroup']); if(is_array($display_group)) { $user_usergroup = array_merge($user_usergroup, $display_group);
|
}
$titles_cache = $cache->read("usertitles");
| }
$titles_cache = $cache->read("usertitles");
|
Zeile 1810 | Zeile 1829 |
---|
// Do nothing, no need for an extra variable.. } elseif($user_usergroup['usertitle'] != "")
|
// Do nothing, no need for an extra variable.. } elseif($user_usergroup['usertitle'] != "")
|
{ $event['usertitle'] = $user_usergroup['usertitle'];
| { $event['usertitle'] = $user_usergroup['usertitle'];
|
} elseif(is_array($titles_cache) && !$user_usergroup['usertitle']) {
| } elseif(is_array($titles_cache) && !$user_usergroup['usertitle']) {
|
Zeile 1831 | Zeile 1850 |
---|
if($user_usergroup['stars']) { $event['stars'] = $user_usergroup['stars'];
|
if($user_usergroup['stars']) { $event['stars'] = $user_usergroup['stars'];
|
}
| }
|
if(empty($event['starimage']))
|
if(empty($event['starimage']))
|
{
| {
|
$event['starimage'] = $user_usergroup['starimage']; }
| $event['starimage'] = $user_usergroup['starimage']; }
|
Zeile 1842 | Zeile 1861 |
---|
for($i = 0; $i < $event['stars']; ++$i) { eval("\$event['userstars'] .= \"".$templates->get("calendar_event_userstar", 1, 0)."\";");
|
for($i = 0; $i < $event['stars']; ++$i) { eval("\$event['userstars'] .= \"".$templates->get("calendar_event_userstar", 1, 0)."\";");
|
}
| }
|
if($event['userstars'] && $event['starimage'] && $event['stars']) { $event['userstars'] .= "<br />";
| if($event['userstars'] && $event['starimage'] && $event['stars']) { $event['userstars'] .= "<br />";
|
Zeile 1874 | Zeile 1893 |
---|
$event['usertitle'] = htmlspecialchars_uni($event['usertitle']);
if($event['ignoretimezone'] == 0)
|
$event['usertitle'] = htmlspecialchars_uni($event['usertitle']);
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 1913 | Zeile 1932 |
---|
$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']);
|
} }
| } }
|
else { $time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']);
| else { $time_period = gmdate($mybb->settings['dateformat'], $event['starttime_user']);
|
Zeile 1980 | Zeile 1999 |
---|
// View all events for a specific week if($mybb->input['action'] == "weekview")
|
// View all events for a specific week if($mybb->input['action'] == "weekview")
|
{ // Showing a particular calendar if($mybb->input['calendar'])
| { // Showing a particular calendar if($mybb->input['calendar'])
|
{ $query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'"); $calendar = $db->fetch_array($query);
| { $query = $db->simple_select("calendars", "*", "cid='{$mybb->input['calendar']}'"); $calendar = $db->fetch_array($query);
|
Zeile 2005 | Zeile 2024 |
---|
if($calendar_permissions['canviewcalendar'] != 1) { error_no_permission();
|
if($calendar_permissions['canviewcalendar'] != 1) { error_no_permission();
|
}
| }
|
$weekdays = fetch_weekday_structure($calendar['startofweek']);
|
$weekdays = fetch_weekday_structure($calendar['startofweek']);
|
|
|
$yearsel = ''; for($year_sel = my_date("Y"); $year_sel < (my_date("Y") + 5); ++$year_sel) {
| $yearsel = ''; for($year_sel = my_date("Y"); $year_sel < (my_date("Y") + 5); ++$year_sel) {
|
Zeile 2017 | Zeile 2036 |
---|
// No incoming week, show THIS week if(empty($mybb->input['week']))
|
// No incoming week, show THIS week if(empty($mybb->input['week']))
|
{
| {
|
list($day, $month, $year) = explode("-", my_date("j-n-Y")); $php_weekday = gmdate("w", adodb_gmmktime(0, 0, 0, $month, $day, $year)); $my_weekday = array_search($php_weekday, $weekdays);
| list($day, $month, $year) = explode("-", my_date("j-n-Y")); $php_weekday = gmdate("w", adodb_gmmktime(0, 0, 0, $month, $day, $year)); $my_weekday = array_search($php_weekday, $weekdays);
|
Zeile 2028 | Zeile 2047 |
---|
else { $mybb->input['week'] = (int)str_replace("n", "-", $mybb->get_input('week'));
|
else { $mybb->input['week'] = (int)str_replace("n", "-", $mybb->get_input('week'));
|
// No negative years please ;) if($mybb->input['week'] < -62167219200)
| // Nothing before 1901 please ;) if($mybb->input['week'] < -2177625600)
|
{
|
{
|
$mybb->input['week'] = -62167219200;
| $mybb->input['week'] = -2177625600;
|
} }
| } }
|
Zeile 2066 | Zeile 2085 |
---|
if($calendar['showbirthdays'] == 1) { $birthdays = get_birthdays($bday_months);
|
if($calendar['showbirthdays'] == 1) { $birthdays = get_birthdays($bday_months);
|
}
| }
|
// We load events for the entire month date range - for our mini calendars too $events_from = adodb_gmmktime(0, 0, 0, $week_from[1], 1, $week_from[2]); $events_to = adodb_gmmktime(0, 0, 0, $week_to[1], $week_to[3], $week_to[2]);
|
// We load events for the entire month date range - for our mini calendars too $events_from = adodb_gmmktime(0, 0, 0, $week_from[1], 1, $week_from[2]); $events_to = adodb_gmmktime(0, 0, 0, $week_to[1], $week_to[3], $week_to[2]);
|
|
|
$events_cache = get_events($calendar, $events_from, $events_to, $calendar_permissions['canmoderateevents']);
|
$events_cache = get_events($calendar, $events_from, $events_to, $calendar_permissions['canmoderateevents']);
|
$today = my_date("dnY");
$next_week = $mybb->input['week'] + 604800; $next_link = get_calendar_week_link($calendar['cid'], $next_week);
| $today = my_date("dnY");
|
$prev_week = $mybb->input['week'] - 604800;
|
$prev_week = $mybb->input['week'] - 604800;
|
$prev_link = get_calendar_week_link($calendar['cid'], $prev_week);
| $prev_week_link = ''; if(my_date("Y", $prev_week) >= 1901) { $prev_link = get_calendar_week_link($calendar['cid'], $prev_week);
eval("\$prev_week_link = \"".$templates->get("calendar_weekview_prevlink")."\";"); }
$next_week = $mybb->input['week'] + 604800;
$next_week_link = ''; if(my_date("Y", $next_week)+1 <= my_date("Y")+5) { $next_link = get_calendar_week_link($calendar['cid'], $next_week);
eval("\$next_week_link = \"".$templates->get("calendar_weekview_nextlink")."\";"); }
$sep = ''; if(!empty($prev_week_link) && !empty($next_week_link)) { $sep = " | "; }
|
$weekday_date = $mybb->input['week'];
| $weekday_date = $mybb->input['week'];
|
Zeile 2276 | Zeile 2316 |
---|
$plugins->run_hooks("calendar_main_view");
// Incoming year?
|
$plugins->run_hooks("calendar_main_view");
// Incoming year?
|
if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= my_date("Y")+5)
| if(isset($mybb->input['year']) && $mybb->get_input('year', MyBB::INPUT_INT) <= my_date("Y")+5 && $mybb->get_input('year', MyBB::INPUT_INT) >= 1901)
|
{ $year = $mybb->get_input('year', MyBB::INPUT_INT); }
| { $year = $mybb->get_input('year', MyBB::INPUT_INT); }
|
Zeile 2299 | Zeile 2339 |
---|
add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid'])); add_breadcrumb("$monthnames[$month] $year", get_calendar_link($calendar['cid'], $year, $month));
|
add_breadcrumb(htmlspecialchars_uni($calendar['name']), get_calendar_link($calendar['cid'])); add_breadcrumb("$monthnames[$month] $year", get_calendar_link($calendar['cid'], $year, $month));
|
$next_month = get_next_month($month, $year);
| |
$prev_month = get_prev_month($month, $year);
|
$prev_month = get_prev_month($month, $year);
|
$prev_link = get_calendar_link($calendar['cid'], $prev_month['year'], $prev_month['month']); $next_link = get_calendar_link($calendar['cid'], $next_month['year'], $next_month['month']);
| $prev_month_link = ''; if($prev_month['year'] >= 1901) { $prev_link = get_calendar_link($calendar['cid'], $prev_month['year'], $prev_month['month']);
eval("\$prev_month_link = \"".$templates->get("calendar_prevlink")."\";"); }
$next_month = get_next_month($month, $year);
$next_month_link = ''; if($next_month['year'] <= my_date("Y")+5) { $next_link = get_calendar_link($calendar['cid'], $next_month['year'], $next_month['month']);
eval("\$next_month_link = \"".$templates->get("calendar_nextlink")."\";"); }
$sep = ''; if(!empty($prev_month_link) && !empty($next_month_link)) { $sep = " | "; }
|
// Start constructing the calendar
| // Start constructing the calendar
|