Calendar block for phpBB Calendar 0.0.8

Forum rules
This forum is not for support requests.

Only post Modifications for Board3 Portal 1.0.x in this forum.

Onetimer
Active Member
Posts: 48
Joined: 27. June 2008 13:29

Re: Calendar block for phpBB Calendar 0.0.8

Post by Onetimer »

Very good points Kevin! I agree with all of them, actually. I just didn't realize how complicated it would be.

I never thought of that before, but there are no other mods in Board3?
User avatar

Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Calendar block for phpBB Calendar 0.0.8

Post by Kevin »

Onetimer wrote:I never thought of that before, but there are no other mods in Board3?
No - no other mods. As far I remember, we only took over some snippets, from users who have provided it here aboard, e.g in the birthday block for the upcoming birthdays (kendoo).
And (don't start to laugh ;) ) the main scripting for the mini calendar is from Adrian Cockburn, as stated in the source code:
@copyright (c) Adrian Cockburn - phpbb@netclectic.com (mini calendar)
But this one has been already implemented in the moment we started this fork from phpBB3Portal. And we had a lot trouble with it (Styling / XHTML valid strict). At some point we thought about kicking it completely out.

All support for other mods should be done separately in extra blocks.
But don't get me wrong: we are happy about every developed extra block, who supports other good mods.
And we already have a lot supporting blocks: gallery, download mod, teamspeak, other calendars, games, etc..
So everyone could "pimp" his portal to his needs.

Anyway: I'm expecting some more good calendar mods in future - another argument to keep it like it is. The mini cal needs no edits to the core sytem. ;)
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

DeanB
Active Member
Posts: 6
Joined: 18. March 2009 18:38
phpBB.de User: DeanB

Re: Calendar block for phpBB Calendar 0.0.8

Post by DeanB »

Hallo,
hast du das Problem gelöst ?
Holy wrote:Hi, ich hab folgendes Problem:
Im Calendar auf der Haupseite werden normale Termine erst angezeigt, wenn sie innerhalb der nächsten 2 oder 3 wochen liegen, all-day events aber wenn sie innerhalb des Jahres sind.
Bsp:
Termin morgen -> wird angezeigt
Termin nächsten Monat -> nicht angezeigt
all-day Termin in 3 Monaten -> wird angezeigt

Dadurch entsteht der effekt, dass im nächsten Monat nix los ist. kann ich das auch für all-day-events so einstellen, dass die nur angezeigt werden, wenn sie in der entsprechenden zeitspanne sind?

PS: Ich glaube, die änderung muss irgend wo in der function calendar_display_mini_month() erfolgen, an dieser stelle wohl, aber wie genau?

Code: Select all

             $start_temp_date = gmmktime( 0,0,0,$date['month_no'], $day, $date['year']);

          $end_temp_date = $start_temp_date + 2678400;
          // find all day events that are still taking place
          $sort_timestamp_cutoff = $start_temp_date - 86400+1;



          // don't list events that are more than 1 year in the future
          $sql = 'SELECT * FROM ' . CALENDAR_EVENTS_TABLE . '
                WHERE ( (event_access_level = 2) OR
                   (event_access_level = 0 AND poster_id = '.$db->sql_escape($user->data['user_id']).' ) OR
                   (event_access_level = 1 AND ('.$db->sql_escape($group_options).') ) ) AND
                ((( event_start_time >= '.$db->sql_escape($start_temp_date).' AND event_start_time <= '.$db->sql_escape($end_temp_date).' ) OR
                 ( event_end_time > '.$db->sql_escape($start_temp_date).' AND event_end_time <= '.$db->sql_escape($end_temp_date).' ) OR
                 ( event_start_time < '.$db->sql_escape($start_temp_date).' AND event_end_time > '.$db->sql_escape($end_temp_date)." )) OR (sort_timestamp > ".$db->sql_escape($sort_timestamp_cutoff)." AND event_all_day = 1) ) ORDER BY sort_timestamp ASC";
User avatar

wintstar
Active Member
Posts: 45
Joined: 24. March 2009 14:35
phpBB.de User: wintstar
phpBB.com User: wintstar
Location: Langgöns/Hessen
Contact:

Re: Calendar block for phpBB Calendar 0.0.8

Post by wintstar »

mein calender block funktioniert nicht hab alles nach install gemacht. install scheint was zu fehlen.
habe phpbb 3.o4 und das board Portal
kann mir jemand helfen?

danke
stephan

Image
Last edited by wintstar on 30. March 2009 12:14, edited 1 time in total.
Gruß Stephan :-)

Zitat: "Damit das Mögliche entsteht, muss immer wieder das Unmögliche versucht werden" (Hermann Hesse (1877-1962)).
Ein Blick ins zukünftige phpBB 3.1.1 - Forum, die lfd. Builds
phpBB 3.0.13 html 5 und responsive

Onetimer
Active Member
Posts: 48
Joined: 27. June 2008 13:29

Re: Calendar block for phpBB Calendar 0.0.8

Post by Onetimer »

wintstar wrote:mein calender block funktioniert nicht hab alles nach install gemacht. install scheint was zu fehlen.
habe phpbb 3.o4 und das board Portal
kann mir jemand helfen?

danke
stephan

Image
Entschuldige meine schlechtes Deutsch, aber dieses block sind "adandonware". Sie musst die ganze thread lesen.
User avatar

wintstar
Active Member
Posts: 45
Joined: 24. March 2009 14:35
phpBB.de User: wintstar
phpBB.com User: wintstar
Location: Langgöns/Hessen
Contact:

Re: Calendar block for phpBB Calendar 0.0.8

Post by wintstar »

Onetimer wrote:
wintstar wrote:mein calender block funktioniert nicht hab alles nach install gemacht. install scheint was zu fehlen.
habe phpbb 3.o4 und das board Portal
kann mir jemand helfen?

danke
stephan

Entschuldige meine schlechtes Deutsch, aber dieses block sind "adandonware". Sie musst die ganze thread lesen.

versteh ich nicht (an deinem deutsch liegt´s nicht) hab ich was hier übersehen?
Gruß Stephan :-)

Zitat: "Damit das Mögliche entsteht, muss immer wieder das Unmögliche versucht werden" (Hermann Hesse (1877-1962)).
Ein Blick ins zukünftige phpBB 3.1.1 - Forum, die lfd. Builds
phpBB 3.0.13 html 5 und responsive
User avatar

DeaQ
Valued Contributor
Posts: 74
Joined: 8. November 2008 20:03
phpBB.de User: DeaQ
phpBB.com User: DeaQ
Location: Kerpen / NRW
Contact:

Re: Calendar block for phpBB Calendar 0.0.8

Post by DeaQ »

wintstar mache es mal so wie Denis es beschrieben hat ... ich habe es so ausgeführt und habe alles perfekt hinbekommen

viewtopic.php?f=21&t=459&start=105#p12161
greetz
DeaQ [di_kju]
:D

Onetimer
Active Member
Posts: 48
Joined: 27. June 2008 13:29

Re: Calendar block for phpBB Calendar 0.0.8

Post by Onetimer »

Anybody got this block to work with Board3 1.0.3?

My Calendar block is just an empty block now (except for the word Events). I guess this has something to do with the new block handling in 1.0.3? ;-)

Because Frold seem to have abandoned this mod/block, it would be great if someone php-savvy could update this block (and correct some of the mistakes/errors already in there, look at the screenshot a few posts above as well as some of the posts on page 6 for instance).
User avatar

wintstar
Active Member
Posts: 45
Joined: 24. March 2009 14:35
phpBB.de User: wintstar
phpBB.com User: wintstar
Location: Langgöns/Hessen
Contact:

Re: Calendar block for phpBB Calendar 0.0.8

Post by wintstar »

hab jetzt alles berreinigt und nach euren tips installiert. funtioniert trotzdem nicht, kein event wird angzeigt. bin ratlos

gruß
stephan
Gruß Stephan :-)

Zitat: "Damit das Mögliche entsteht, muss immer wieder das Unmögliche versucht werden" (Hermann Hesse (1877-1962)).
Ein Blick ins zukünftige phpBB 3.1.1 - Forum, die lfd. Builds
phpBB 3.0.13 html 5 und responsive

Onetimer
Active Member
Posts: 48
Joined: 27. June 2008 13:29

Re: Calendar block for phpBB Calendar 0.0.8

Post by Onetimer »

I just realized I had replaced portal.php in the update process, and after re-adding the code to it the Calendar is now back to where it was before I updated to Board3 1.0.3. I still have the problem with no events showing up in the Calendar block, even if I set the to public events. So if anyone can give me a tip on how to get that working I would be very grateful. I know someone mentioned that he or she had the same problem a while back.

I though I'd go ahead and try the updates recommeneded in the first post. One question though;
Graceland wrote: Open includes/functions_calendar.php

SEARCH

Code: Select all

function calendar_display_mini_month() { 
REPLACE THE COMPLETE FUNCTION WITH (UP TO function get_weekday_names_mini ...)

Code: Select all

function calendar_display_mini_month()
{
   global $auth, $db, $user, $config, $template, $date, $available_etype_colors, $available_etype_images, $available_etype_display_names, $month_sel_code, $day_sel_code, $year_sel_code, $mode_sel_code;
   global $phpEx, $phpbb_root_path;

   init_calendar_data();
   init_view_selection_code("month");

   // data of akt. month
   $time = getdate(time());
         	
   //create next and prev links
   set_date_prev_next( "month" );
   $calling_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
   $mini_prev_link = append_sid($calling_page, "calM=".$date['prev_month']."&calY=".$date['prev_year']);
   $mini_next_link = append_sid($calling_page, "calM=".$date['next_month']."&calY=".$date['next_year']);

   //find the first day of the week
   $first_day_of_week = get_calendar_config_value("first_day_of_week", 0);
   get_weekday_names_mini( $first_day_of_week, $sunday, $monday, $tuesday, $wednesday, $thursday, $friday, $saturday );

   //get the first day of the month
   $date['num'] = "01";
   $date['fday'] = get_fday( $date['num'], $date['month_no'], $date['year'], $first_day_of_week );

   $number_days = gmdate("t", gmmktime( 0,0,0,$date['month_no'], $date['day'], $date['year']));

   //$mini_calendar_header_txt = $user->lang['MONTH_OF'] . sprintf($user->lang['LOCAL_DATE_FORMAT'], $user->lang['datetime'][$date['month']], $date['day'], $date['year'] );
   $mini_calendar_header_txt = $user->lang['datetime'][$date['month']] . ' - ' . $date['year'];
   $subject_limit = get_calendar_config_value("display_truncated_name", 0);

   // Is the user able to view ANY events?
   $user_can_view_events = false;
   if ( $auth->acl_get('u_calendar_view_events') )
   {
      $user_can_view_events = true;

      /* find the group options here so we do not have to look them up again for each day */
      $group_options = get_sql_group_options($user->data['user_id']);
   }

   $counter = 0;
   for ($j = 1; $j < $number_days+1; $j++, $counter++)
   {
      // if it is the first week
      if ($j == 1)
      {
         // find how many place holders we need before day 1
         if ($date['fday'] < 7)
         {
            $date['fday'] = $date['fday']+1;
            for ($i = 1; $i < $date['fday']; $i++, $counter++)
            {
               // create dummy days (place holders)
               if( $i == 1 )
               {
                  $mini_calendar_days['START_WEEK'] = true;
               }
               else
               {
                  $mini_calendar_days['START_WEEK'] = false;
               }
               $mini_calendar_days['END_WEEK'] = false;
               $mini_calendar_days['HEADER_CLASS'] = 'bg3';
               $mini_calendar_days['DAY_CLASS'] = 'bg2';
               $mini_calendar_days['NUMBER'] = 0;
               $mini_calendar_days['DUMMY_DAY'] = true;
               $mini_calendar_days['ADD_LINK'] = '';
               $mini_calendar_days['BIRTHDAYS'] = '';
               $template->assign_block_vars('mini_calendar_days', $mini_calendar_days);
            }
         }
      }
      // start creating the data for the real days
      $mini_calendar_days['START_WEEK'] = false;
      $mini_calendar_days['END_WEEK'] = false;
      $mini_calendar_days['DUMMY_DAY'] = false;
      $mini_calendar_days['HEADER_CLASS'] = 'bg3';
      $mini_calendar_days['DAY_CLASS'] = 'bg2';
      $mini_calendar_days['NUMBER'] = 0;
      $mini_calendar_days['ADD_LINK'] = '';
      $mini_calendar_days['BIRTHDAYS'] = '';
	  $mini_calendar_days['WRITE_BOLD'] = 100;
	  
      if($counter % 7 == 0)
      {
         $mini_calendar_days['START_WEEK'] = true;
      }
      if($counter % 7 == 6 )
      {
         $mini_calendar_days['END_WEEK'] = true;
      }
      $mini_calendar_days['NUMBER'] = $j;
      if( $auth->acl_get('u_calendar_create_events') )
      {
         $mini_calendar_days['ADD_LINK'] = append_sid("{$phpbb_root_path}calendarpost.$phpEx", "mode=post&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
      }
      $mini_calendar_days['DAY_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=day&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
      $mini_calendar_days['WEEK_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=week&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);

      //highlight selected day
      if( $j == $date['day'] && $date["month_no"] == $time["mon"])
      {
         $mini_calendar_days['DAY_CLASS'] = 'bg4';
      }

      //highlight current day
      $test_start_hi_time = mktime( 0,0,0,$date['month_no'], $j, $date['year']) + date('Z');
      $test_end_hi_time = $test_start_hi_time + 86399;
      $test_hi_time = time() + $user->timezone + $user->dst;

      if( ($test_start_hi_time <= $test_hi_time) &&
          ($test_end_hi_time >= $test_hi_time))
      {
         $mini_calendar_days['HEADER_CLASS'] = 'bg3';
         $mini_calendar_days['DAY_CLASS'] = 'bg4';
      }

      /*
      if ( $user_can_view_events && $auth->acl_get('u_viewprofile') )
      {
         // find birthdays
         $mini_calendar_days['BIRTHDAYS'] = generate_birthday_list( $j, $date['month_no'], $date['year'] );
      }
	  */
	  
      $arrayOfDays[] = $mini_calendar_days;

   }
      
   	  if ( $user_can_view_events )
      {
		
      	if($time["mon"] == $date["month_no"]) $day = $date['day']; else $day = 1;
      	// startDate = first Day of viewed month
      	$start_temp_date = gmmktime( 0,0,0,$date['month_no'], $day, $date['year']);

		$end_temp_date = $start_temp_date + 2678400;
		// find all day events that are still taking place
		$sort_timestamp_cutoff = $start_temp_date - 86400+1;



		// don't list events that are more than 1 year in the future
		$sql = 'SELECT * FROM ' . CALENDAR_EVENTS_TABLE . '
				WHERE ( (event_access_level = 2) OR
					(event_access_level = 0 AND poster_id = '.$db->sql_escape($user->data['user_id']).' ) OR
					(event_access_level = 1 AND ('.$db->sql_escape($group_options).') ) ) AND
				((( event_start_time >= '.$db->sql_escape($start_temp_date).' AND event_start_time <= '.$db->sql_escape($end_temp_date).' ) OR
				 ( event_end_time > '.$db->sql_escape($start_temp_date).' AND event_end_time <= '.$db->sql_escape($end_temp_date).' ) OR
				 ( event_start_time < '.$db->sql_escape($start_temp_date).' AND event_end_time > '.$db->sql_escape($end_temp_date)." )) OR (sort_timestamp > ".$db->sql_escape($sort_timestamp_cutoff)." AND event_all_day = 1) ) ORDER BY sort_timestamp ASC";
		// find next 5 events
		$result = $db->sql_query_limit($sql, 5, 0);


//         $result = $monthEventResult;
		
		
         while ($row = $db->sql_fetchrow($result))
         {
         	$dayOfEvent =  getdate($row["sort_timestamp"]);
         	
            $event_output['COLOR'] = $available_etype_colors[$row['etype_id']];
            $event_output['IMAGE'] = $available_etype_images[$row['etype_id']];
            $event_output['EVENT_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=event&calEid=".$row['event_id']);
            $event_output['NUMBER'] = $dayOfEvent["mday"].".".$dayOfEvent["mon"].".";
            $event_output['DAY_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=day&calD=".$dayOfEvent["mday"]."&calM=".$dayOfEvent["mon"]."&calY=".$dayOfEvent["year"]);
            $event_output['WEEK_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=week&calD=".$dayOfEvent["mday"]."&calM=".$dayOfEvent["mon"]."&calY=".$dayOfEvent["year"]);

            if($date["month_no"] == $dayOfEvent["mon"]) {
            	$arrayOfDays[$dayOfEvent["mday"]-1]["WRITE_BOLD"] = "bold";
            }
            // if the event was created by this user
            // display it in bold
            if( $user->data['user_id'] == $row['poster_id'] )
            {
               $event_output['DISPLAY_BOLD'] = true;
            }
            else
            {
               $event_output['DISPLAY_BOLD'] = false;
            }

            $event_output['ETYPE_DISPLAY_NAME'] = $available_etype_display_names[$row['etype_id']];

            $event_output['EVENT_SUBJECT'] = censor_text($row['event_subject']);
            if( $subject_limit > 0 )
            {
               if(utf8_strlen($event_output['EVENT_SUBJECT']) > $subject_limit)
               {
                  $event_output['EVENT_SUBJECT'] = truncate_string($event_output['EVENT_SUBJECT'], $subject_limit) . '...';
               }
            }

            $template->assign_block_vars('events', $event_output);
         }
         $db->sql_freeresult($result);
      }

     for($a=0;$a<count($arrayOfDays);$a++) {
     	if(!empty($arrayOfDays[$a]["NUMBER"])) {
     		$template->assign_block_vars('mini_calendar_days', $arrayOfDays[$a]);
     	} 
     }
     
   $counter--;
   $dummy_end_day_count = 6 - ($counter % 7);
   for ($i = 1; $i <= $dummy_end_day_count; $i++)
   {
      // create dummy days (place holders)
      $mini_calendar_days['START_WEEK'] = false;
      if( $i == $dummy_end_day_count )
      {
         $mini_calendar_days['END_WEEK'] = true;
      }
      else
      {
         $mini_calendar_days['END_WEEK'] = false;
      }
      $mini_calendar_days['HEADER_CLASS'] = '';
      $mini_calendar_days['DAY_CLASS'] = '';
      $mini_calendar_days['NUMBER'] = 0;
      $mini_calendar_days['DUMMY_DAY'] = true;
      $mini_calendar_days['ADD_LINK'] = '';
      $mini_calendar_days['BIRTHDAYS'] = '';
      $template->assign_block_vars('mini_calendar_days', $mini_calendar_days);
   }





   // A typical usage for sending your variables to your template.
   $template->assign_vars(array(
      'CALENDAR_HEADER_MINI'         => $mini_calendar_header_txt,
      'DAY_IMG'                  => $user->img('button_calendar_day', 'DAY'),
      'WEEK_IMG'                  => $user->img('button_calendar_week', 'WEEK'),
      'CALENDAR_PREV_MINI'         => '<a href=\''.$mini_prev_link.'\'><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>',
      'CALENDAR_NEXT_MINI'         =>  '<a href=\''.$mini_next_link.'\'><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>',      
      'CALENDAR_VIEW_OPTIONS'       => $mode_sel_code.' '.$month_sel_code.' '.$day_sel_code.' '.$year_sel_code,
      'SUNDAY_MINI'               => $sunday,
      'MONDAY_MINI'               => $monday,
      'TUESDAY_MINI'               => $tuesday,
      'WEDNESDAY_MINI'            => $wednesday,
      'THURSDAY_MINI'               => $thursday,
      'FRIDAY_MINI'               => $friday,
      'SATURDAY_MINI'               => $saturday,
      'S_POST_ACTION_MINI'         => append_sid("{$phpbb_root_path}calendar.$phpEx" ),
   ));

}
Just to be sure, does the above mean this;

Find

Code: Select all

        function get_weekday_names_mini( $first_day_of_week, &$sunday, &$monday, &$tuesday, &$wednesday, &$thursday, &$friday, &$saturday )
        {
           global $user;
           switch( $first_day_of_week )
           {
              case 0:
                 $sunday = $user->lang['mini_datetime']['Su'];
                 $monday = $user->lang['mini_datetime']['Mo'];
                 $tuesday = $user->lang['mini_datetime']['Tu'];
                 $wednesday = $user->lang['mini_datetime']['We'];
                 $thursday = $user->lang['mini_datetime']['Th'];
                 $friday = $user->lang['mini_datetime']['Fr'];
                 $saturday = $user->lang['mini_datetime']['Sa'];
                 break;
              case 1:
                 $saturday = $user->lang['mini_datetime']['Su'];
                 $sunday = $user->lang['mini_datetime']['Mo'];
                 $monday = $user->lang['mini_datetime']['Tu'];
                 $tuesday = $user->lang['mini_datetime']['We'];
                 $wednesday = $user->lang['mini_datetime']['Th'];
                 $thursday = $user->lang['mini_datetime']['Fr'];
                 $friday = $user->lang['mini_datetime']['Sa'];
                 break;
              case 2:
                 $friday = $user->lang['mini_datetime']['Su'];
                 $saturday = $user->lang['mini_datetime']['Mo'];
                 $sunday = $user->lang['mini_datetime']['Tu'];
                 $monday = $user->lang['mini_datetime']['We'];
                 $tuesday = $user->lang['mini_datetime']['Th'];
                 $wednesday = $user->lang['mini_datetime']['Fr'];
                 $thursday = $user->lang['mini_datetime']['Sa'];
                 break;
              case 3:
                 $thursday = $user->lang['mini_datetime']['Su'];
                 $friday = $user->lang['mini_datetime']['Mo'];
                 $saturday = $user->lang['mini_datetime']['Tu'];
                 $sunday = $user->lang['mini_datetime']['We'];
                 $monday = $user->lang['mini_datetime']['Th'];
                 $tuesday = $user->lang['mini_datetime']['Fr'];
                 $wednesday = $user->lang['mini_datetime']['Sa'];
                 break;
              case 4:
                 $wednesday = $user->lang['mini_datetime']['Su'];
                 $thursday = $user->lang['mini_datetime']['Mo'];
                 $friday = $user->lang['mini_datetime']['Tu'];
                 $saturday = $user->lang['mini_datetime']['We'];
                 $sunday = $user->lang['mini_datetime']['Th'];
                 $monday = $user->lang['mini_datetime']['Fr'];
                 $tuesday = $user->lang['mini_datetime']['Sa'];
                 break;
              case 5:
                 $tuesday = $user->lang['mini_datetime']['Su'];
                 $wednesday = $user->lang['mini_datetime']['Mo'];
                 $thursday = $user->lang['mini_datetime']['Tu'];
                 $friday = $user->lang['mini_datetime']['We'];
                 $saturday = $user->lang['mini_datetime']['Th'];
                 $sunday = $user->lang['mini_datetime']['Fr'];
                 $monday = $user->lang['mini_datetime']['Sa'];
                 break;
              case 6:
                 $monday = $user->lang['mini_datetime']['Su'];
                 $tuesday = $user->lang['mini_datetime']['Mo'];
                 $wednesday = $user->lang['mini_datetime']['Tu'];
                 $thursday = $user->lang['mini_datetime']['We'];
                 $friday = $user->lang['mini_datetime']['Th'];
                 $saturday = $user->lang['mini_datetime']['Fr'];
                 $sunday = $user->lang['mini_datetime']['Sa'];
                 break;
           }
        }
        /**
        * End additional Portal XL 4.0 functions
        */

function calendar_display_month()
{
Replace With

Code: Select all

function calendar_display_mini_month()
{
   global $auth, $db, $user, $config, $template, $date, $available_etype_colors, $available_etype_images, $available_etype_display_names, $month_sel_code, $day_sel_code, $year_sel_code, $mode_sel_code;
   global $phpEx, $phpbb_root_path;

   init_calendar_data();
   init_view_selection_code("month");

   // data of akt. month
   $time = getdate(time());
         	
   //create next and prev links
   set_date_prev_next( "month" );
   $calling_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
   $mini_prev_link = append_sid($calling_page, "calM=".$date['prev_month']."&calY=".$date['prev_year']);
   $mini_next_link = append_sid($calling_page, "calM=".$date['next_month']."&calY=".$date['next_year']);

   //find the first day of the week
   $first_day_of_week = get_calendar_config_value("first_day_of_week", 0);
   get_weekday_names_mini( $first_day_of_week, $sunday, $monday, $tuesday, $wednesday, $thursday, $friday, $saturday );

   //get the first day of the month
   $date['num'] = "01";
   $date['fday'] = get_fday( $date['num'], $date['month_no'], $date['year'], $first_day_of_week );

   $number_days = gmdate("t", gmmktime( 0,0,0,$date['month_no'], $date['day'], $date['year']));

   //$mini_calendar_header_txt = $user->lang['MONTH_OF'] . sprintf($user->lang['LOCAL_DATE_FORMAT'], $user->lang['datetime'][$date['month']], $date['day'], $date['year'] );
   $mini_calendar_header_txt = $user->lang['datetime'][$date['month']] . ' - ' . $date['year'];
   $subject_limit = get_calendar_config_value("display_truncated_name", 0);

   // Is the user able to view ANY events?
   $user_can_view_events = false;
   if ( $auth->acl_get('u_calendar_view_events') )
   {
      $user_can_view_events = true;

      /* find the group options here so we do not have to look them up again for each day */
      $group_options = get_sql_group_options($user->data['user_id']);
   }

   $counter = 0;
   for ($j = 1; $j < $number_days+1; $j++, $counter++)
   {
      // if it is the first week
      if ($j == 1)
      {
         // find how many place holders we need before day 1
         if ($date['fday'] < 7)
         {
            $date['fday'] = $date['fday']+1;
            for ($i = 1; $i < $date['fday']; $i++, $counter++)
            {
               // create dummy days (place holders)
               if( $i == 1 )
               {
                  $mini_calendar_days['START_WEEK'] = true;
               }
               else
               {
                  $mini_calendar_days['START_WEEK'] = false;
               }
               $mini_calendar_days['END_WEEK'] = false;
               $mini_calendar_days['HEADER_CLASS'] = 'bg3';
               $mini_calendar_days['DAY_CLASS'] = 'bg2';
               $mini_calendar_days['NUMBER'] = 0;
               $mini_calendar_days['DUMMY_DAY'] = true;
               $mini_calendar_days['ADD_LINK'] = '';
               $mini_calendar_days['BIRTHDAYS'] = '';
               $template->assign_block_vars('mini_calendar_days', $mini_calendar_days);
            }
         }
      }
      // start creating the data for the real days
      $mini_calendar_days['START_WEEK'] = false;
      $mini_calendar_days['END_WEEK'] = false;
      $mini_calendar_days['DUMMY_DAY'] = false;
      $mini_calendar_days['HEADER_CLASS'] = 'bg3';
      $mini_calendar_days['DAY_CLASS'] = 'bg2';
      $mini_calendar_days['NUMBER'] = 0;
      $mini_calendar_days['ADD_LINK'] = '';
      $mini_calendar_days['BIRTHDAYS'] = '';
	  $mini_calendar_days['WRITE_BOLD'] = 100;
	  
      if($counter % 7 == 0)
      {
         $mini_calendar_days['START_WEEK'] = true;
      }
      if($counter % 7 == 6 )
      {
         $mini_calendar_days['END_WEEK'] = true;
      }
      $mini_calendar_days['NUMBER'] = $j;
      if( $auth->acl_get('u_calendar_create_events') )
      {
         $mini_calendar_days['ADD_LINK'] = append_sid("{$phpbb_root_path}calendarpost.$phpEx", "mode=post&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
      }
      $mini_calendar_days['DAY_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=day&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
      $mini_calendar_days['WEEK_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=week&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);

      //highlight selected day
      if( $j == $date['day'] && $date["month_no"] == $time["mon"])
      {
         $mini_calendar_days['DAY_CLASS'] = 'bg4';
      }

      //highlight current day
      $test_start_hi_time = mktime( 0,0,0,$date['month_no'], $j, $date['year']) + date('Z');
      $test_end_hi_time = $test_start_hi_time + 86399;
      $test_hi_time = time() + $user->timezone + $user->dst;

      if( ($test_start_hi_time <= $test_hi_time) &&
          ($test_end_hi_time >= $test_hi_time))
      {
         $mini_calendar_days['HEADER_CLASS'] = 'bg3';
         $mini_calendar_days['DAY_CLASS'] = 'bg4';
      }

      /*
      if ( $user_can_view_events && $auth->acl_get('u_viewprofile') )
      {
         // find birthdays
         $mini_calendar_days['BIRTHDAYS'] = generate_birthday_list( $j, $date['month_no'], $date['year'] );
      }
	  */
	  
      $arrayOfDays[] = $mini_calendar_days;

   }
      
   	  if ( $user_can_view_events )
      {
		
      	if($time["mon"] == $date["month_no"]) $day = $date['day']; else $day = 1;
      	// startDate = first Day of viewed month
      	$start_temp_date = gmmktime( 0,0,0,$date['month_no'], $day, $date['year']);

		$end_temp_date = $start_temp_date + 2678400;
		// find all day events that are still taking place
		$sort_timestamp_cutoff = $start_temp_date - 86400+1;



		// don't list events that are more than 1 year in the future
		$sql = 'SELECT * FROM ' . CALENDAR_EVENTS_TABLE . '
				WHERE ( (event_access_level = 2) OR
					(event_access_level = 0 AND poster_id = '.$db->sql_escape($user->data['user_id']).' ) OR
					(event_access_level = 1 AND ('.$db->sql_escape($group_options).') ) ) AND
				((( event_start_time >= '.$db->sql_escape($start_temp_date).' AND event_start_time <= '.$db->sql_escape($end_temp_date).' ) OR
				 ( event_end_time > '.$db->sql_escape($start_temp_date).' AND event_end_time <= '.$db->sql_escape($end_temp_date).' ) OR
				 ( event_start_time < '.$db->sql_escape($start_temp_date).' AND event_end_time > '.$db->sql_escape($end_temp_date)." )) OR (sort_timestamp > ".$db->sql_escape($sort_timestamp_cutoff)." AND event_all_day = 1) ) ORDER BY sort_timestamp ASC";
		// find next 5 events
		$result = $db->sql_query_limit($sql, 5, 0);


//         $result = $monthEventResult;
		
		
         while ($row = $db->sql_fetchrow($result))
         {
         	$dayOfEvent =  getdate($row["sort_timestamp"]);
         	
            $event_output['COLOR'] = $available_etype_colors[$row['etype_id']];
            $event_output['IMAGE'] = $available_etype_images[$row['etype_id']];
            $event_output['EVENT_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=event&calEid=".$row['event_id']);
            $event_output['NUMBER'] = $dayOfEvent["mday"].".".$dayOfEvent["mon"].".";
            $event_output['DAY_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=day&calD=".$dayOfEvent["mday"]."&calM=".$dayOfEvent["mon"]."&calY=".$dayOfEvent["year"]);
            $event_output['WEEK_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=week&calD=".$dayOfEvent["mday"]."&calM=".$dayOfEvent["mon"]."&calY=".$dayOfEvent["year"]);

            if($date["month_no"] == $dayOfEvent["mon"]) {
            	$arrayOfDays[$dayOfEvent["mday"]-1]["WRITE_BOLD"] = "bold";
            }
            // if the event was created by this user
            // display it in bold
            if( $user->data['user_id'] == $row['poster_id'] )
            {
               $event_output['DISPLAY_BOLD'] = true;
            }
            else
            {
               $event_output['DISPLAY_BOLD'] = false;
            }

            $event_output['ETYPE_DISPLAY_NAME'] = $available_etype_display_names[$row['etype_id']];

            $event_output['EVENT_SUBJECT'] = censor_text($row['event_subject']);
            if( $subject_limit > 0 )
            {
               if(utf8_strlen($event_output['EVENT_SUBJECT']) > $subject_limit)
               {
                  $event_output['EVENT_SUBJECT'] = truncate_string($event_output['EVENT_SUBJECT'], $subject_limit) . '...';
               }
            }

            $template->assign_block_vars('events', $event_output);
         }
         $db->sql_freeresult($result);
      }

     for($a=0;$a<count($arrayOfDays);$a++) {
     	if(!empty($arrayOfDays[$a]["NUMBER"])) {
     		$template->assign_block_vars('mini_calendar_days', $arrayOfDays[$a]);
     	} 
     }
     
   $counter--;
   $dummy_end_day_count = 6 - ($counter % 7);
   for ($i = 1; $i <= $dummy_end_day_count; $i++)
   {
      // create dummy days (place holders)
      $mini_calendar_days['START_WEEK'] = false;
      if( $i == $dummy_end_day_count )
      {
         $mini_calendar_days['END_WEEK'] = true;
      }
      else
      {
         $mini_calendar_days['END_WEEK'] = false;
      }
      $mini_calendar_days['HEADER_CLASS'] = '';
      $mini_calendar_days['DAY_CLASS'] = '';
      $mini_calendar_days['NUMBER'] = 0;
      $mini_calendar_days['DUMMY_DAY'] = true;
      $mini_calendar_days['ADD_LINK'] = '';
      $mini_calendar_days['BIRTHDAYS'] = '';
      $template->assign_block_vars('mini_calendar_days', $mini_calendar_days);
   }





   // A typical usage for sending your variables to your template.
   $template->assign_vars(array(
      'CALENDAR_HEADER_MINI'         => $mini_calendar_header_txt,
      'DAY_IMG'                  => $user->img('button_calendar_day', 'DAY'),
      'WEEK_IMG'                  => $user->img('button_calendar_week', 'WEEK'),
      'CALENDAR_PREV_MINI'         => '<a href=\''.$mini_prev_link.'\'><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>',
      'CALENDAR_NEXT_MINI'         =>  '<a href=\''.$mini_next_link.'\'><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>',      
      'CALENDAR_VIEW_OPTIONS'       => $mode_sel_code.' '.$month_sel_code.' '.$day_sel_code.' '.$year_sel_code,
      'SUNDAY_MINI'               => $sunday,
      'MONDAY_MINI'               => $monday,
      'TUESDAY_MINI'               => $tuesday,
      'WEDNESDAY_MINI'            => $wednesday,
      'THURSDAY_MINI'               => $thursday,
      'FRIDAY_MINI'               => $friday,
      'SATURDAY_MINI'               => $saturday,
      'S_POST_ACTION_MINI'         => append_sid("{$phpbb_root_path}calendar.$phpEx" ),
   ));

}
? :oops:

Razer
Active Member
Posts: 34
Joined: 14. March 2009 15:14

Re: Calendar block for phpBB Calendar 0.0.8

Post by Razer »

Ich habe ein riesen Problem!

In etwa 20 Stunden MUSS meine Seite wieder online sein, jetzt ist sie komplett wess!
Ich habe einfach alle Aenderungen durchgefuehrt, geht nicht! Die ganze Seite ist weiss!

Wer kann helfen>
User avatar

Mike
Former Team Member
Posts: 1862
Joined: 3. July 2008 23:59
Location: Schwarzwald / FDS
Contact:

Re: Calendar block for phpBB Calendar 0.0.8

Post by Mike »

Schon die betreffenden Artikel in der KB versucht?
kein Support per PN / Messenger
no Support via PM / Messenger

ralf-isi
Valued Contributor
Posts: 86
Joined: 15. March 2009 10:38
phpBB.de User: ralf-isi
Location: Schweiz - Nähe Zürich

Re: Calendar block for phpBB Calendar 0.0.8

Post by ralf-isi »

@Razer
einfach die gesicherten files wieder auf den server stellen. dann läuft es wieder und den um-/einbau nochmals machen.

Razer
Active Member
Posts: 34
Joined: 14. March 2009 15:14

Re: Calendar block for phpBB Calendar 0.0.8

Post by Razer »

ralf-isi wrote:@Razer
einfach die gesicherten files wieder auf den server stellen. dann läuft es wieder und den um-/einbau nochmals machen.
Danke, hatte halt so ein STress, denn heute musste die Seite wieder online sein! Sorry. Aber eine ganz andere Frgae:

subsilver2 style?

Razer
Active Member
Posts: 34
Joined: 14. March 2009 15:14

Re: Calendar block for phpBB Calendar 0.0.8

Post by Razer »

So, habe das mit subsliver selber hinbekommen, hier der Code, beachtet aber, dass ich ihn an meinen Style, der auf subsilver basiert, angepasst habe. Dass anpassen an andere Styles sollte nicht so schwer sein:

Code: Select all

{$LR_BLOCK_H_L}<img src="{T_THEME_PATH}/images/portal/portal_minical.png" width="16px" height="16px" alt="" />&nbsp;{L_MINI_CAL_CALENDAR}{$LR_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
	<tr class="row1">
		<td>	
			<table width="100%" cellspacing="1">
			<tr>
            <td align="left" colspan="2"><!-- IF CALENDAR_PREV_MINI -->{CALENDAR_PREV_MINI}</a><!-- ENDIF --></td>
            <td colspan="3" align="center"><span class="genmed"><b>Sp?les {CALENDAR_HEADER_MINI}<b></span></td>
            <td align="right" colspan="2"><!-- IF CALENDAR_NEXT_MINI -->{CALENDAR_NEXT_MINI}</a><!-- ENDIF --></td>
         </tr>

</table>

<table class="table_minical" cellspacing="0" cellpadding="0">
  <!--<tr>
   <th style="text-align:left;" colspan="7">{L_MINI_CAL_CALENDAR}</td>
</tr>-->
  <tr class="row1">
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#800000"><b>Sv</b></span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#800000"><b>Pi</b></span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#800000"><b>Ot</b></span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#800000"><b>Tr</b></span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#800000"><b>Ce</b></b></span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#800000"><b>Pi</b></span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#800000"><b>Se</b></span></td>
  </tr>
  <!-- BEGIN mini_calendar_days -->
  <!-- IF mini_calendar_days.START_WEEK -->
  <tr>
    <!-- ENDIF -->
    <!-- IF mini_calendar_days.DUMMY_DAY -->
    <td valign="top" class="bg3_calMon">&nbsp;</td>
    <!-- ELSE -->
     <td valign="top" class="{mini_calendar_days.DAY_CLASS}">
     <table cellpadding="0" cellspacing="1" border="0" width="100%">
        <tr>
          <td class="{mini_calendar_days.HEADER_CLASS}" style="font-weight:{mini_calendar_days.WRITE_BOLD}; text-align:center;">
             <!-- IF mini_calendar_days.ADD_LINK -->
            <a href="{mini_calendar_days.ADD_LINK}">{mini_calendar_days.NUMBER}</a>
            <!-- ELSE -->
                      {mini_calendar_days.NUMBER}
            <!-- ENDIF -->
            <br />
          </td>
        </tr>
      </table></td>
    <!-- ENDIF -->
    <!-- IF mini_calendar_days.END_WEEK -->
  </tr>
  <!-- ENDIF -->
  <!-- END mini_calendar_days -->
</table>
<br clear="all" />

<table class="table_minical" cellspacing="0" cellpadding="0" width="100%">
  <tr class="row1">
      <td style="width: 100%; text-align: center" class="bg4"><b><font color="#ffffff">N?kam?s sp?les</font></b></td>
  </tr>
</table>

<table class="table_minical" cellspacing="0" cellpadding="0">
  <tr>
    <td class="row1">

      <!-- BEGIN events -->
      <!-- IF events.S_FIRST_ROW -->
      <!-- ELSE --><hr><!-- ENDIF -->
      <a href="{events.DAY_VIEW_URL}"><!-- IF events.COLOR --><span style="color:#{events.COLOR}"><!-- ENDIF -->
      [{events.NUMBER}]<!-- IF events.COLOR --></span><!-- ENDIF --></a>
      <a href="{events.EVENT_URL}" title="{events.EVENT_SUBJECT}">
      <!-- IF events.COLOR --><span style="color:#{events.COLOR}"><!-- ENDIF -->
      <!-- IF events.DISPLAY_BOLD --><strong><!-- ENDIF -->
      <!-- IF events.IMAGE --><img src="{events.IMAGE}" title="{events.ETYPE_DISPLAY_NAME}" height="20" width="20" /><!-- ENDIF -->
      <!-- IF events.ETYPE_DISPLAY_NAME -->{events.ETYPE_DISPLAY_NAME}:<!-- ENDIF -->
      {events.EVENT_SUBJECT}
      <!-- IF events.DISPLAY_BOLD --></strong><!-- ENDIF -->
      <!-- IF events.SHOW_TIME --><br /><!-- IF events.ALL_DAY -->{L_ALL_DAY}<!-- ELSE -->
      {L_FROM_TIME}: {events.START_TIME} <br />{L_TO_TIME}: {events.END_TIME}<!-- ENDIF -->
      <!-- ENDIF -->
      <!-- IF events.COLOR --></span><!-- ENDIF --></a><br />
      <!-- END events -->
</table>
		</td>
	</tr>
</table>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
Jetzt stellt sich die Frage, wie bekomme ich das europaeische System in den Kalendar, sprich Woche vom Montag aus. Wenn ich SO und MO in der Datei tausche, sind die Tage falsch. Was soll ich unternehmen?

Danke!
Locked

Return to “board3 Portal v1.0.x - Modifications”