Mini_Cal. cleaned up. :-D
Hopefully everything completely transferred ... I check it later
@@ -201,8 +201,10 @@ class acp_portal
|
||||
'title' => 'ACP_PORTAL_MINICALENDAR_SETTINGS',
|
||||
'vars' => array(
|
||||
'legend1' => 'ACP_PORTAL_MINICALENDAR_SETTINGS',
|
||||
'portal_long_month' => array('lang' => 'PORTAL_LONG_MONTH' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'portal_sunday_first' => array('lang' => 'PORTAL_SUNDAY_FIRST' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'portal_minicalendar_today_color' => array('lang' => 'PORTAL_MINICALENDAR_TODAY_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
|
||||
'portal_minicalendar_day_link_color' => array('lang' => 'PORTAL_MINICALENDAR_DAY_LINK_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
|
||||
'portal_minicalendar_sunday_color' => array('lang' => 'PORTAL_MINICALENDAR_SUNDAY_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -30,8 +30,10 @@ INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_glob
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_wordgraph_word_counts', '0');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_wordgraph_max_words', '80');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_wordgraph_ratio', '18');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_minicalendar_today_color', '//FF0000');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_minicalendar_day_link_color', '//006F00');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_minicalendar_today_color', '#006F00');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_minicalendar_sunday_color', '#FF0000');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_long_month', '1');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_sunday_first', '0');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_attachments_number', '8');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_poll_limit', '3');
|
||||
INSERT INTO phpbb_portal_config (config_name, config_value) VALUES ('portal_poll_allow_vote', '1');
|
||||
|
||||
@@ -212,47 +212,34 @@ $lang = array_merge($lang, array(
|
||||
|
||||
// mini calendar
|
||||
$lang = array_merge($lang, array(
|
||||
'Mini_Cal_calendar' => 'Kalender',
|
||||
'Mini_Cal_add_event' => 'Termin eintragen',
|
||||
'Mini_Cal_events' => 'Kommende Termine',
|
||||
'Mini_Cal_no_events' => 'Keine',
|
||||
'Mini_cal_this_event' => 'Ferientermine',
|
||||
'View_next_month' => 'nächster Monat',
|
||||
'View_previous_month' => 'voriger Monat',
|
||||
'MINI_CALENDAR' => 'Kalender',
|
||||
'VIEW_NEXT_MONTH' => 'nächster Monat',
|
||||
'VIEW_PREVIOUS_MONTH' => 'voriger Monat',
|
||||
|
||||
// uses MySQL DATE_FORMAT - %c long_month, numeric (1..12) - %e Day of the long_month, numeric (0..31)
|
||||
// see http://www.mysql.com/doc/D/a/Date_and_time_functions.html for more details
|
||||
// currently supports: %a, %b, %c, %d, %e, %m, %y, %Y, %H, %k, %h, %l, %i, %s, %p
|
||||
'Mini_Cal_date_format' => '%b %e',
|
||||
'Mini_Cal_date_format_Time' => '%H:%i',
|
||||
|
||||
// if you change the first day of the week in constants.php, you should change values for the short day names accordingly
|
||||
// e.g. FDOW = Sunday -> $lang['mini_cal']['day'][1] = 'Su'; ... $lang['mini_cal']['day'][7] = 'Sa';
|
||||
// FDOW = Monday -> $lang['mini_cal']['day'][1] = 'Mo'; ... $lang['mini_cal']['day'][7] = 'Su';
|
||||
'mini_cal' => array(
|
||||
'day' => array(
|
||||
'1' => 'Mo',
|
||||
'2' => 'Di',
|
||||
'3' => 'Mi',
|
||||
'4' => 'Do',
|
||||
'5' => 'Fr',
|
||||
'6' => 'Sa',
|
||||
'7' => 'So',
|
||||
'1' => 'So',
|
||||
'2' => 'Mo',
|
||||
'3' => 'Di',
|
||||
'4' => 'Mi',
|
||||
'5' => 'Do',
|
||||
'6' => 'Fr',
|
||||
'7' => 'Sa',
|
||||
),
|
||||
|
||||
'month' => array(
|
||||
'1' => 'Jan',
|
||||
'2' => 'Feb',
|
||||
'3' => 'Mär',
|
||||
'4' => 'Apr',
|
||||
'1' => 'Jan.',
|
||||
'2' => 'Feb.',
|
||||
'3' => 'Mär.',
|
||||
'4' => 'Apr.',
|
||||
'5' => 'Mai',
|
||||
'6' => 'Jun',
|
||||
'7' => 'Jul',
|
||||
'8' => 'Aug',
|
||||
'9' => 'Sep',
|
||||
'10'=> 'Okt',
|
||||
'11'=> 'Nov',
|
||||
'12'=> 'Dez',
|
||||
'6' => 'Jun.',
|
||||
'7' => 'Jul.',
|
||||
'8' => 'Aug.',
|
||||
'9' => 'Sep.',
|
||||
'10'=> 'Okt.',
|
||||
'11'=> 'Nov.',
|
||||
'12'=> 'Dez.',
|
||||
),
|
||||
|
||||
'long_month'=> array(
|
||||
|
||||
@@ -283,9 +283,12 @@ $lang = array_merge($lang, array(
|
||||
'PORTAL_MINICALENDAR_EXPLAIN' => 'Diesen Block auf dem Portal anzeigen.',
|
||||
'PORTAL_MINICALENDAR_TODAY_COLOR' => 'Farbe für den aktuellen Tag',
|
||||
'PORTAL_MINICALENDAR_TODAY_COLOR_EXPLAIN' => 'HEX oder Farbennamen sind erlaubt (Englisch!) wie z.B. #FFFFFF für Weiß oder (englische!) Farbennamen wie z.B. violet.',
|
||||
'PORTAL_MINICALENDAR_DAY_LINK_COLOR' => 'Linkfarbe für die restlichen Tage',
|
||||
'PORTAL_MINICALENDAR_DAY_LINK_COLOR_EXPLAIN' => 'HEX oder Farbennamen sind erlaubt (Englisch!) wie z.B. #FFFFFF für Weiß oder (englische!) Farbennamen wie z.B. violet.',
|
||||
|
||||
'PORTAL_MINICALENDAR_SUNDAY_COLOR' => 'Farbe für Sonntage',
|
||||
'PORTAL_MINICALENDAR_SUNDAY_COLOR_EXPLAIN' => 'HEX oder Farbennamen sind erlaubt (Englisch!) wie z.B. #FFFFFF für Weiß oder (englische!) Farbennamen wie z.B. violet.',
|
||||
'PORTAL_LONG_MONTH' => 'Langen Monatsname anzeigen',
|
||||
'PORTAL_LONG_MONTH_EXPLAIN' => 'Wenn deaktiviert, wird der Monat gekürzt z.B. Aug. statt August.',
|
||||
'PORTAL_SUNDAY_FIRST' => 'Sonntag zuerst anzeigen',
|
||||
'PORTAL_SUNDAY_FIRST_EXPLAIN' => 'Wenn deaktiviert, wird von Mo. --> So. angezeigt, ansonsten So. --> Sa.',
|
||||
));
|
||||
|
||||
?>
|
||||
@@ -224,47 +224,34 @@ $lang = array_merge($lang, array(
|
||||
|
||||
// mini calendar
|
||||
$lang = array_merge($lang, array(
|
||||
'Mini_Cal_calendar' => 'Calendar',
|
||||
'Mini_Cal_add_event' => 'Add Event',
|
||||
'Mini_Cal_events' => 'Upcoming Events',
|
||||
'Mini_Cal_no_events' => 'None',
|
||||
'Mini_cal_this_event' => 'This month holiday events',
|
||||
'View_next_month' => 'next month',
|
||||
'View_previous_month' => 'Previous month',
|
||||
'MINI_CALENDAR' => 'Calendar',
|
||||
'VIEW_NEXT_MONTH' => 'next month',
|
||||
'VIEW_PREVIOUS_MONTH' => 'Previous month',
|
||||
|
||||
// uses MySQL DATE_FORMAT - %c long_month, numeric (1..12) - %e Day of the long_month, numeric (0..31)
|
||||
// see http://www.mysql.com/doc/D/a/Date_and_time_functions.html for more details
|
||||
// currently supports: %a, %b, %c, %d, %e, %m, %y, %Y, %H, %k, %h, %l, %i, %s, %p
|
||||
'Mini_Cal_date_format' => '%b %e',
|
||||
'Mini_Cal_date_format_Time' => '%H:%i',
|
||||
|
||||
// if you change the first day of the week in constants.php, you should change values for the short day names accordingly
|
||||
// e.g. FDOW = Sunday -> $lang['mini_cal']['day'][1] = 'Su'; ... $lang['mini_cal']['day'][7] = 'Sa';
|
||||
// FDOW = Monday -> $lang['mini_cal']['day'][1] = 'Mo'; ... $lang['mini_cal']['day'][7] = 'Su';
|
||||
'mini_cal' => array(
|
||||
'day' => array(
|
||||
'1' => 'Mo',
|
||||
'2' => 'Tu',
|
||||
'3' => 'We',
|
||||
'4' => 'Th',
|
||||
'5' => 'Fr',
|
||||
'6' => 'Sa',
|
||||
'7' => 'Su',
|
||||
'1' => 'Su',
|
||||
'2' => 'Mo',
|
||||
'3' => 'Tu',
|
||||
'4' => 'We',
|
||||
'5' => 'Th',
|
||||
'6' => 'Fr',
|
||||
'7' => 'Sa',
|
||||
),
|
||||
|
||||
'month' => array(
|
||||
'1' => 'Jan',
|
||||
'2' => 'Feb',
|
||||
'3' => 'Mar',
|
||||
'4' => 'Apr',
|
||||
'1' => 'Jan.',
|
||||
'2' => 'Feb.',
|
||||
'3' => 'Mar.',
|
||||
'4' => 'Apr.',
|
||||
'5' => 'May',
|
||||
'6' => 'Jun',
|
||||
'7' => 'Jul',
|
||||
'8' => 'Aug',
|
||||
'9' => 'Sep',
|
||||
'10'=> 'Oct',
|
||||
'11'=> 'Nov',
|
||||
'12'=> 'Dec',
|
||||
'6' => 'Jun.',
|
||||
'7' => 'Jul.',
|
||||
'8' => 'Aug.',
|
||||
'9' => 'Sep.',
|
||||
'10'=> 'Oct.',
|
||||
'11'=> 'Nov.',
|
||||
'12'=> 'Dec.',
|
||||
),
|
||||
|
||||
'long_month'=> array(
|
||||
|
||||
@@ -288,9 +288,13 @@ $lang = array_merge($lang, array(
|
||||
'PORTAL_MINICALENDAR_EXPLAIN' => 'Display this block on the portal.',
|
||||
'PORTAL_MINICALENDAR_TODAY_COLOR' => 'Active day color',
|
||||
'PORTAL_MINICALENDAR_TODAY_COLOR_EXPLAIN' => 'HEX or named colors are allowed such as #FFFFFF for white, or color names like vilolet.',
|
||||
'PORTAL_MINICALENDAR_DAY_LINK_COLOR' => 'Day link color',
|
||||
'PORTAL_MINICALENDAR_DAY_LINK_COLOR_EXPLAIN'=> 'HEX or named colors are allowed such as #FFFFFF for white, or color names like vilolet.',
|
||||
|
||||
'PORTAL_MINICALENDAR_SUNDAY_COLOR' => 'Sunday color',
|
||||
'PORTAL_MINICALENDAR_SUNDAY_COLOR_EXPLAIN' => 'HEX or named colors are allowed such as #FFFFFF for white, or color names like vilolet.',
|
||||
// Please translate into English ...
|
||||
'PORTAL_LONG_MONTH' => 'Langen Monatsname anzeigen',
|
||||
'PORTAL_LONG_MONTH_EXPLAIN' => 'Wenn deaktiviert, wird der Monat gek<65>rzt z.B. Aug. statt August.',
|
||||
'PORTAL_SUNDAY_FIRST' => 'Sonntag zuerst anzeigen',
|
||||
'PORTAL_SUNDAY_FIRST_EXPLAIN' => 'Wenn deaktiviert, wird von Mo. --> So. angezeigt, ansonsten So. -
|
||||
|
||||
));
|
||||
|
||||
|
||||
@@ -21,23 +21,12 @@ if (!defined('IN_PORTAL'))
|
||||
exit;
|
||||
}
|
||||
|
||||
define ('IN_MINI_CAL', 1);
|
||||
|
||||
include_once($phpbb_root_path . '/portal/includes/mini_cal/mini_cal_config.'.$phpEx);
|
||||
include_once($phpbb_root_path . '/portal/includes/mini_cal/mini_cal_common.'.$phpEx);
|
||||
include_once($phpbb_root_path . '/portal/includes/mini_cal/calendarSuite.'.$phpEx);
|
||||
// get the mode (if any)
|
||||
$mini_cal_mode = 0;
|
||||
if( isset($_GET['mode']) || isset($_POST['mode']) )
|
||||
// 0 = Sunday first - 1 = Monday first. ;-)
|
||||
if ($portal_config['portal_sunday_first'])
|
||||
{
|
||||
$mini_cal_mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode'];
|
||||
}
|
||||
$mini_cal_mode = ($mini_cal_mode == 'personal') ? $mini_cal_mode : 'default';
|
||||
|
||||
// get the user (for personal calendar)
|
||||
if( isset($_GET['u']) || isset($_POST['u']) )
|
||||
{
|
||||
$mini_cal_user = ( isset($_POST['u']) ) ? intval($_POST['u']) : intval($_GET['u']);
|
||||
define('MINI_CAL_FDOW', 0);
|
||||
} else {
|
||||
define('MINI_CAL_FDOW', 1);
|
||||
}
|
||||
|
||||
// get the calendar month
|
||||
@@ -48,86 +37,59 @@ if( isset($_GET['m']) || isset($_POST['m']) )
|
||||
}
|
||||
|
||||
// initialise our calendarsuite class
|
||||
$mini_cal = new calendarSuite();
|
||||
|
||||
$mini_cal = new calendar();
|
||||
/*
|
||||
// setup our mini_cal template
|
||||
$template->set_filenames(array(
|
||||
'mini_cal_body' => 'portal/block/mini_cal_body.html'
|
||||
));
|
||||
|
||||
*/
|
||||
// initialise some variables
|
||||
$mini_cal_today = date('Ymd', time() + $user->timezone + $user->dst - date('Z'));
|
||||
$s_cal_month = ($mini_cal_month != 0) ? $mini_cal_month . ' month' : $mini_cal_today;
|
||||
$mini_cal->getMonth($s_cal_month);
|
||||
$mini_cal_count=MINI_CAL_FDOW;
|
||||
$mini_cal_count = MINI_CAL_FDOW;
|
||||
$mini_cal_this_year = $mini_cal->dateYYYY;
|
||||
$mini_cal_this_month = $mini_cal->dateMM;
|
||||
$mini_cal_this_day = $mini_cal->dateDD;
|
||||
$mini_cal_month_days = $mini_cal->daysMonth;
|
||||
|
||||
if ( MINI_CAL_CALENDAR_VERSION != 'NONE' )
|
||||
{
|
||||
// include the required events calendar support
|
||||
$mini_cal_inc = 'mini_cal_' . MINI_CAL_CALENDAR_VERSION;
|
||||
include_once($phpbb_root_path . 'portal/includes/mini_cal/' . $mini_cal_inc . '.' . $phpEx);
|
||||
|
||||
// include the required events calendar support
|
||||
$mini_cal_auth = getMiniCalForumsAuth($user);
|
||||
$mini_cal_event_days = getMiniCalEventDays($mini_cal_auth['view']);
|
||||
getMiniCalEvents($mini_cal_auth);
|
||||
getMiniCalPostForumsList($mini_cal_auth['post']);
|
||||
}
|
||||
|
||||
// output the days for the current month
|
||||
// if MINI_CAL_DATE_SEARCH = POSTS then hyperlink any days which have already past
|
||||
// if MINI_CAL_DATE_SEARCH = EVENTS then hyperkink any which have events
|
||||
$holiday=0;
|
||||
for($i=0; $i < $mini_cal_month_days;)
|
||||
{
|
||||
// is this the first day of the week?
|
||||
if($mini_cal_count==MINI_CAL_FDOW)
|
||||
if($mini_cal_count == MINI_CAL_FDOW)
|
||||
{
|
||||
$template->assign_block_vars('mini_cal_row', array());
|
||||
}
|
||||
|
||||
// is this a valid weekday?
|
||||
if($mini_cal_count==($mini_cal->day[$i][7]))
|
||||
if($mini_cal_count == ($mini_cal->day[$i][3]))
|
||||
{
|
||||
$mini_cal_this_day = $mini_cal->day[$i][0];
|
||||
|
||||
$d_mini_cal_today = $mini_cal_this_year . ( ($mini_cal_this_month <= 9) ? '0' . $mini_cal_this_month : $mini_cal_this_month ) . ( ($mini_cal_this_day <= 9) ? '0' . $mini_cal_this_day : $mini_cal_this_day );
|
||||
$mini_cal_day = ( $mini_cal_today == $d_mini_cal_today ) ? '<span class="' . MINI_CAL_TODAY_CLASS . '" style="font-weight: bold; border-style: outset; border-width: thin; color:' . $portal_config['portal_minicalendar_today_color'] . ';">' . $mini_cal_this_day . '</span>' : $mini_cal_this_day;
|
||||
$mini_cal_day = ( $mini_cal_today == $d_mini_cal_today ) ? '<span style="font-weight: bold; color: ' . $portal_config['portal_minicalendar_today_color'] . ';">' . $mini_cal_this_day . '</span>' : $mini_cal_this_day;
|
||||
|
||||
if ( (MINI_CAL_CALENDAR_VERSION != 'NONE') && (MINI_CAL_DATE_SEARCH == 'EVENTS') )
|
||||
{
|
||||
$mini_cal_day_link = '<a href="' . getMiniCalSearchURL($d_mini_cal_today) . '" class="' . MINI_CAL_DAY_LINK_CLASS . '" style="color: ' . $portal_config['portal_minicalendar_day_link_color'] . ';">' . ( $mini_cal_day ) . '</a>';
|
||||
$mini_cal_day = ( in_array($mini_cal_this_day, $mini_cal_event_days) ) ? $mini_cal_day_link : $mini_cal_day;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nix_mini_cal_today = gmmktime($config['board_timezone'], 0, 0, $mini_cal_this_month, $mini_cal_this_day, $mini_cal_this_year);
|
||||
$mini_cal_day_link = '<a href="' . append_sid($phpbb_root_path . "search.$phpEx?search_id=unanswered&st=" . $nix_mini_cal_today) . '" class="' . MINI_CAL_DAY_LINK_CLASS . '" style="color: ' . $portal_config['portal_minicalendar_day_link_color'] . ';">' . ( $mini_cal_day ) . '</a>';
|
||||
$mini_cal_day = ( $mini_cal_today >= $d_mini_cal_today ) ? $mini_cal_day_link : $mini_cal_day;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('mini_cal_row.mini_cal_days', array(
|
||||
'MINI_CAL_DAY' => $mini_cal_day
|
||||
));
|
||||
'MINI_CAL_DAY' => ($mini_cal_count == 0) ? '<span style="color: ' . $portal_config['portal_minicalendar_sunday_color'] . ';">' . $mini_cal_day . '</span>' : $mini_cal_day)
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
// no day
|
||||
else
|
||||
{
|
||||
$template->assign_block_vars('mini_cal_row.mini_cal_days', array(
|
||||
'MINI_CAL_DAY' => ' '
|
||||
));
|
||||
'MINI_CAL_DAY' => ' ')
|
||||
);
|
||||
}
|
||||
|
||||
// is this the last day of the week?
|
||||
if ($mini_cal_count==6)
|
||||
if ($mini_cal_count == 6)
|
||||
{
|
||||
// if so then reset the count
|
||||
$mini_cal_count=0;
|
||||
$mini_cal_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -137,20 +99,16 @@ for($i=0; $i < $mini_cal_month_days;)
|
||||
}
|
||||
|
||||
// output our general calendar bits
|
||||
$prev_qs = setQueryStringVal('m', $mini_cal_month -1);
|
||||
$next_qs = setQueryStringVal('m', $mini_cal_month +1);
|
||||
$down = $mini_cal_month - 1;
|
||||
$up = $mini_cal_month + 1;
|
||||
$prev_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$down") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/mini_cal_icon_left_arrow.png' . '" title="' . $user->lang['View_previous_month'] . '" height="16" width="16" alt="<<" /></a>';
|
||||
$next_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$up") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/mini_cal_icon_right_arrow.png' . '" title="' . $user->lang['View_next_month'] . '" height="16" width="16" alt=">>" /></a>';
|
||||
$prev_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$down#minical") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/mini_cal_icon_left_arrow.png' . '" title="' . $user->lang['VIEW_PREVIOUS_MONTH'] . '" height="16" width="16" alt="<<" /></a>';
|
||||
$next_month = '<a href="' . append_sid("{$phpbb_root_path}portal.$phpEx", "m=$up#minical") . '"><img src="' . $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/mini_cal_icon_right_arrow.png' . '" title="' . $user->lang['VIEW_NEXT_MONTH'] . '" height="16" width="16" alt=">>" /></a>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_MINI_CAL_MONTH' => $user->lang['mini_cal']['long_month'][$mini_cal->day[0][4]] . " " . $mini_cal->day[0][5],
|
||||
'L_MINI_CAL_ADD_EVENT' => $user->lang['Mini_Cal_add_event'],
|
||||
'L_MINI_CAL_CALENDAR' => $user->lang['Mini_Cal_calendar'],
|
||||
'L_MINI_CAL_EVENTS' => $user->lang['Mini_Cal_events'],
|
||||
'L_MINI_CAL_NO_EVENTS' => $user->lang['Mini_Cal_no_events'],
|
||||
'L_MINI_CAL_SUN' => $user->lang['mini_cal']['day'][1],
|
||||
'S_DISPLAY_MINICAL' => true,
|
||||
'S_SUNDAY_FIRST' => ($portal_config['portal_sunday_first']) ? true : false,
|
||||
'L_MINI_CAL_MONTH' => (($portal_config['portal_long_month']) ? $user->lang['mini_cal']['long_month'][$mini_cal->day[0][1]] : $user->lang['mini_cal']['month'][$mini_cal->day[0][1]]) . " " . $mini_cal->day[0][2],
|
||||
'L_MINI_CAL_SUN' => '<span style="color: ' . $portal_config['portal_minicalendar_sunday_color'] . ';">' . $user->lang['mini_cal']['day'][1] . '</span>',
|
||||
'L_MINI_CAL_MON' => $user->lang['mini_cal']['day'][2],
|
||||
'L_MINI_CAL_TUE' => $user->lang['mini_cal']['day'][3],
|
||||
'L_MINI_CAL_WED' => $user->lang['mini_cal']['day'][4],
|
||||
@@ -158,8 +116,8 @@ $template->assign_vars(array(
|
||||
'L_MINI_CAL_FRI' => $user->lang['mini_cal']['day'][6],
|
||||
'L_MINI_CAL_SAT' => $user->lang['mini_cal']['day'][7],
|
||||
'U_PREV_MONTH' => $prev_month,
|
||||
'U_NEXT_MONTH' => $next_month,
|
||||
));
|
||||
'U_NEXT_MONTH' => $next_month)
|
||||
);
|
||||
|
||||
if (!isset($template->filename['mini_cal_block']))
|
||||
{
|
||||
@@ -174,4 +132,5 @@ $template->assign_block_vars('portal_column_'.$block_pos, array(
|
||||
'BLOCK_DATA' => $block_temp)
|
||||
);
|
||||
unset( $block_temp );
|
||||
|
||||
?>
|
||||
@@ -581,4 +581,50 @@ function ap_validate($str) {
|
||||
return $page_string;
|
||||
}
|
||||
|
||||
// Mini Cal.
|
||||
class calendar
|
||||
{
|
||||
var $dateYYY; // year in numeric format (YYYY)
|
||||
var $dateMM; // month in numeric format (MM)
|
||||
var $dateDD; // day in numeric format (DD)
|
||||
var $ext_dateMM; // extended month (e.g. February)
|
||||
var $daysMonth; // count of days in month
|
||||
var $stamp; // timestamp
|
||||
var $day; // return array s.a.
|
||||
|
||||
/**
|
||||
* convert date->timestamp
|
||||
**/
|
||||
function makeTimestamp($date)
|
||||
{
|
||||
$this->stamp = strtotime($date);
|
||||
return ($this->stamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* get date listed in array
|
||||
**/
|
||||
function getMonth($callDate)
|
||||
{
|
||||
|
||||
$this->makeTimestamp($callDate);
|
||||
$this->dateYYYY = date("Y", $this->stamp);
|
||||
$this->dateMM = date("n", $this->stamp);
|
||||
$this->ext_dateMM = date("F", $this->stamp);
|
||||
$this->dateDD = date("d", $this->stamp);
|
||||
$this->daysMonth = date("t", $this->stamp);
|
||||
|
||||
for($i=1; $i < $this->daysMonth+1; $i++)
|
||||
{
|
||||
$this->makeTimestamp("$i $this->ext_dateMM $this->dateYYYY");
|
||||
$this->day[] = array(
|
||||
"0" => "$i",
|
||||
"1" => $this->dateMM,
|
||||
"2" => $this->dateYYYY,
|
||||
"3" => (date('w', $this->stamp))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,308 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @copyright (c) Adrian Cockburn - phpbb@netclectic.com (mini calendar)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_MINI_CAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Features include: 11 languages, returns all data in one array,
|
||||
* intelligent linker function
|
||||
*
|
||||
* day[] = array(0 => 'dayNumeric', // e.g. 19
|
||||
* 1 => 'dayName', // e.g. Tue
|
||||
* 2 => 'dayNameL', // e.g. Tuesday
|
||||
* 3 => 'monthName', // e.g. March
|
||||
* 4 => 'monthNumeric' // e.g. 12
|
||||
* 5 => 'year' // e.g. 2002
|
||||
* 6 => 'timestamp' // e.g. 1020204000
|
||||
* 7 => 'dayOfWeek' // 0-6 ! e.g. sunday=0, monday=1...
|
||||
* 8 => 'dayOfYear' // day of year (001 - 366)
|
||||
* 9 => 'weekNum' // weeknumber of current year
|
||||
* 10 => 'link' // link from link function
|
||||
* 11 => 'mysqlDate' // contains date in mysql-format (YYYY-MM-DD)
|
||||
*
|
||||
*
|
||||
* language options:
|
||||
* 0 = english (default) 1 = german
|
||||
* 2 = french 3 = spanish
|
||||
* 4 = finish 5 = polish
|
||||
* 6 = portuguese 7 = italian
|
||||
* 8 = italian 9 = slovak
|
||||
* 10 = turkish
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* set language
|
||||
* @const language
|
||||
* default 0 / english
|
||||
**/
|
||||
define("language", "1");
|
||||
|
||||
|
||||
/**
|
||||
* set default date format
|
||||
* @const dateFormat
|
||||
* default
|
||||
**/
|
||||
define("dateFormat" , "0");
|
||||
|
||||
|
||||
class calendarSuite {
|
||||
|
||||
var $dateYYY; // year in numeric format (YYYY)
|
||||
var $dateMM; // month in numeric format (MM)
|
||||
var $dateDD; // day in numeric format (DD)
|
||||
var $ext_dateMM; // extended month (e.g. February)
|
||||
var $ext_dateDD; // extended day (e.g. Mon)
|
||||
var $daysMonth; // count of days in month
|
||||
var $nextMonth; // contains next month
|
||||
var $lastMonth; // contains last month
|
||||
var $stamp; // timestamp
|
||||
var $day; // return array s.a.
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* Sets default values for e.g. language (default=english)
|
||||
**/
|
||||
function calendarSuite(){
|
||||
switch (language) {
|
||||
|
||||
case 0:
|
||||
$this->language = "en_EN";
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$this->language = "de_DE";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$this->language = "fr_FR";
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$this->language = "es_ES";
|
||||
break;
|
||||
|
||||
case 4:
|
||||
$this->language = "fi_FI";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$this->language = "pl_PL";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$this->language = "pt_PT";
|
||||
break;
|
||||
|
||||
case 7:
|
||||
$this->language = "it_IT";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
$this->language = "ru_RU";
|
||||
break;
|
||||
|
||||
case 9:
|
||||
$this->language = "sk_SK";
|
||||
break;
|
||||
|
||||
case 10:
|
||||
$this->language = "tr_TR";
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->language = "en_EN";
|
||||
|
||||
}
|
||||
setlocale (LC_TIME, $this->language); // set language
|
||||
|
||||
// end of function calendarSuite
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* determine the next month after current
|
||||
**/
|
||||
function nextMonth() {
|
||||
$this->nextMonth = $this->getMonth("+1 month");
|
||||
|
||||
// end of function nextMonth
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* determine the last month before current
|
||||
**/
|
||||
function lastMonth() {
|
||||
$this->lastMonth = $this->getMonth("-1 month");
|
||||
|
||||
// end of function lastMonth
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* convert date->timestamp
|
||||
**/
|
||||
function makeTimestamp($date) {
|
||||
|
||||
$this->stamp = strtotime($date);
|
||||
return ($this->stamp);
|
||||
|
||||
// end of function makeTimestamp
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get date listed in array
|
||||
**/
|
||||
function getMonth($callDate) {
|
||||
|
||||
$this->makeTimestamp($callDate);
|
||||
$this->dateYYYY = date("Y", $this->stamp);
|
||||
$this->dateMM = date("n", $this->stamp);
|
||||
$this->ext_dateMM = date("F", $this->stamp);
|
||||
$this->dateDD = date("d", $this->stamp);
|
||||
$this->daysMonth = date("t", $this->stamp);
|
||||
$this->monthStart = date("w", $this->stamp);
|
||||
|
||||
for($i=1; $i < $this->daysMonth+1; $i++) {
|
||||
$this->makeTimestamp("$i $this->ext_dateMM $this->dateYYYY");
|
||||
$this->day[] = array(
|
||||
"0" => "$i",
|
||||
"1" => (strftime('%a', $this->stamp)),
|
||||
"2" => (strftime('%A', $this->stamp)),
|
||||
"3" => (strftime("%B", $this->stamp)),
|
||||
"4" => $this->dateMM,
|
||||
"5" => $this->dateYYYY,
|
||||
"6" => $this->stamp,
|
||||
"7" => (date('w', $this->stamp)),
|
||||
"8" => (strftime('%j', $this->stamp)),
|
||||
"9" => (strftime('%U', $this->stamp)),
|
||||
"10" => $this->dateLinker($this->stamp),
|
||||
"11" => $this->formatDate($this->stamp, 99)
|
||||
);
|
||||
}
|
||||
|
||||
// end of function getMonth
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get detailed array of day
|
||||
**/
|
||||
function getDayDetail($stamp) {
|
||||
|
||||
$this->dateYYYY = date("Y", $stamp);
|
||||
$this->dateMM = date("n", $stamp);
|
||||
$this->dateDD = date("d", $stamp);
|
||||
$this->ext_dateMM = date("F", $stamp);
|
||||
$this->daysMonth = date("t", $stamp);
|
||||
$this->monthStart = date("w", $stamp);
|
||||
|
||||
$this->day = array(
|
||||
"0" => (date("j",$stamp)),
|
||||
"1" => (strftime('%a', $stamp)),
|
||||
"2" => (strftime('%A', $stamp)),
|
||||
"3" => $this->ext_dateMM,
|
||||
"4" => $this->dateMM,
|
||||
"5" => $this->dateYYYY,
|
||||
"6" => $stamp,
|
||||
"7" => (date('w', $stamp)),
|
||||
"8" => strftime('%j', $stamp),
|
||||
"9" => strftime('%U', $stamp)
|
||||
);
|
||||
|
||||
// end of function getDay
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* make links for every day
|
||||
**/
|
||||
function dateLinker($stamp) {
|
||||
$link = "?stamp=".$stamp;
|
||||
return $link;
|
||||
|
||||
// end of function dateLinker
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* format date in different forms
|
||||
**/
|
||||
function formatDate($stamp, $option = dateFormat) {
|
||||
|
||||
switch ($option) {
|
||||
|
||||
case 0:
|
||||
$this->formatted = date("d n Y", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
$this->formatted = date("d Y M", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
$this->formatted = date("M d Y", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$this->formatted = date("M Y d", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
$this->formatted = date("Y M d", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$this->formatted = date("Y d M", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$this->formatted = date("d M Y", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
case 99:
|
||||
$this->formatted = date("Y-m-d", $stamp);
|
||||
return $this->formatted;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// end of function formatDate
|
||||
}
|
||||
|
||||
|
||||
// end of class
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,143 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @copyright (c) Adrian Cockburn - phpbb@netclectic.com (mini calendar)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_MINI_CAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
getFormattedDate
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $cal_weekday -
|
||||
$cal_month -
|
||||
$cal_monthday -
|
||||
$cal_year -
|
||||
$cal_hour -
|
||||
$cal_min -
|
||||
$cal_sec -
|
||||
|
||||
returns: a date formatted according to the MINI_CAL_DATE_PATTERNS
|
||||
set in mini_cal_config.php and the Mini_Cal_date_format
|
||||
set in lang_main_min_cal.php
|
||||
***************************************************************************/
|
||||
function getFormattedDate($cal_weekday, $cal_month, $cal_monthday, $cal_year, $cal_hour, $cal_min, $cal_sec, $format)
|
||||
{
|
||||
global $lang;
|
||||
|
||||
// initialise out date formatting patterns
|
||||
$cal_date_pattern = unserialize(MINI_CAL_DATE_PATTERNS);
|
||||
|
||||
$cal_date_replace = array(
|
||||
$lang['mini_cal']['day'][$cal_weekday],
|
||||
$lang['mini_cal']['month'][$cal_month],
|
||||
$cal_month,
|
||||
( (strlen($cal_monthday) < 2 ) ? '0' : '' ) . $cal_monthday,
|
||||
$cal_monthday,
|
||||
( (strlen($cal_month) < 2 ) ? '0' : '' ) . $cal_month,
|
||||
substr($cal_year, -2),
|
||||
$cal_year,
|
||||
( (strlen($cal_hour) < 2 ) ? '0' : '' ) . $cal_hour,
|
||||
$cal_hour,
|
||||
( (strlen($cal_hour) < 2 ) ? '0' : '' ) . ( ( $cal_hour > 12 ) ? $cal_hour-12 : $cal_hour ),
|
||||
( $cal_hour > 12 ) ? $cal_hour-12 : $cal_hour,
|
||||
$cal_min,
|
||||
$cal_sec,
|
||||
( $cal_hour < 12 ) ? 'AM' : 'PM'
|
||||
);
|
||||
|
||||
return preg_replace($cal_date_pattern, $cal_date_replace, $format);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
setQueryStringVal
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $var - the variable who's value is to be replaced
|
||||
$value - the new value for the variable
|
||||
|
||||
returns: a modified querystring prefixed with ?
|
||||
***************************************************************************/
|
||||
function setQueryStringVal($var, $value)
|
||||
{
|
||||
$querystring = $_SERVER["QUERY_STRING"];
|
||||
|
||||
if (!stristr($querystring, $var))
|
||||
{
|
||||
$querystring .= ($querystring) ? '&' : '';
|
||||
$querystring .= "$var=$value";
|
||||
}
|
||||
else
|
||||
{
|
||||
$querystring = ereg_replace("($var=[[:digit:]]{1,3})", "$var=$value", $querystring);
|
||||
}
|
||||
return '?' . $querystring;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
getPostForumsList
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $mini_cal_post_auth - a comma seperated list of forms with post rights
|
||||
|
||||
returns: adds a forums select list to the template output
|
||||
***************************************************************************/
|
||||
function getPostForumsList($mini_cal_post_auth, $and_post_auth_sql = '')
|
||||
{
|
||||
if ($mini_cal_post_auth)
|
||||
{
|
||||
global $db, $template, $lang;
|
||||
|
||||
// get a list of events forums
|
||||
$sql = 'SELECT c.cat_id, c.cat_title, f.forum_id, f.forum_name
|
||||
FROM ' . FORUMS_TABLE . ' f, ' . CATEGORIES_TABLE . ' c
|
||||
WHERE f.cat_id = c.cat_id
|
||||
AND f.forum_id IN (' . $mini_cal_post_auth . ')' .
|
||||
$and_post_auth_sql;
|
||||
|
||||
if( $result = $db->sql_query($sql) )
|
||||
{
|
||||
$num_rows = $db->sql_numrows($result);
|
||||
if ( $num_rows > 0 )
|
||||
{
|
||||
$template->assign_block_vars('switch_mini_cal_add_events', array());
|
||||
|
||||
$forums_list = '<select style="width: 100%" name="' . POST_FORUM_URL . '" onchange="if(this.options[this.selectedIndex].value > -1){ forms[\'mini_cal\'].submit() }">';
|
||||
|
||||
$cat_id = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forums_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '> - ' . substr($row['forum_name'],0,20) . '</option>';
|
||||
}
|
||||
$forums_list .= '</select>';
|
||||
|
||||
$template->assign_vars( array(
|
||||
'S_MINI_CAL_EVENTS_FORUMS_LIST' => $forums_list
|
||||
)
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,89 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @copyright (c) Adrian Cockburn - phpbb@netclectic.com (mini calendar)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_MINI_CAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
The following values are configurable to tailor the mini cal to your needs.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
// Defines which events calendar you are using, if any
|
||||
// possible values:
|
||||
// MYCAL - MyCalendar
|
||||
// PLUS - MyCalendar+
|
||||
// TOPIC - Topic Calendar
|
||||
// SNAIL - Websnail Calendar Pro
|
||||
// SNAILLITE - Websnail Calendar Lite
|
||||
// NONE - No Supported Calendar is installed
|
||||
define('MINI_CAL_CALENDAR_VERSION', 'NONE');
|
||||
|
||||
|
||||
// EVENTS CALENDAR USERS ONLY!
|
||||
// Limits the number of events shown on the mini cal
|
||||
define('MINI_CAL_LIMIT', 5);
|
||||
|
||||
|
||||
// EVENTS CALENDAR USERS ONLY!
|
||||
// Limits the number of days ahead in which time upcoming events will be shown
|
||||
// set to 0 (zero) for umlimited
|
||||
define('MINI_CAL_DAYS_AHEAD', 7);
|
||||
|
||||
|
||||
// Defines what type of search happens when a user clicks on a date in the calendar
|
||||
// possible values:
|
||||
// POSTS - will return all posts posted on that date
|
||||
// EVENTS - will return all events happening on that date (ONLY SUITABLE FOR EVENTS CALENDAR USERS).
|
||||
define('MINI_CAL_DATE_SEARCH', 'POSTS');
|
||||
|
||||
|
||||
// First Day of the Week - 0=Sunday, 1=Monday...6=Saturday
|
||||
// if you change this remember to change the short day names in lang_main_mini_cal.php
|
||||
define('MINI_CAL_FDOW', 1);
|
||||
|
||||
|
||||
// Defines the css class to use for mini cal days urls
|
||||
define('MINI_CAL_DAY_LINK_CLASS', 'gensmall');
|
||||
|
||||
// Defines the css class to use for mini cal today date
|
||||
define('MINI_CAL_TODAY_CLASS', 'gensmall');
|
||||
|
||||
|
||||
// defines the authentication level required to be able to view the upcoming events
|
||||
// this relates to the permission level assigned to forum
|
||||
// possible values:
|
||||
// auth_view, auth_read, auth_post, auth_reply, auth_edit,
|
||||
// auth_delte, auth_sticky, auth_announce, auth_vote, auth_pollcreate
|
||||
define('MINI_CAL_EVENT_AUTH_LEVEL', 'auth_view');
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
You should NOT modify any values below here.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
// DO NOT MODIFY THIS!
|
||||
define('MINI_CAL_DATE_PATTERNS', serialize(array('/%a/', '/%b/', '/%c/', '/%d/', '/%e/', '/%m/', '/%y/', '/%Y/',
|
||||
'/%H/', '/%k/', '/%h/', '/%l/', '/%i/', '/%s/', '/%p/')));
|
||||
|
||||
?>
|
||||
@@ -1,303 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
|
||||
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
|
||||
* @copyright (c) Adrian Cockburn - phpbb@netclectic.com (mini calendar)
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_MINI_CAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* set_var
|
||||
*
|
||||
* Set variable, used by {@link request_var the request_var function}
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
getMiniCalForumsAuth
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $userdata - an initialised $userdata array.
|
||||
returns: a two part array
|
||||
$mini_cal_auth['view'] - a comma seperated list of forums which the user has VIEW permissions for
|
||||
$mini_cal_auth['post'] - a comma seperated list of forums which the user has POST permissions for
|
||||
***************************************************************************/
|
||||
function getMiniCalForumsAuth($user)
|
||||
{
|
||||
global $db, $auth, $user;
|
||||
|
||||
// initialise our forums auth list
|
||||
$mini_cal_auth_ary = array();
|
||||
$mini_cal_auth_ary = $auth->acl($user->data);
|
||||
|
||||
$mini_cal_auth = array();
|
||||
$mini_cal_auth['view'] = '';
|
||||
$mini_cal_auth['post'] = '';
|
||||
|
||||
while ( list($mini_cal_forum_id, $mini_cal_auth_level) = each($mini_cal_auth_ary) )
|
||||
{
|
||||
if ( $mini_cal_auth_level[MINI_CAL_EVENT_AUTH_LEVEL] )
|
||||
{
|
||||
$mini_cal_auth['view'] .= ($mini_cal_auth['view'] == '') ? $mini_cal_forum_id : ', ' . $mini_cal_forum_id;
|
||||
}
|
||||
|
||||
if ( ($mini_cal_auth_level['auth_post']) && $mini_cal_auth_level['auth_cal'] )
|
||||
{
|
||||
$mini_cal_auth['post'] .= ($mini_cal_auth['post'] == '') ? $mini_cal_forum_id : ', ' . $mini_cal_forum_id;
|
||||
}
|
||||
}
|
||||
|
||||
return $mini_cal_auth;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
getMiniCalEventDays
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $auth_view_forums - a comma seperated list of forums which the user has VIEW permissions for
|
||||
returns: an array containing a list of day containing event the user has permission to view
|
||||
***************************************************************************/
|
||||
function getMiniCalEventDays($auth_view_forums)
|
||||
{
|
||||
global $db, $mini_cal_this_year, $mini_cal_this_month;
|
||||
|
||||
$mini_cal_event_days = array();
|
||||
|
||||
if ($auth_view_forums)
|
||||
{
|
||||
// start and end date
|
||||
$start_date = mktime(0,0,0, $mini_cal_this_month, 01, $mini_cal_this_year);
|
||||
$w_month = $mini_cal_this_month + 1;
|
||||
$w_year = $mini_cal_this_year;
|
||||
if ($w_month > 12)
|
||||
{
|
||||
$w_month = 01;
|
||||
$w_year++;
|
||||
}
|
||||
$end_date = mktime(0,0,0, $w_month, 01, $w_year);
|
||||
|
||||
// we consider the duration
|
||||
$sql = "SELECT DISTINCT topic_calendar_time, topic_calendar_duration
|
||||
FROM " . TOPICS_TABLE . "
|
||||
WHERE forum_id IN ($auth_view_forums)
|
||||
AND (topic_calendar_time + topic_calendar_duration) >= $start_date
|
||||
AND topic_calendar_time < $end_date
|
||||
AND topic_calendar_time IS NOT NULL
|
||||
AND topic_calendar_time <> 0";
|
||||
|
||||
if ( $result = $db->sql_query($sql) )
|
||||
{
|
||||
$mini_cal_event_days_ww = array();
|
||||
while( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$start_day = intval(date('d', $row['topic_calendar_time']));
|
||||
for ($i = 0; ( ($i <= intval($row['topic_calendar_duration'] / 86400)) && ( ($start_day + $i) <= 31) ); $i++)
|
||||
{
|
||||
$mini_cal_event_days_ww[ ($start_day + $i) ] = true;
|
||||
}
|
||||
}
|
||||
while (list($mini_cal_event_day, $mini_cal_event_present) = each($mini_cal_event_days_ww) )
|
||||
{
|
||||
$mini_cal_event_days[] = $mini_cal_event_day;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $mini_cal_event_days;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
getMiniCalEvents
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $mini_cal_auth - a two part array
|
||||
$mini_cal_auth['view'] - a comma seperated list of forums which the user has VIEW permissions for
|
||||
$mini_cal_auth['post'] - a comma seperated list of forums which the user has POST permissions for
|
||||
|
||||
returns: nothing - it assigns variable to the template
|
||||
***************************************************************************/
|
||||
function getMiniCalEvents($mini_cal_auth)
|
||||
{
|
||||
global $template, $db, $phpEx, $lang, $mini_cal_today,
|
||||
$mini_cal_this_month, $mini_cal_this_year, $mini_cal_this_day;
|
||||
|
||||
// start and end date
|
||||
$start_date = mktime(0,0,0, intval(substr($mini_cal_today, 4, 2)), $mini_cal_this_day, $mini_cal_this_year);
|
||||
|
||||
$w_month = $mini_cal_this_month;
|
||||
$days_ahead_sql = '';
|
||||
if (MINI_CAL_DAYS_AHEAD > 0)
|
||||
{
|
||||
$w_year = $mini_cal_this_year;
|
||||
if ($w_month > 12)
|
||||
{
|
||||
$w_month = 01;
|
||||
$w_year++;
|
||||
}
|
||||
$end_date = mktime(0,0,0, $w_month, $mini_cal_this_day + MINI_CAL_DAYS_AHEAD, $w_year);
|
||||
$days_ahead_sql = " AND topic_calendar_time < $end_date ";
|
||||
}
|
||||
|
||||
// initialise some sql bits
|
||||
$mini_cal_auth_sql = ($mini_cal_auth['view']) ? ' AND t.forum_id in (' . $mini_cal_auth['view'] . ') ' : '';
|
||||
|
||||
// get events
|
||||
$sql = "SELECT t.topic_id, t.topic_calendar_time, t.topic_title, t.forum_id, t.topic_calendar_duration
|
||||
FROM " . TOPICS_TABLE . " t
|
||||
WHERE topic_calendar_time >= $start_date
|
||||
$days_ahead_sql
|
||||
AND topic_calendar_time IS NOT NULL
|
||||
AND topic_calendar_time <> 0
|
||||
$mini_cal_auth_sql
|
||||
ORDER BY
|
||||
t.topic_calendar_time ASC";
|
||||
|
||||
// did we get a result?
|
||||
if( $result = $db->sql_query_limit($sql, MINI_CAL_LIMIT) )
|
||||
{
|
||||
$template->assign_block_vars('switch_mini_cal_events', array());
|
||||
if ( $db->sql_numrows($result) > 0 )
|
||||
{
|
||||
// we've got some events
|
||||
|
||||
// now let's output our events in the given date format for the current language
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$cal_time = $row['topic_calendar_time'];
|
||||
$day_span = (date("Ymd", $cal_time) < date("Ymd", $cal_time+$row['topic_calendar_duration']));
|
||||
$include_time = date("His", $cal_time) > 0;
|
||||
$cal_date = getFormattedDate(
|
||||
date('w', $cal_time),
|
||||
date('n', $cal_time),
|
||||
date('d', $cal_time),
|
||||
date('Y', $cal_time),
|
||||
date('H', $cal_time),
|
||||
date('i', $cal_time),
|
||||
date('s', $cal_time),
|
||||
$lang['Mini_Cal_date_format'].((!$day_span && $include_time)?' '.$lang['Mini_Cal_date_format_Time']:'')
|
||||
);
|
||||
|
||||
if ($day_span || $row['topic_calendar_duration'] > 0)
|
||||
{
|
||||
$cal_time = $cal_time + $row['topic_calendar_duration'];
|
||||
$cal_date .= ' - ' . getFormattedDate(
|
||||
date('w', $cal_time),
|
||||
date('n', $cal_time),
|
||||
date('d', $cal_time),
|
||||
date('Y', $cal_time),
|
||||
date('H', $cal_time),
|
||||
date('i', $cal_time),
|
||||
date('s', $cal_time),
|
||||
((!$day_span)?$lang['Mini_Cal_date_format_Time']:$lang['Mini_Cal_date_format'])
|
||||
);
|
||||
}
|
||||
|
||||
$template->assign_block_vars('mini_cal_events', array(
|
||||
'MINI_CAL_EVENT_DATE' => $cal_date,
|
||||
'S_MINI_CAL_EVENT' => $row['topic_title'],
|
||||
'U_MINI_CAL_EVENT' => append_sid( $phpbb_root_path . "viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $row['topic_id'] )
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// no events :(
|
||||
$template->assign_block_vars('mini_cal_no_events', array());
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
getMiniCalSearchSql
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $search_id - the type of search we're looking for
|
||||
$search_date - the date passed to the search
|
||||
|
||||
returns: an sql string
|
||||
***************************************************************************/
|
||||
function getMiniCalSearchSql($search_date)
|
||||
{
|
||||
$s_yy = intval(substr($search_date, 0, 4));
|
||||
$s_mm = intval(substr($search_date, 4, 2));
|
||||
$s_dd = intval(substr($search_date, 6, 2));
|
||||
$search_date = mktime(0,0,0, $s_mm, $s_dd, $s_yy);
|
||||
$nix_tomorrow = mktime (0,0,0, $s_mm, $s_dd + 1, $s_yy);
|
||||
|
||||
$sql = "SELECT topic_first_post_id as post_id
|
||||
FROM " . TOPICS_TABLE . "
|
||||
WHERE (topic_calendar_time + topic_calendar_duration) >= $search_date AND topic_calendar_time < $nix_tomorrow";
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
getMiniCalSearchURL
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $search_date - the date passed to the search
|
||||
|
||||
returns: an url string
|
||||
***************************************************************************/
|
||||
function getMiniCalSearchURL($search_date)
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
$s_yy = intval(substr($search_date, 0, 4));
|
||||
$s_mm = intval(substr($search_date, 4, 2));
|
||||
$s_dd = intval(substr($search_date, 6, 2));
|
||||
$search_date = mktime(0,0,0, $s_mm, $s_dd, $s_yy);
|
||||
|
||||
//$url = append_sid($phpbb_root_path . "search.$phpEx?search_id=mini_cal_events&d=" . $search_date);
|
||||
$url = append_sid($phpbb_root_path . "calendar_scheduler.$phpEx?d=" . $search_date);
|
||||
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
getMiniCalPostForumsList
|
||||
|
||||
version: 1.0.0
|
||||
parameters: $mini_cal_post_auth - a comma seperated list of forms with post rights
|
||||
|
||||
returns: adds a forums select list to the template output
|
||||
***************************************************************************/
|
||||
function getMiniCalPostForumsList($mini_cal_post_auth)
|
||||
{
|
||||
getPostForumsList($mini_cal_post_auth);
|
||||
}
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_MINI_CAL_CALENDAR' => append_sid($phpbb_root_path . 'calendar.' . $phpEx),
|
||||
'U_MINI_CAL_ADD_EVENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=newtopic&f=' . MINI_CAL_EVENTS_FORUM )
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,4 +1,5 @@
|
||||
<!--version $Id$ //-->
|
||||
<a name="minical"></a>
|
||||
<div class="portal-panel">
|
||||
<div class="inner">
|
||||
<span class="portal-corners-top"><span></span></span>
|
||||
@@ -11,13 +12,18 @@
|
||||
<td align="right" colspan="2">{U_NEXT_MONTH}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_SUN}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_MON}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_TUE}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_WED}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_THU}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall">{L_MINI_CAL_FRI}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#FF0000">{L_MINI_CAL_SAT}</span></td>
|
||||
<!-- IF S_SUNDAY_FIRST -->
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_SUN}</span></td>
|
||||
<!-- ENDIF -->
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_MON}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_TUE}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_WED}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_THU}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_FRI}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_SAT}</span></td>
|
||||
<!-- IF not S_SUNDAY_FIRST -->
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_SUN}</span></td>
|
||||
<!-- ENDIF -->
|
||||
</tr>
|
||||
<!-- BEGIN mini_cal_row -->
|
||||
<tr>
|
||||
@@ -27,18 +33,6 @@
|
||||
</tr>
|
||||
<!-- END mini_cal_row -->
|
||||
</table>
|
||||
<h4></h4>
|
||||
|
||||
<!-- IF .mini_cal_holiday -->
|
||||
<table class="tablebg" width="100%" cellspacing="1">
|
||||
<!-- BEGIN mini_cal_holiday -->
|
||||
<tr>
|
||||
<td class="row1" align="left"><span class="gensmall">{mini_cal_holiday.MINI_CAL_HOLIDAYS}</span></td>
|
||||
</tr>
|
||||
<!-- END mini_cal_holiday -->
|
||||
</table>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<span class="portal-corners-bottom"><span></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 745 B After Width: | Height: | Size: 744 B |
|
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 676 B |
@@ -1,7 +1,8 @@
|
||||
<!--version $Id$ //-->
|
||||
<a name="minical"></a>
|
||||
<table class="tablebg" cellspacing="1" width="100%">
|
||||
<tr>
|
||||
<th><span style="float: left"><img src="{T_THEME_PATH}/images/portal/portal_minical.png" width="16px" height="16px" alt="" /> {L_MINI_CAL_CALENDAR}</span></th>
|
||||
<th><span style="float: left"><img src="{T_THEME_PATH}/images/portal/portal_minical.png" width="16px" height="16px" alt="" /> {L_MINI_CALENDAR}</span></th>
|
||||
</tr>
|
||||
<tr class="row1">
|
||||
<td>
|
||||
@@ -12,13 +13,18 @@
|
||||
<td align="right" colspan="2">{U_NEXT_MONTH}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_SUN}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_MON}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_TUE}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_WED}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#0000FF">{L_MINI_CAL_THU}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall">{L_MINI_CAL_FRI}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="color:#FF0000">{L_MINI_CAL_SAT}</span></td>
|
||||
<!-- IF S_SUNDAY_FIRST -->
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_SUN}</span></td>
|
||||
<!-- ENDIF -->
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_MON}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_TUE}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_WED}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_THU}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_FRI}</span></td>
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_SAT}</span></td>
|
||||
<!-- IF not S_SUNDAY_FIRST -->
|
||||
<td style="width: 14%;"><span class="gensmall" style="font-weight: bold">{L_MINI_CAL_SUN}</span></td>
|
||||
<!-- ENDIF -->
|
||||
</tr>
|
||||
<!-- BEGIN mini_cal_row -->
|
||||
<tr>
|
||||
@@ -28,23 +34,6 @@
|
||||
</tr>
|
||||
<!-- END mini_cal_row -->
|
||||
</table>
|
||||
<hr />
|
||||
|
||||
<!-- IF .mini_cal_holiday -->
|
||||
<table class="tablebg" width="100%" cellspacing="1">
|
||||
<!-- BEGIN mini_cal_holiday -->
|
||||
<tr>
|
||||
<td class="row1" align="left"><span class="gensmall">{mini_cal_holiday.MINI_CAL_HOLIDAYS}</span></td>
|
||||
</tr>
|
||||
<!-- BEGINELSE -->
|
||||
<tr>
|
||||
<td class="row1"></td>
|
||||
</tr>
|
||||
<!-- END mini_cal_holiday -->
|
||||
</table>
|
||||
<!-- ENDIF -->
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
Before Width: | Height: | Size: 745 B After Width: | Height: | Size: 744 B |
|
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 676 B |