Portalboxen verschieben

Aktuelle Version: 2.1.0
Veröffentlicht: 26.10.2015
Forum rules
Vor dem erstellen neuer Supportanfragen bitte zuerst in die board3 Portal FAQ schauen und die Suche benutzen!
Viele Fragen sind bereits schon gestellt und beantwortet worden.
Bitte auch unsere Forumsregeln lesen und beachten!
Locked

Topic author
demaetz
Active Member
Posts: 5
Joined: 1. April 2016 07:21

Portalboxen verschieben

Post by demaetz »

Deine Portal Version: 2.1.0
Typ Deines phpBB Forums: Standard phpBB3
MODs installiert: Nein
Dein Wissensstand: Einsteiger

Was hast Du gemacht, bevor das Problem aufgetreten ist?
Hallo,

da in unserem Kalender ziemlich viele Events stehen, wollte ich die Kalender-Portalbox gerne nicht seitlich sondern in der Mitte anordnen. Der Kalender wird dort serienmäßig nicht in der Auswahlliste für das hinzufügen angezeigt.


Was hast Du bereits versucht um das Problem zu lösen?
Ich habe in der calender.php die Parameter der Variable $columns von 10 auf 14 gesetzt.

nun kann ich zwar die Bos in der Mitte einsortieren, allerdings wird der Kalender dennoch nicht im Portal angezeigt.


Fehlerbeschreibung und Nachricht
An welcher Stelle muss noch etwas angepasst werden, damit der Kalender in der mittleren Box angezeigt wird?

Danke und VG,
Mätz
User avatar

Kirk
Dev
Posts: 1950
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: Portalboxen verschieben

Post by Kirk »

Hallo
Du musst noch ein bischen mehr machen.
Öffne: /ext/board3/portal/modules/calendar.php
Finde:

Code: Select all

    /**
    * {@inheritdoc}
    */
    public function get_template_acp($module_id)
Davor einfügen:

Code: Select all

    /**
    * {@inheritdoc}
    */
    public function get_template_center($module_id)
    {
        $portal_config = obtain_portal_config();

        // 0 = Sunday first - 1 = Monday first. ;-)
        if ($this->config['board3_sunday_first_' . $module_id])
        {
            $this->mini_cal_fdow = 0;
        }
        else
        {
            $this->mini_cal_fdow = 1;
        }

        // get the calendar month
        $this->mini_cal_month = 0;
        if ($this->request->is_set('m' . $module_id))
        {
            $this->mini_cal_month = $this->request->variable('m' . $module_id, 0);
        }

        // initialise some variables
        $this->time = $this->user->create_datetime();
        $now = phpbb_gmgetdate($this->time->getTimestamp() + $this->time->getOffset());
        $today_timestamp = $now[0];
        $mini_cal_today = date('Ymd', $today_timestamp);
        $this->stamp = (int) $today_timestamp;
        $s_cal_month = ($this->mini_cal_month != 0) ? $this->mini_cal_month . ' month' : $mini_cal_today;
        $this->get_month($s_cal_month);
        $mini_cal_count = $this->mini_cal_fdow;
        $mini_cal_this_year = $this->dateYYYY;
        $mini_cal_this_month = $this->dateMM;
        $mini_cal_month_days = $this->daysMonth;

        // output our general calendar bits
        $down = $this->mini_cal_month - 1;
        $up = $this->mini_cal_month + 1;
        $prev_month = '<a href="' . $this->modules_helper->route('board3_portal_controller') . "?m$module_id=$down#minical$module_id" . '" rel="nofollow"><span class="portal-arrow-left-icon" title="' . $this->user->lang['VIEW_PREVIOUS_MONTH'] . '"></span></a>';
        $next_month = '<a href="' . $this->modules_helper->route('board3_portal_controller') . "?m$module_id=$up#minical$module_id" . '" rel="nofollow"><span class="portal-arrow-right-icon" title="' . $this->user->lang['VIEW_NEXT_MONTH'] . '"></span></a>';

        $this->template->assign_block_vars('minical', array(
            'S_SUNDAY_FIRST'    => ($this->config['board3_sunday_first_' . $module_id]) ? true : false,
            'L_MINI_CAL_MONTH'    => (($this->config['board3_long_month_' . $module_id]) ? $this->user->lang['mini_cal']['long_month'][$this->day[0][1]] : $this->user->lang['mini_cal']['month'][$this->day[0][1]]) . " " . $this->day[0][2],
            'L_MINI_CAL_SUN'    => '<span style="color: ' . $this->config['board3_calendar_sunday_color_' . $module_id] . ';">' . $this->user->lang['mini_cal']['day'][1] . '</span>',
            'L_MINI_CAL_MON'    => $this->user->lang['mini_cal']['day'][2],
            'L_MINI_CAL_TUE'    => $this->user->lang['mini_cal']['day'][3],
            'L_MINI_CAL_WED'    => $this->user->lang['mini_cal']['day'][4],
            'L_MINI_CAL_THU'    => $this->user->lang['mini_cal']['day'][5],
            'L_MINI_CAL_FRI'    => $this->user->lang['mini_cal']['day'][6],
            'L_MINI_CAL_SAT'    => $this->user->lang['mini_cal']['day'][7],
            'U_PREV_MONTH'        => $prev_month,
            'U_NEXT_MONTH'        => $next_month,
            'S_DISPLAY_EVENTS'    => ($this->config['board3_display_events_' . $module_id]) ? true : false,
            'MODULE_ID'            => $module_id,
        ));

        // output the days for the current month
        for ($i = 0; $i < $mini_cal_month_days;)
        {
            // is this the first day of the week?
            if ($mini_cal_count == $this->mini_cal_fdow)
            {
                $this->template->assign_block_vars('minical.mini_cal_row', array(
                    'MODULE_ID'        => $module_id,
                ));
            }

            // is this a valid weekday?
            if ($mini_cal_count == ($this->day[$i][3]))
            {
                $mini_cal_this_day = $this->day[$i][0];

                $d_mini_cal_today = $mini_cal_this_year . (($mini_cal_this_month <= 9) ? '0' . $mini_cal_this_month : $mini_cal_this_month) . (($mini_cal_this_day <= 9) ? '0' . $mini_cal_this_day : $mini_cal_this_day);
                $mini_cal_day = ($mini_cal_today == $d_mini_cal_today) ? '<span style="font-weight: bold; color: ' . $this->config['board3_calendar_today_color_' . $module_id] . ';">' . $mini_cal_this_day . '</span>' : $mini_cal_this_day;

                $this->template->assign_block_vars('minical.mini_cal_row.mini_cal_days', array(
                    'MINI_CAL_DAY'        => ($mini_cal_count == 0) ? '<span style="color: ' . $this->config['board3_calendar_sunday_color_' . $module_id] . ';">' . $mini_cal_day . '</span>' : $mini_cal_day)
                );
                $i++;
            }
            // no day
            else
            {
                $this->template->assign_block_vars('minical.mini_cal_row.mini_cal_days', array(
                    'MINI_CAL_DAY'        => ' ')
                );
            }

            // is this the last day of the week?
            if ($mini_cal_count == self::DAYS_PER_WEEK)
            {
                // if so then reset the count
                $mini_cal_count = 0;
            }
            else
            {
                // otherwise increment the count
                $mini_cal_count++;
            }
        }

        // fill table with empty strings
        while ($mini_cal_count <= self::DAYS_PER_WEEK)
        {
            $this->template->assign_block_vars('minical.mini_cal_row.mini_cal_days', array(
                'MINI_CAL_DAY'        => ' ')
            );
            $mini_cal_count++;
        }

        /*
        * Let's start displaying the events
        * make sure we only display events in the future
        */
        $events = json_decode($portal_config['board3_calendar_events_' . $module_id], true);

        if (!empty($events) && $this->config['board3_display_events_' . $module_id])
        {
            $time_ary = array();
            // we sort the $events array by the start time
            foreach ($events as $key => $cur_event)
            {
                $time_ary[$key] = $cur_event['start_time'];
            }
            array_multisort($time_ary, SORT_NUMERIC, $events);

            $groups_ary = get_user_groups();

            foreach ($events as $key => $cur_event)
            {
                if (($cur_event['start_time'] + $this->time->getOffset()) >= $today_timestamp ||
                    ($cur_event['end_time'] + $this->time->getOffset()) >= $today_timestamp ||
                    (($cur_event['start_time'] + $this->time->getOffset() + self::TIME_DAY) >= $today_timestamp && $cur_event['all_day']))
                {
                    $cur_permissions = explode(',', $cur_event['permission']);
                    $permission_check = array_intersect($groups_ary, $cur_permissions);

                    if (!empty($permission_check) || $cur_event['permission'] == '')
                    {
                        // check if this is an external link
                        if (isset($cur_event['url']) && strpos($cur_event['url'], generate_board_url()) === false)
                        {
                            $is_external = true;
                        }
                        else
                        {
                            $is_external = false;
                        }

                        /**
                        * Current events
                        *
                        * Events are treated as current if the following is met:
                        * - We have an all day event and the start of that event is less than 1 day (86400 seconds) away
                        * - We have a normal event with a start that is less then 1 day away and that hasn't ended yet
                        */
                        if ((($cur_event['start_time'] + $this->time->getOffset() - $today_timestamp) <= self::TIME_DAY && $cur_event['all_day']) ||
                        (($cur_event['start_time'] + $this->time->getOffset() - $today_timestamp) <= self::TIME_DAY && ($cur_event['end_time'] + $this->time->getOffset()) >= $today_timestamp))
                        {
                            $this->template->assign_block_vars('minical.cur_events', array(
                                'EVENT_URL'        => (isset($cur_event['url']) && $cur_event['url'] != '') ? $this->validate_url($cur_event['url']) : '',
                                'EVENT_TITLE'    => $cur_event['title'],
                                'START_TIME'    => $this->user->format_date($cur_event['start_time']),
                                'END_TIME'        => (!empty($cur_event['end_time'])) ? $this->user->format_date($cur_event['end_time']) : false,
                                'EVENT_DESC'    => (isset($cur_event['desc']) && $cur_event['desc'] != '') ? $cur_event['desc'] : '',
                                'ALL_DAY'    => ($cur_event['all_day']) ? true : false,
                                'MODULE_ID'        => $module_id,
                                'EVENT_URL_NEW_WINDOW'    => ($is_external && $this->config['board3_events_url_new_window_' . $module_id]) ? true : false,
                            ));
                        }
                        else
                        {
                            $this->template->assign_block_vars('minical.upcoming_events', array(
                                'EVENT_URL'        => (isset($cur_event['url']) && $cur_event['url'] != '') ? $this->validate_url($cur_event['url']) : '',
                                'EVENT_TITLE'    => $cur_event['title'],
                                'START_TIME'    => $this->user->format_date($cur_event['start_time']),
                                'END_TIME'        => (!$cur_event['all_day']) ? $this->user->format_date($cur_event['end_time']) : '',
                                'EVENT_DESC'    => (isset($cur_event['desc']) && $cur_event['desc'] != '') ? $cur_event['desc'] : '',
                                'ALL_DAY'    => (($cur_event['start_time'] - $cur_event['end_time']) == 1) ? true : false,
                                'MODULE_ID'        => $module_id,
                                'EVENT_URL_NEW_WINDOW'    => ($is_external && $this->config['board3_events_url_new_window_' . $module_id]) ? true : false,
                            ));
                        }
                    }
                }
            }
        }

        return 'calendar_center.html';
    }

Erstelle eine Datei Namens calendar_center.html mit folgendem Inhalt:

Code: Select all

<!-- BEGIN minical -->
<!-- IF minical.MODULE_ID eq $MODULE_ID -->
<a id="minical{minical.MODULE_ID}"></a>
{$C_BLOCK_H_L}{$TITLE}{$C_BLOCK_H_R}
<div class="panel bg2 portal-no-margin">
	<div class="inner">
		<div class="postbody portal-module-postbody">
			<div class="content portal-module-content">
	<table class="portal-module-postbody">
		<tr>
			<td class="portal-calendar-go-previous" colspan="2"><!-- IF S_CONTENT_DIRECTION eq 'rtl' -->{minical.U_NEXT_MONTH}<!-- ELSE -->{minical.U_PREV_MONTH}<!-- ENDIF --></td>
			<td colspan="3" class="portal-calendar-current-month"><span class="genmed">{minical.L_MINI_CAL_MONTH}</span></td>
			<td class="portal-calendar-go-next" colspan="2"><!-- IF S_CONTENT_DIRECTION eq 'rtl' -->{minical.U_PREV_MONTH}<!-- ELSE -->{minical.U_NEXT_MONTH}<!-- ENDIF --></td>
		</tr>
		<tr class="portal-calendar-days-title">
			<!-- IF minical.S_SUNDAY_FIRST -->
				<td><span class="gensmall">{minical.L_MINI_CAL_SUN}</span></td>
			<!-- ENDIF -->
				<td><span class="gensmall">{minical.L_MINI_CAL_MON}</span></td>
				<td><span class="gensmall">{minical.L_MINI_CAL_TUE}</span></td>
				<td><span class="gensmall">{minical.L_MINI_CAL_WED}</span></td>
				<td><span class="gensmall">{minical.L_MINI_CAL_THU}</span></td>
				<td><span class="gensmall">{minical.L_MINI_CAL_FRI}</span></td>
				<td><span class="gensmall">{minical.L_MINI_CAL_SAT}</span></td>
			<!-- IF not minical.S_SUNDAY_FIRST -->
				<td><span class="gensmall">{minical.L_MINI_CAL_SUN}</span></td>
			<!-- ENDIF -->
		</tr>
		<!-- BEGIN mini_cal_row -->
		<!-- IF minical.mini_cal_row.MODULE_ID eq $MODULE_ID -->
		<tr class="portal-calendar-days">
			<!-- BEGIN mini_cal_days -->
				<td><span class="gensmall">{minical.mini_cal_row.mini_cal_days.MINI_CAL_DAY}</span></td>
			<!-- END mini_cal_days -->
		</tr>
		<!-- ENDIF -->
		<!-- END mini_cal_row -->
	</table>
	<!-- IF minical.S_DISPLAY_EVENTS -->
	<hr class="dashed" />
	<div class="menutitle portal-calendar-events-heading">{L_CURRENT_EVENTS}{L_COLON}</div>
	<ul class="portal-events">
		<!-- BEGIN cur_events -->

		<li class="row">
			<dl class="icon">
				<dt class="portal-calendar-event-listing">
					<!-- IF minical.cur_events.EVENT_URL --><a href="{minical.cur_events.EVENT_URL}" title="{minical.cur_events.EVENT_TITLE}" <!-- IF minical.cur_events.EVENT_URL_NEW_WINDOW -->onclick="window.open('{minical.cur_events.EVENT_URL}'); return false;"<!-- ENDIF -->><!-- ENDIF -->
					<span class="portal-calendar-event-title">{minical.cur_events.EVENT_TITLE}{L_COLON}</span><br />
					<!-- IF minical.cur_events.ALL_DAY -->{L_EVENT_START}{L_COLON}&nbsp;{minical.cur_events.START_TIME}<br />{L_EVENT_ALL_DAY}<br />
					<!-- ELSEIF not minical.cur_events.ALL_DAY and minical.cur_events.END_TIME -->{L_EVENT_START}{L_COLON}&nbsp;{minical.cur_events.START_TIME}<br />{L_EVENT_END}{L_COLON}&nbsp;{minical.cur_events.END_TIME}<br />
					<!-- ELSE -->{L_EVENT_ALL_DAY}<br />
					<!-- ENDIF -->
					<!-- IF minical.cur_events.EVENT_DESC --><span class="portal-calendar-event-description">{minical.cur_events.EVENT_DESC}</span><!-- ENDIF -->
					<!-- IF minical.cur_events.EVENT_URL --></a><!-- ENDIF -->
				</dt>
			</dl>
		</li>

		<!-- BEGINELSE -->
		<li class="calendar-info"><span class="gensmall portal-title-span"><strong>{L_NO_CUR_EVENTS}</strong></span><br /></li>
		<!-- END cur_events -->
	</ul>
	<hr class="portal-calendar-divider" />
	<div class="menutitle portal-calendar-events-heading">{L_UPCOMING_EVENTS}{L_COLON}</div>
	<ul class="portal-events">
		<!-- BEGIN upcoming_events -->

		<li class="row">
			<dl class="icon">
				<dt class="portal-calendar-event-listing">
					<!-- IF minical.upcoming_events.EVENT_URL --><a href="{minical.upcoming_events.EVENT_URL}" title="{minical.upcoming_events.EVENT_TITLE}" <!-- IF minical.upcoming_events.EVENT_URL_NEW_WINDOW -->onclick="window.open('{minical.upcoming_events.EVENT_URL}'); return false;"<!-- ENDIF -->><!-- ENDIF -->
					<span class="portal-calendar-event-title">{minical.upcoming_events.EVENT_TITLE}{L_COLON}</span><br />
					<!-- IF not minical.upcoming_events.ALL_DAY and not minical.upcoming_events.END_TIME -->{L_EVENT_TIME}{L_COLON}&nbsp;{minical.upcoming_events.START_TIME}<br />
					<!-- ELSEIF not minical.upcoming_events.ALL_DAY and minical.upcoming_events.END_TIME -->{L_EVENT_START}{L_COLON}&nbsp;{minical.upcoming_events.START_TIME}<br />{L_EVENT_END}{L_COLON}&nbsp;{minical.upcoming_events.END_TIME}<br />
					<!-- ELSE -->{L_EVENT_TIME}{L_COLON}&nbsp;{minical.upcoming_events.START_TIME}<br />{L_EVENT_ALL_DAY}<br />
					<!-- ENDIF -->
					<!-- IF minical.upcoming_events.EVENT_DESC --><span class="portal-calendar-event-description">{minical.upcoming_events.EVENT_DESC}</span><br /><!-- ENDIF -->
					<!-- IF minical.upcoming_events.EVENT_URL --></a><!-- ENDIF -->
				</dt>
			</dl>
		</li>

		<!-- BEGINELSE -->
		<li class="calendar-info"><span class="gensmall portal-title-span"><strong>{L_NO_UPCOMING_EVENTS}</strong></span><br /></li>
		<!-- END upcoming_events -->
	</ul>
	<br />
	<!-- ENDIF -->
			</div>
		</div>
	</div>
</div>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
<!-- ENDIF -->
<!-- END minical -->
Lade diese Datei nach root/ext/board3/portal/styles/prosilver/template/portal/modules/

Öffne: root/ext/board3/portal/styles/prosilver/theme/portal.css
Finde:

Code: Select all

.portal-calendar-days-title td, .portal-calendar-days td {
	width: 14%;
}
Ersetzen mit:

Code: Select all

.portal-calendar-days-title td, .portal-calendar-days td {
	width: 14%;
	text-align: center;
}
Finde:

Code: Select all

.portal-events li.row {
    border-top: 0 none;
    list-style-type: none;
}
Ersetzen mit:

Code: Select all

.portal-events li.row {
    border-top: 0 none;
    list-style-type: none;
    margin-left: -39px;
}
Leere den Cache im "Administrations-Bereich" (ACP) > "Allgemein" > "Den Cache leeren"
Leere deinen Browser Cache STRG+F5
Gruß Udo

Topic author
demaetz
Active Member
Posts: 5
Joined: 1. April 2016 07:21

Re: Portalboxen verschieben

Post by demaetz »

Hallo Udo,

danke Dir für die Hilfe. Funktioniert einwandfrei. Sieht gut aus.

VG,
Mätz
Locked

Return to “Board3 Portal 2.1.x - Deutscher Support”