Erweitert Wysiwyg-Text u. Bild (V1.1)

Hinzugefügt:

  • Wysiwyg Text
  • Thumb mit LightBox
  • TAG für Vorschaubild beim Aufruf: z.B. WxHxCxQ=150x100x0x80 (WIDTHxHEIGHTxCROPxQUALITY)



Docu: –
Forum: –

Autor: K.Heermann (flip-flop) http://planmatrix.de
CMS Version: >= V1.4.2 r348
Version: V1.1 (29.11.2010)
Verzeichnis: include/inc_module/mod_calendar/inc/ *
Bedingung:



TAG-Set:

{CALENDAR:
items=10
template=my_dates_list_de.html
lang=de
tag=tag1, tag2
tagmode=OR
date_start=01.01.2010
date_end=31.12.2010
href=index.php?ebene06
WxHxCxQ=150x100x0x80
}


Template:

Hinzugefügt TEXTLONG für den Wysiwyg Text und IMAGE_CALENDAR für das kleine Vorschaubild und Originalbild (LightBox):

[TEXTLONG]{TEXTLONG}[/TEXTLONG]
[IMAGE_CALENDAR]{IMAGE_CALENDAR}[/IMAGE_CALENDAR]

template

<div class="calendar">
  <div class="left">
    <div class="date">
      <p><strong>Startdatum: {STARTDATE:d.m.}</strong><strong class="year">{STARTDATE:Y}</strong></p>
      <p><strong>Enddatum: {ENDDATE:d.m.}</strong><strong class="year">{ENDDATE:Y}</strong></p>
    </div>
  </div>
  <div class="detail">
    <div class="image">
      [IMAGE_CALENDAR]{IMAGE_CALENDAR}[/IMAGE_CALENDAR]
    </div>
    <div class="teaser">
      [TITLE]<h2>{TITLE}</h2>[/TITLE]
      [PLACE]<p class="place">Ort: {PLACE}</p>[/PLACE]
      [HREF]<div class="other">HREF: {HREF}</div>[/HREF]
      [URL]<div class="other">URL: {URL}[TARGET]{TARGET}[/TARGET]</div>[/URL]
 
      [TEXT]<div class="textlong">{TEXT}</div>[/TEXT]
      [TEXTLONG]<div class="textlong">{TEXTLONG}</div>[/TEXTLONG]
    </div>
  </div>
  <div style=clear:both;"><!--nop//--></div>
</div>

Die Ausführung der LightBox wird im Termin durch den Schalter [x] LightBox gesteuert.
[x] Klick vergrößern ist ohne Funktion.

Technik: Die Bilder werden über das Verfahren “cmsimage” geladen.


PHP:

Etwa ab Zeile 105 in /include/inc_module/mod_calendar/inc/calendar.class.php

nach

$items[$key] = render_cnt_template($items[$key], 'PLACE', html_specialchars($date['calendar_where']));
$items[$key] = render_cnt_date($items[$key], $date['calendar_start_date'], $date['calendar_start_date'], $date['calendar_end_date']);

folgendes einfügen

// Patch KH 26.11.10: http://www.phpwcms-howto.de/wiki/doku.php/deutsch/module/kalender?s[]=calendar
$items[$key] = render_cnt_template($items[$key], 'TEXTLONG', $date['calendar_text']);
// + KH: 28.11.2010
$items[$key] = render_cnt_template($items[$key], 'IMAGE_CALENDAR', $this->image_calendar($date));


nach (etwa Zeile 141)

$default['href']		= empty($match['href']) ? '' : trim($match['href']);

folgendes einfügen

// +KH: We want to set the size of the image, and such more in the reptag.
$default['WxHxCxQ']        = empty($match['WxHxCxQ']) ? '' : preg_replace('/[^0-9x]/', '', trim($match['WxHxCxQ']));


nach (etwa Zeile 154)

			$default['tagmode']		= 'OR';

folgendes einfügen

            // +KH: We want to set the size of the image, and such more in the reptag.
            $default['WxHxCxQ']        = '120x120x0x90';


nach (etwa Zeile 209)

		$this->limit = $default['items'];
		$this->href  = $default['href'];

folgendes einfügen

        $this->WxHxCxQ    = $default['WxHxCxQ'];  // +KH 28.11.10


Am Ende der Datei zwischen

		if( !$this->dates ) {
			$this->dates = array();
		}
	}

und


}


?>

folgende Funktion einfügen

image_calendar

    /**
     * =======================================
     * + KH: 28.11.2010
     * Insert value for TAG: WxHxCxQ and
     * LightBox switch  in calendar input
     * =======================================
     */
    function image_calendar(&$date) {
 
        /**
        * Get Image ID from $data
        * [image] => Array
        * (
        *     [id] => 2
        *     [name] => ImageName.jpg
        *     [zoom] => 1
        *     [lightbox] => 1
        *     [caption] => Caption text
        *     [link] => http://example.com
        * )
        */
        $temp = unserialize($date['calendar_object']);
 
        $img_cal = '';
 
        if ($temp['image']['id']) {
 
            $temp_id     = $temp['image']['id'];
            $temp_alt    = ($temp['image']['caption']) ? $temp[image][caption] : $temp[image][name];
            $temp_title  = ($temp['image']['caption']) ? $temp[image][caption] : '';
            $temp_WxH    = $GLOBALS['phpwcms']['img_prev_width'].'x'.$GLOBALS['phpwcms']['img_prev_height'];
 
            // LightBox = ON ?
            if ($temp['image']['lightbox']) {
 
                initSlimbox();
 
                $img_cal  = '<a href="img/cmsimage.php/'.$temp_WxH.'/'.$temp_id.'" rel="lightbox[CALXYZ2]" alt="'.$temp_alt.'" title="'.$temp_title.'" target="_blank">';
                $img_cal .= '<img src="img/cmsimage.php/'.$this->WxHxCxQ.'/'.$temp_id.'" alt="'.$temp_alt.'" title="'.$temp_title.'" border="" /></a>';
            }
            else
                $img_cal = '<img src="img/cmsimage.php/'.$this->WxHxCxQ.'/'.$temp_id.'" alt="'.$temp_alt.'" title="'.$temp_title.'" />';
            }
 
    return $img_cal;
 
    }  // ===== END function image_calendar


Download V1.1:

  • include/inc_module/mod_calendar/inc/calendar.class.php
  • template/inc_script/frontend_render/init_calendar.php
  • template/calendar/calendar.html
  • template/inc_css/specific/calendar.css

calendar_v11.zip (7.52 KiB, 89 downloads)


Knut Heermann (flip-flop) 2010/11/29 01:37

deutsch/module/kalender/erweitert-v11.txt · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0