diff --git a/root/includes/acp/acp_portal.php b/root/includes/acp/acp_portal.php index 5d47062d..996896e3 100644 --- a/root/includes/acp/acp_portal.php +++ b/root/includes/acp/acp_portal.php @@ -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; diff --git a/root/install_portal/schemas/_schema_data.sql b/root/install_portal/schemas/_schema_data.sql index 0446d668..486ab5c5 100644 --- a/root/install_portal/schemas/_schema_data.sql +++ b/root/install_portal/schemas/_schema_data.sql @@ -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'); diff --git a/root/language/de/mods/lang_portal.php b/root/language/de/mods/lang_portal.php index 279050aa..5af1c6c0 100644 --- a/root/language/de/mods/lang_portal.php +++ b/root/language/de/mods/lang_portal.php @@ -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( diff --git a/root/language/de/mods/lang_portal_acp.php b/root/language/de/mods/lang_portal_acp.php index c6e2dcb4..694056cf 100644 --- a/root/language/de/mods/lang_portal_acp.php +++ b/root/language/de/mods/lang_portal_acp.php @@ -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.', )); ?> \ No newline at end of file diff --git a/root/language/en/mods/lang_portal.php b/root/language/en/mods/lang_portal.php index 7981e124..b2cec816 100644 --- a/root/language/en/mods/lang_portal.php +++ b/root/language/en/mods/lang_portal.php @@ -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( diff --git a/root/language/en/mods/lang_portal_acp.php b/root/language/en/mods/lang_portal_acp.php index e1269a44..51d2c1f2 100644 --- a/root/language/en/mods/lang_portal_acp.php +++ b/root/language/en/mods/lang_portal_acp.php @@ -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ü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. - )); diff --git a/root/portal/block/mini_cal.php b/root/portal/block/mini_cal.php index 51d012d9..ac834dd8 100644 --- a/root/portal/block/mini_cal.php +++ b/root/portal/block/mini_cal.php @@ -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 ) ? '' . $mini_cal_this_day . '' : $mini_cal_this_day; + $mini_cal_day = ( $mini_cal_today == $d_mini_cal_today ) ? '' . $mini_cal_this_day . '' : $mini_cal_this_day; - if ( (MINI_CAL_CALENDAR_VERSION != 'NONE') && (MINI_CAL_DATE_SEARCH == 'EVENTS') ) - { - $mini_cal_day_link = '' . ( $mini_cal_day ) . ''; - $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 = '' . ( $mini_cal_day ) . ''; - $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) ? '' . $mini_cal_day . '' : $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 = '<<'; -$next_month = '>>'; +$prev_month = '<<'; +$next_month = '>>'; $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' => '' . $user->lang['mini_cal']['day'][1] . '', '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 ); + ?> \ No newline at end of file diff --git a/root/portal/includes/functions.php b/root/portal/includes/functions.php index 537190d0..78b4f635 100644 --- a/root/portal/includes/functions.php +++ b/root/portal/includes/functions.php @@ -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)) + ); + } + } +} + ?> \ No newline at end of file diff --git a/root/portal/includes/mini_cal/calendarSuite.php b/root/portal/includes/mini_cal/calendarSuite.php deleted file mode 100644 index 28668f58..00000000 --- a/root/portal/includes/mini_cal/calendarSuite.php +++ /dev/null @@ -1,308 +0,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 -} - -?> diff --git a/root/portal/includes/mini_cal/index.html b/root/portal/includes/mini_cal/index.html deleted file mode 100644 index dc8f7f41..00000000 --- a/root/portal/includes/mini_cal/index.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/root/portal/includes/mini_cal/mini_cal_common.php b/root/portal/includes/mini_cal/mini_cal_common.php deleted file mode 100644 index 5862737a..00000000 --- a/root/portal/includes/mini_cal/mini_cal_common.php +++ /dev/null @@ -1,143 +0,0 @@ - 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 = ''; - - $template->assign_vars( array( - 'S_MINI_CAL_EVENTS_FORUMS_LIST' => $forums_list - ) - ); - } - $db->sql_freeresult($result); - } - } - } - -?> \ No newline at end of file diff --git a/root/portal/includes/mini_cal/mini_cal_config.php b/root/portal/includes/mini_cal/mini_cal_config.php deleted file mode 100644 index 5a9ffab0..00000000 --- a/root/portal/includes/mini_cal/mini_cal_config.php +++ /dev/null @@ -1,89 +0,0 @@ - \ No newline at end of file diff --git a/root/portal/includes/mini_cal/mini_cal_topic.php b/root/portal/includes/mini_cal/mini_cal_topic.php deleted file mode 100644 index 4f7fdc73..00000000 --- a/root/portal/includes/mini_cal/mini_cal_topic.php +++ /dev/null @@ -1,303 +0,0 @@ -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 ) - ) - ); - - -?> \ No newline at end of file diff --git a/root/styles/prosilver/template/portal/block/mini_calendar.html b/root/styles/prosilver/template/portal/block/mini_calendar.html index 9df120ee..f64adf27 100644 --- a/root/styles/prosilver/template/portal/block/mini_calendar.html +++ b/root/styles/prosilver/template/portal/block/mini_calendar.html @@ -1,4 +1,5 @@ +
@@ -11,13 +12,18 @@ {U_NEXT_MONTH} - {L_MINI_CAL_SUN} - {L_MINI_CAL_MON} - {L_MINI_CAL_TUE} - {L_MINI_CAL_WED} - {L_MINI_CAL_THU} - {L_MINI_CAL_FRI} - {L_MINI_CAL_SAT} + + {L_MINI_CAL_SUN} + + {L_MINI_CAL_MON} + {L_MINI_CAL_TUE} + {L_MINI_CAL_WED} + {L_MINI_CAL_THU} + {L_MINI_CAL_FRI} + {L_MINI_CAL_SAT} + + {L_MINI_CAL_SUN} + @@ -27,18 +33,6 @@ -

- - - - - - - - -
{mini_cal_holiday.MINI_CAL_HOLIDAYS}
- -
diff --git a/root/styles/prosilver/theme/images/portal/mini_cal_icon_left_arrow.png b/root/styles/prosilver/theme/images/portal/mini_cal_icon_left_arrow.png index 15d1584b..33b7979b 100644 Binary files a/root/styles/prosilver/theme/images/portal/mini_cal_icon_left_arrow.png and b/root/styles/prosilver/theme/images/portal/mini_cal_icon_left_arrow.png differ diff --git a/root/styles/prosilver/theme/images/portal/mini_cal_icon_right_arrow.png b/root/styles/prosilver/theme/images/portal/mini_cal_icon_right_arrow.png index 4a2f9d4e..7bfc11ad 100644 Binary files a/root/styles/prosilver/theme/images/portal/mini_cal_icon_right_arrow.png and b/root/styles/prosilver/theme/images/portal/mini_cal_icon_right_arrow.png differ diff --git a/root/styles/subsilver2/template/portal/block/mini_calendar.html b/root/styles/subsilver2/template/portal/block/mini_calendar.html index dcecccfb..2770f722 100644 --- a/root/styles/subsilver2/template/portal/block/mini_calendar.html +++ b/root/styles/subsilver2/template/portal/block/mini_calendar.html @@ -1,7 +1,8 @@ + - + - - - - - - - + + + + + + + + + + + + @@ -28,23 +34,6 @@
 {L_MINI_CAL_CALENDAR} {L_MINI_CALENDAR}
@@ -12,13 +13,18 @@ {U_NEXT_MONTH}
{L_MINI_CAL_SUN}{L_MINI_CAL_MON}{L_MINI_CAL_TUE}{L_MINI_CAL_WED}{L_MINI_CAL_THU}{L_MINI_CAL_FRI}{L_MINI_CAL_SAT}{L_MINI_CAL_SUN}{L_MINI_CAL_MON}{L_MINI_CAL_TUE}{L_MINI_CAL_WED}{L_MINI_CAL_THU}{L_MINI_CAL_FRI}{L_MINI_CAL_SAT}{L_MINI_CAL_SUN}
-
- - - - - - - - - - - - -
{mini_cal_holiday.MINI_CAL_HOLIDAYS}
- - - diff --git a/root/styles/subsilver2/theme/images/portal/mini_cal_icon_left_arrow.png b/root/styles/subsilver2/theme/images/portal/mini_cal_icon_left_arrow.png index 15d1584b..33b7979b 100644 Binary files a/root/styles/subsilver2/theme/images/portal/mini_cal_icon_left_arrow.png and b/root/styles/subsilver2/theme/images/portal/mini_cal_icon_left_arrow.png differ diff --git a/root/styles/subsilver2/theme/images/portal/mini_cal_icon_right_arrow.png b/root/styles/subsilver2/theme/images/portal/mini_cal_icon_right_arrow.png index 4a2f9d4e..7bfc11ad 100644 Binary files a/root/styles/subsilver2/theme/images/portal/mini_cal_icon_right_arrow.png and b/root/styles/subsilver2/theme/images/portal/mini_cal_icon_right_arrow.png differ