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.
User avatar

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

Re: Calendar block for phpBB Calendar 0.0.8

Post by Kevin »

Razer wrote:wie bekomme ich das europaeische System in den Kalendar, sprich Woche vom Montag aus.
Das sollte eine Option im ACP für den Kalender sein. Hier der Code, womit das bestimmt wird aus der includes/functions_calendar.php:

Code: Select all

//find the first day of the week
       $first_day_of_week = get_calendar_config_value("first_day_of_week", 0); 
Wenn Dir die Option fehlt, müsste es sich auch "hardcoden" lassen:

Code: Select all

//find the first day of the week
       //$first_day_of_week = get_calendar_config_value("first_day_of_week", 0);
$first_day_of_week = 1; 
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!
User avatar

thomas.d
Former Team Member
Posts: 625
Joined: 20. January 2008 00:56
phpBB.de User: thomas.d
phpBB.com User: thomas.d

Re: Calendar block for phpBB Calendar 0.0.8

Post by thomas.d »

Kevin wrote:... Wenn Dir die Option fehlt, müsste es sich auch "hardcoden" lassen ...
Das ist nicht notwendig denn ...
Kevin wrote:... Das sollte eine Option im ACP für den Kalender sein. ...
Das ist so. In den Einstellungen des Kalenders kann der erste Tag der Woche (hier Mo) ausgewählt werden.
Viele Grüße

Thomas

Deutsche Sprachdateien für
[Alpha] phpBB Calendar 0.0.8 (alightner) | [RC] phpBB Arcade 1.0.RC8 |
ACP Add User MOD 1.0.0 |
User avatar

Huor
Valued Contributor
Posts: 95
Joined: 9. October 2008 00:46

Re: Calendar block for phpBB Calendar 0.0.8

Post by Huor »

I am just have installed this mod. But i have some problems with the style. So my first question has anyone of you already this mod installed and using black pearl style? And if yes would you mind to support me with this?

If the mod itself is running i am thinking to integrate the portal mod for this as well.

I hope i am not totally offtopic.
Thanks in advance

Huor

Edit: Self is the man - i made the adaption to Black Pearl Style for it.
Now tomorrow or so i think i will try the mod for the portal as well. ;)
User avatar

Midge
Sponsor
Posts: 75
Joined: 22. February 2009 22:47
phpBB.com User: Midge

Re: Calendar block for phpBB Calendar 0.0.8

Post by Midge »

This block works fine, thank you very much for that! :D

There is just one question I have: How do I change the colours of the portal calendar? I do appreciate that days with events are bolded, but if there's only one event it looks as if this was the current day - while the square around the actual 'current day' is quite difficult to see. Is is possible to adjust the colour of the square to make it...say...black and the background of the day white or something?
User avatar

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

Re: Calendar block for phpBB Calendar 0.0.8

Post by wintstar »

falls ihr auf der portalseite die events oder wochenansicht (im ACP unter Kalendereinstellungen) anzeigen zu lassen wie in der forenübersicht geht folgend vor:

phpbb 3.05.
phpbb calender 0.0.8
board3 portal 1.0.3
prosilver

root/portal.php
suche:

Code: Select all

include($phpbb_root_path . 'portal/includes/functions.' . $phpEx);
dannach:

Code: Select all

include($phpbb_root_path . 'includes/functions_calendar.' . $phpEx);
suche:

Code: Select all

// output page
davor:

Code: Select all

// Generate calendar week view or next events if required ...
calendar_display_calendar_on_index();
`
EDIT anweisung unten nur für 1.0.3
style/prosilver/template/portal/portal_body.html
suche:

Code: Select all

<!-- IF S_DISPLAY_ONLINE_PORTAL_LIST and S_DISPLAY_ONLINE_LIST -->
davor:

Code: Select all

<!-- IF S_CALENDAR_WEEK -->
	<!-- INCLUDE calendar_week_on_index.html -->
<!-- ELSEIF S_CALENDAR_NEXT_EVENTS -->
	<!-- INCLUDE calendar_next_events_on_index.html -->
<!-- ENDIF -->
Cache leeren
Template und Themen aktuallisieren. FERTIG :D

gruß
Stephan
Last edited by wintstar on 11. October 2009 12:00, edited 2 times 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 »

I still have two minor problems with the Calendar block.

With my own template the corners of the block is slightly out of place;
Image

In SubSilver the blue background is missing (and yes, all cache have been emptied);
Image

Anybody know how I can correct this? If I remember correctly both of these problems were brought up here somewhere before but now I can't find it...

Deutsch sind auch OK!
User avatar

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

Re: Calendar block for phpBB Calendar 0.0.8

Post by Mike »

The second picture is prosilver, not subsilver(2) ;)
Sorry, but i cant help you much without a link...
kein Support per PN / Messenger
no Support via PM / Messenger

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

Re: Calendar block for phpBB Calendar 0.0.8

Post by Onetimer »

Oh yeah, I meant ProSilver! It's not online yet, I'm waiting to get a host and domain until I have these few quirks sorted out. What file or code are you looking for specifically, maybe I can post it here?
User avatar

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

Re: Calendar block for phpBB Calendar 0.0.8

Post by Mike »

Normally im looking for the source of these files:

portal_body.html
_block_config.html
...your block file...
and of course the source of the whole site...

in ff there are developer tolls where you can edit the site in realtime. But it doesnt work with a screenshot ;)
kein Support per PN / Messenger
no Support via PM / Messenger

NortonWalker
Active Member
Posts: 47
Joined: 17. July 2008 19:02
phpBB.de User: Exotic Shayle
Location: Egling a.d. Paar

Re: Calendar block for phpBB Calendar 0.0.8

Post by NortonWalker »

So Hallo,
gibt es denn jetzt eine Zusammenfassung in Deutsch?, weil ich blicke hier im Thread garnicht mehr durch nachd en ganzen Ausbesserungen. Ich habe das soweit Installiert, von den was auf der 1.Seite steht und das was auf der 3.Seite steht, diese functions, ausgebessert, aber trotzdem geht es noch nicht, der Block ist zwar ,,soweit da", aber die Schrift im Prosilver und Subsilver ist doppelt so groß und ich bekomme folgende fehlermeldung:

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3837: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:37)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3839: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:37)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3840: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:37)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3841: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:37)
Ich denke es liegt entweder an der Portal.php oder am functions_calendar

Währe schön wenn mir jemand helfen kann
denn mein Englisch ist praktisch nicht so gut...

Lg Marcel

NortonWalker
Active Member
Posts: 47
Joined: 17. July 2008 19:02
phpBB.de User: Exotic Shayle
Location: Egling a.d. Paar

Re: Calendar block for phpBB Calendar 0.0.8

Post by NortonWalker »

Ok Problem gelöst, wenn es keiner Macht fasse ich mal zusammen:
frold wrote:CALENDAR BLOCK FOR phpBB CALENDAR 0.0.7 (MAYBE EARLIER VERSIONS TOO)
Credit:
DaMysterious from http://damysterious.xs4all.nl/portal_premod/

Minor changes by frold

Demo: http://www.studmed.dk - See the block "Kalender"

CREATE
styles/prosilver/template/portal/block/calendar.html

REPLACE ALL WITH

Code: Select all

<div class="panel">
    <div class="inner">
        <span class="corners-top"><span></span></span>
            <h3><a href="{U_CALENDAR}" title="{L_CALENDAR}">{L_MINI_CAL_CALENDAR}</a></h3>
            
<table cellspacing="0" width="100%">
  <tr>
    <td class="row1" style="text-align: left"><!-- IF CALENDAR_PREV_MINI -->{CALENDAR_PREV_MINI}</a><!-- ENDIF --></td>
    <td class="row1" style="text-align: center"><span class="genmed">{CALENDAR_HEADER_MINI}</span></td>
    <td class="row1" style="text-align: right"><!-- 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" class="bg4">{SUNDAY_MINI}</td>
    <td style="width: 5%; text-align: center" class="bg4">{MONDAY_MINI}</td>
    <td style="width: 5%; text-align: center" class="bg4">{TUESDAY_MINI}</td>
    <td style="width: 5%; text-align: center" class="bg4">{WEDNESDAY_MINI}</td>
    <td style="width: 5%; text-align: center" class="bg4">{THURSDAY_MINI}</td>
    <td style="width: 5%; text-align: center" class="bg4">{FRIDAY_MINI}</td>
    <td style="width: 5%; text-align: center" class="bg4">{SATURDAY_MINI}</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}">
              <!-- 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">Events</td>
  </tr>
</table>

<table class="table_minical" cellspacing="0" cellpadding="0">
  <tr>
    <td class="row1">
<!-- BEGIN mini_calendar_days -->
      <!-- BEGIN events -->
      <!-- IF mini_calendar_days.events.S_FIRST_ROW -->
      <!-- IF mini_calendar_days.BIRTHDAYS --><hr><!-- ENDIF -->
      <!-- ELSE --><hr><!-- ENDIF -->
      <a href="{mini_calendar_days.events.DAY_VIEW_URL}"><!-- IF mini_calendar_days.events.COLOR --><span style="color:#{mini_calendar_days.events.COLOR}"><!-- ENDIF -->
      [{mini_calendar_days.events.NUMBER}]<!-- IF mini_calendar_days.events.COLOR --></span><!-- ENDIF --></a>
      <a href="{mini_calendar_days.events.EVENT_URL}" title="{mini_calendar_days.events.EVENT_SUBJECT}">
      <!-- IF mini_calendar_days.events.COLOR --><span style="color:#{mini_calendar_days.events.COLOR}"><!-- ENDIF -->
      <!-- IF mini_calendar_days.events.DISPLAY_BOLD --><strong><!-- ENDIF -->
      <!-- IF mini_calendar_days.events.IMAGE --><img src="{mini_calendar_days.events.IMAGE}" title="{mini_calendar_days.events.ETYPE_DISPLAY_NAME}" height="20" width="20" /><!-- ENDIF -->
      <!-- IF mini_calendar_days.events.ETYPE_DISPLAY_NAME -->{mini_calendar_days.events.ETYPE_DISPLAY_NAME}:<!-- ENDIF -->
      {mini_calendar_days.events.EVENT_SUBJECT}
      <!-- IF mini_calendar_days.events.DISPLAY_BOLD --></strong><!-- ENDIF -->
      <!-- IF mini_calendar_days.events.SHOW_TIME --><br /><!-- IF mini_calendar_days.events.ALL_DAY -->{L_ALL_DAY}<!-- ELSE -->
      {L_FROM_TIME}: {mini_calendar_days.events.START_TIME} <br />{L_TO_TIME}: {mini_calendar_days.events.END_TIME}<!-- ENDIF -->
      <!-- ENDIF -->
      <!-- IF mini_calendar_days.events.COLOR --></span><!-- ENDIF --></a><br />
      <!-- END events -->
<!-- END mini_calendar_days -->
    </td>
  </tr>
</table>

        <span class="corners-bottom"><span></span></span>
    </div>
</div>
<br style="clear:both" />
  
OPEN
language/en/common.php

FIND

Code: Select all

?>
BEFORE ADD

Code: Select all

//Missing lang variables
$lang['MONTH'] = 'Month';
$lang['WEEK'] = 'Week';
$lang['DAY'] = 'Day';

    // Event Calendar
    $lang = array_merge($lang, array(
       'CALENDAR'      => 'Calendar',
       // minical short day names   
       'mini_datetime'   => array(
            'Su'      => 'Su',
            'Mo'      => 'Mo',
            'Tu'      => 'Tu',
            'We'      => 'We',
            'Th'      => 'Th',
            'Fr'      => 'Fr',
            'Sa'      => 'Sa',
       ),
    ));
  
OPEN
portal.php

FIND

Code: Select all

include($phpbb_root_path . 'portal/includes/functions.'.$phpEx);  
AFTER ADD

Code: Select all

include($phpbb_root_path . 'includes/functions_calendar.' . $phpEx);  
FIND

Code: Select all

if ($portal_config['portal_change_style'])
{
    include($phpbb_root_path . 'portal/block/change_style.'.$phpEx);
}

  
AFTER ADD

Code: Select all

include($phpbb_root_path . 'portal/block/calendar.'.$phpEx);
  
OPEN
styles/prosilver/template/portal/portal_body.html


FIND

Code: Select all

        <!-- IF S_DISPLAY_MINICAL -->
            <!-- INCLUDE portal/block/mini_calendar.html -->
        <!-- ENDIF -->
  
AFTER ADD

Code: Select all

        <!-- INCLUDE portal/block/calendar.html -->
  
CREATE
portal/block/calendar.php

REPLACE ALL WITH

Code: Select all

<?php
/*
*
* @name mini_calendar.php
* @package phpBB3 Portal XL 4.0
* @version $Id: mini_calendar.php,v 1.4 2008/04/07 09:44:35 damysterious Exp $
*
* @copyright (c) 2007 Portal XL 4.0 Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/
if (!defined('IN_PHPBB'))
{
    exit;
}

/**
*/

// Generate calendar view or next events if required ...
calendar_display_mini_month();

// Assign specific vars
$template->assign_vars(array(
        'U_CALENDAR'    => append_sid("{$phpbb_root_path}calendar.$phpEx"),
    ));

// Set the filename of the template you want to use for this file.
$template->set_filenames(array(
    'body' => 'portal/block/calendar.html',
    ));


?>

OPEN
includes/functions_calendar.php

FIND

Code: Select all

$mode_sel_code = "";
  
AFTER ADD

Code: Select all

    /**
    * Begin additional Portal XL 4.0 functions
    */
    function calendar_display_center_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");

       //create next and prev links
       set_date_prev_next( "month" );
       $center_prev_link = append_sid($calling_page, "calM=".$date['prev_month']."&calY=".$date['prev_year']);
       $center_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( $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']));

       //center_calendar_header_txt = $user->lang['MONTH_OF'] . sprintf($user->lang['LOCAL_DATE_FORMAT'], $user->lang['datetime'][$date['month']], $date['day'], $date['year'] );
       $center_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 )
                   {
                      $center_calendar_days['START_WEEK'] = true;
                   }
                   else
                   {
                      $center_calendar_days['START_WEEK'] = false;
                   }
                   $center_calendar_days['END_WEEK'] = false;
                   $center_calendar_days['HEADER_CLASS'] = 'bg3';
                   $center_calendar_days['DAY_CLASS'] = 'bg2';
                   $center_calendar_days['NUMBER'] = 0;
                   $center_calendar_days['DUMMY_DAY'] = true;
                   $center_calendar_days['ADD_LINK'] = '';
                   $center_calendar_days['BIRTHDAYS'] = '';
                   $template->assign_block_vars('center_calendar_days', $center_calendar_days);
                }
             }
          }
          // start creating the data for the real days
          $center_calendar_days['START_WEEK'] = false;
          $center_calendar_days['END_WEEK'] = false;
          $center_calendar_days['DUMMY_DAY'] = false;
          $center_calendar_days['HEADER_CLASS'] = '';
          $center_calendar_days['DAY_CLASS'] = '';
          $center_calendar_days['NUMBER'] = 0;
          $center_calendar_days['ADD_LINK'] = '';
          $center_calendar_days['BIRTHDAYS'] = '';

          if($counter % 7 == 0)
          {
             $center_calendar_days['START_WEEK'] = true;
          }
          if($counter % 7 == 6 )
          {
             $center_calendar_days['END_WEEK'] = true;
          }
          $center_calendar_days['NUMBER'] = $j;
          if( $auth->acl_get('u_calendar_create_events') )
          {
             $center_calendar_days['ADD_LINK'] = append_sid("{$phpbb_root_path}calendarpost.$phpEx", "mode=post&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
          }
          $center_calendar_days['DAY_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=day&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
          $center_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'] )
          {
             $center_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))
          {
             $center_calendar_days['HEADER_CLASS'] = 'highlight';
             $center_calendar_days['DAY_CLASS'] = 'highlight';
          }


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

          $template->assign_block_vars('center_calendar_days', $center_calendar_days);

          if ( $user_can_view_events )
          {
             //find any events on this day
             $start_temp_date = gmmktime(0,0,0,$date['month_no'], $j, $date['year'])  - $user->timezone - $user->dst;
             $end_temp_date = $start_temp_date + 86399;

             $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
                    ((event_all_day = 1) AND (event_day LIKE '" . $db->sql_escape(sprintf('%2d-%2d-%4d', $j, $date['month_no'], $date['year'])) . "'))) ORDER BY event_start_time ASC";


             $result = $db->sql_query($sql);
             while ($row = $db->sql_fetchrow($result))
             {
                $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']);

                // 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('center_calendar_days.events', $event_output);
             }
             $db->sql_freeresult($result);
          }

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





       // A typical usage for sending your variables to your template.
       $template->assign_vars(array(
          'CALENDAR_HEADER_CENTER'      => $center_calendar_header_txt,
          'DAY_IMG'                  => $user->img('button_calendar_day', 'DAY'),
          'WEEK_IMG'                  => $user->img('button_calendar_week', 'WEEK'),
          'CALENDAR_PREV_CENTER'         => '<a href=\''.$center_prev_link.'\'><<</a>',
          'CALENDAR_NEXT_CENTER'         => '<a href=\''.$center_next_link.'\'>>></a>',
          'CALENDAR_VIEW_OPTIONS'       => $mode_sel_code.' '.$month_sel_code.' '.$day_sel_code.' '.$year_sel_code,
          'SUNDAY'                  => $sunday,
          'MONDAY'                  => $monday,
          'TUESDAY'                  => $tuesday,
          'WEDNESDAY'                  => $wednesday,
          'THURSDAY'                  => $thursday,
          'FRIDAY'                  => $friday,
          'SATURDAY'                  => $saturday,
          'S_POST_ACTION'               => append_sid("{$phpbb_root_path}calendar.$phpEx" ),
       ));

    }

    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" ),
       ));

    }

    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
    */
I recommand you do the changes you find in this treat too....
viewtopic.php?f=21&t=459&start=30#p6323
dann:
Graceland wrote:Today I have installed these great mod on my new phpbb3 Forum and I have updated it a little bit.

The 60 extra SQL querys on the Portal was too much for me.
I have done these changes:

- Removed the birthdays(31 SQL Querys) from the list, because there is another Box on the portal, which solved it better
- Reduce the Query for every day to one Query at the end for all days
(You needn't use the event_day row, because these timestamps stands in sort_timestamp )
- The mini calendar shows the next 5 events in the next 30 days. Not only from the current month.
- Days with events are shown bold
- The style is changed a little bit

You need do changes in functions_calendar.php and calendar.html.

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" ),
   ));

}
OPEN styles/prosilver/template/portal/block/calendar.html

REPLACE ALL WITH

Code: Select all

<div class="portal-panel">
   <div class="inner">
      <span class="corners-top"><span></span></span>
         <h3><table cellspacing=0 cellpadding=0><td><img src="{T_THEME_PATH}/images/portal/portal_calendar.gif" width="18px" height="15px" alt=""/>&nbsp;</td><td><a href="{U_CALENDAR}" title="{L_CALENDAR}">Kalender</a></td></table></h3>
         
<table cellspacing="0" width="100%">
			<tr>
				<td align="left" colspan="2"><!-- IF CALENDAR_PREV_MINI -->{CALENDAR_PREV_MINI}</a><!-- ENDIF --></td>
				<td colspan="3" align="center"><span class="genmed">{CALENDAR_HEADER_MINI}</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:#0000FF">{SUNDAY_MINI}</span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#0000FF">{MONDAY_MINI}</span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#0000FF">{TUESDAY_MINI}</span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#0000FF">{WEDNESDAY_MINI}</span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#0000FF">{THURSDAY_MINI}</span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall">{FRIDAY_MINI}</span></td>
    <td style="width: 5%; text-align: center"><span class="gensmall" style="color:#FF0000">{SATURDAY_MINI}</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">Veranstaltungen</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 -->

    </td>
  </tr>
</table>

      <span class="corners-bottom"><span></span></span>
   </div>
</div>
<br style="clear:both" />
I hope you understand my english and could use these modifications.
Die komplette funktion und nicht nur die eine Zeile

und zum Schluss sollte man noch beachten:
DeanB wrote:Den Fehler hatte ich auch , es liegt an der calendar.php dort sind vor dem <?php und ?> leerstellen die gelöscht werden müssen .
amroth wrote:habe alles soweit installed usw nur kommt jetzt ne fehler meldung

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3764: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3766: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3767: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:1)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3768: Cannot modify header information - headers already sent by (output started at /portal/block/calendar.php:1)
was muss ich machen das die verschwindet oder was hab ich falsch gemacht ?
und nicht nur die davor sondern auch die dahinter...

Lg Marcel

hegse
Active Member
Posts: 9
Joined: 4. January 2009 16:27
phpBB.de User: hegse

Re: Calendar block for phpBB Calendar 0.0.8

Post by hegse »

Nabend.

Funktioniert das ganze eigentlich mit dem Calendar Update auf 0.1.0?
Hat das schon jemand ausprobiert?

Gruß Hegse
User avatar

Alexandrej
Active Member
Posts: 6
Joined: 11. June 2009 20:52

Re: Calendar block for phpBB Calendar 0.0.8

Post by Alexandrej »

Nein :(

Has anyone come up with a version compatible with alightner's calendar 0.1.0 ?

------------------------

So since I got no response, I started to figure out if I could adapt the calendar block to version 0.1.0 so we could keep the calendar view exactly like it was under calendar 0.0.8 as version 1.0.3 of the calendar published in this thread (viewtopic.php?f=21&t=1567&p=10174&hilit ... ner#p10174) is not a calendar, just a block with a list of upcoming events.

I just upgraded to calendar 0.1.0 and the calendar works fine in my forum, but it blew up the portal completely.
When I go to the portal, I get a blank page with the following message :
Fatal error: Call to undefined function calendar_display_mini_month() in root\phpbb3_torontois\portal\block\calendar.php on line 21

So I followed frold's the instructions on how to create the portal block on page 1 of this thread and I found out the issue is that the update of file file root\includes\functions_calendar.php, got rid of entire function calendar_display_mini_month() function and all other calendar block functions. This is exaclty the error I got above where it could not find this function.

So I added the missing code :

OPEN
includes/functions_calendar.php

FIND

Code: Select all

$mode_sel_code = "";
  
AFTER ADD

Code: Select all

    /**
    * Begin additional Portal XL 4.0 functions
    */
    function calendar_display_center_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");

       //create next and prev links
       set_date_prev_next( "month" );
       $center_prev_link = append_sid($calling_page, "calM=".$date['prev_month']."&calY=".$date['prev_year']);
       $center_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( $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']));

       //center_calendar_header_txt = $user->lang['MONTH_OF'] . sprintf($user->lang['LOCAL_DATE_FORMAT'], $user->lang['datetime'][$date['month']], $date['day'], $date['year'] );
       $center_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 )
                   {
                      $center_calendar_days['START_WEEK'] = true;
                   }
                   else
                   {
                      $center_calendar_days['START_WEEK'] = false;
                   }
                   $center_calendar_days['END_WEEK'] = false;
                   $center_calendar_days['HEADER_CLASS'] = 'bg3';
                   $center_calendar_days['DAY_CLASS'] = 'bg2';
                   $center_calendar_days['NUMBER'] = 0;
                   $center_calendar_days['DUMMY_DAY'] = true;
                   $center_calendar_days['ADD_LINK'] = '';
                   $center_calendar_days['BIRTHDAYS'] = '';
                   $template->assign_block_vars('center_calendar_days', $center_calendar_days);
                }
             }
          }
          // start creating the data for the real days
          $center_calendar_days['START_WEEK'] = false;
          $center_calendar_days['END_WEEK'] = false;
          $center_calendar_days['DUMMY_DAY'] = false;
          $center_calendar_days['HEADER_CLASS'] = '';
          $center_calendar_days['DAY_CLASS'] = '';
          $center_calendar_days['NUMBER'] = 0;
          $center_calendar_days['ADD_LINK'] = '';
          $center_calendar_days['BIRTHDAYS'] = '';

          if($counter % 7 == 0)
          {
             $center_calendar_days['START_WEEK'] = true;
          }
          if($counter % 7 == 6 )
          {
             $center_calendar_days['END_WEEK'] = true;
          }
          $center_calendar_days['NUMBER'] = $j;
          if( $auth->acl_get('u_calendar_create_events') )
          {
             $center_calendar_days['ADD_LINK'] = append_sid("{$phpbb_root_path}calendarpost.$phpEx", "mode=post&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
          }
          $center_calendar_days['DAY_VIEW_URL'] = append_sid("{$phpbb_root_path}calendar.$phpEx", "view=day&calD=".$j."&calM=".$date['month_no']."&calY=".$date['year']);
          $center_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'] )
          {
             $center_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))
          {
             $center_calendar_days['HEADER_CLASS'] = 'highlight';
             $center_calendar_days['DAY_CLASS'] = 'highlight';
          }


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

          $template->assign_block_vars('center_calendar_days', $center_calendar_days);

          if ( $user_can_view_events )
          {
             //find any events on this day
             $start_temp_date = gmmktime(0,0,0,$date['month_no'], $j, $date['year'])  - $user->timezone - $user->dst;
             $end_temp_date = $start_temp_date + 86399;

             $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
                    ((event_all_day = 1) AND (event_day LIKE '" . $db->sql_escape(sprintf('%2d-%2d-%4d', $j, $date['month_no'], $date['year'])) . "'))) ORDER BY event_start_time ASC";


             $result = $db->sql_query($sql);
             while ($row = $db->sql_fetchrow($result))
             {
                $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']);

                // 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('center_calendar_days.events', $event_output);
             }
             $db->sql_freeresult($result);
          }

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





       // A typical usage for sending your variables to your template.
       $template->assign_vars(array(
          'CALENDAR_HEADER_CENTER'      => $center_calendar_header_txt,
          'DAY_IMG'                  => $user->img('button_calendar_day', 'DAY'),
          'WEEK_IMG'                  => $user->img('button_calendar_week', 'WEEK'),
          'CALENDAR_PREV_CENTER'         => '<a href=\''.$center_prev_link.'\'><<</a>',
          'CALENDAR_NEXT_CENTER'         => '<a href=\''.$center_next_link.'\'>>></a>',
          'CALENDAR_VIEW_OPTIONS'       => $mode_sel_code.' '.$month_sel_code.' '.$day_sel_code.' '.$year_sel_code,
          'SUNDAY'                  => $sunday,
          'MONDAY'                  => $monday,
          'TUESDAY'                  => $tuesday,
          'WEDNESDAY'                  => $wednesday,
          'THURSDAY'                  => $thursday,
          'FRIDAY'                  => $friday,
          'SATURDAY'                  => $saturday,
          'S_POST_ACTION'               => append_sid("{$phpbb_root_path}calendar.$phpEx" ),
       ));

    }

    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" ),
       ));

    }

    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
    */
Then, frold recomended to do the changes you find in this treat too....
viewtopic.php?f=21&t=459&start=30#p6323[/quote]

So I went ahead and made the following changes :

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" ),
   ));

}
So now, I don't get the error message Fatal error: Call to undefined function calendar_display_mini_month() in root\phpbb3_torontois\portal\block\calendar.php on line 21,
but I do the the following error message :
SQL ERROR [ mysql4 ]
Syntax error near '\'%,15,%\') ) ) AND ((( event_start_time >= 1250208000 AND event_sta' on line 4 [1064]


Looks like I am getting close. Any idea what could be causing this problem ?
User avatar

Midge
Sponsor
Posts: 75
Joined: 22. February 2009 22:47
phpBB.com User: Midge

Re: Calendar block for phpBB Calendar 0.0.8

Post by Midge »

I've just finished installing the Portal version 1.0.4. The only block I couldn't get to work again was this calendar block (I'm still using version 0.0.8 for the moment). I added the code in portal.php - as far as I can see this was the only file that was touched by the portal update earlier, everything else remained the same - but only a white page was displayed after the additions, without any error messages.
Am I missing anything?

NortonWalker
Active Member
Posts: 47
Joined: 17. July 2008 19:02
phpBB.de User: Exotic Shayle
Location: Egling a.d. Paar

Re: Calendar block for phpBB Calendar 0.0.8

Post by NortonWalker »

Hi Leute hab ein Problem,
der zieht mir seit dem neuen Update vom Portal den Kalenderblock ganz breit woran liegt das?
aber ich glaube das liegt nicht am Update nur was kann ich machen...
Ist aber immer nur beim aktuellen Monat . . .
Also der titel Kalender ist richtig, nur ab den Tagen und das was darunter kommt geht ca. 40px nach refchts raus und drückt alles nach links...

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