Calendar (old Version)

Dont´t use this version.

Download: http://forum.phpwcms.org/viewtopic.php?p=103834#p103834

Module: Module Calendar/Events (6.49 KiB, 84 downloads) (integrated since V1.4.2 r348)

Changed file for wysiwyg output with picture from file center (up to V1.4.2 r347): Complete set, CSS, Templ, php (5.79 KiB, 80 downloads)

Installation

Move template/inc_script/frontend_render/disabled/init-calendar.php into: template/inc_script/frontend_render/init-calendar.php

init-calendar.php

<?php
/*************************************************************************************
   Copyright notice
 
   (c) 2002-2008 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
 
This script is part of PHPWCMS. The PHPWCMS web content management system is
free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
 
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
A copy is found in the textfile GPL.txt and important notices to the license
from the author is found in LICENSE.txt distributed with these scripts.
 
This script is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/
// ----------------------------------------------------------------
// OBLIGATE CHECK FOR PHPWCMS CONSTANTS
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// ----------------------------------------------------------------
 
 
/**
 * Usage: sample Replacement Tag
 *
 * {CALENDAR:
 *    items=100
 *    template=dates_list_de.html
 *    lang=de
 *    tag=tag1, tag2
 *    tagmode=OR
 *    date_start=01.01.2009
 *     date_end=31.12.2010
 *    href=index.php?calendar
 * }
 *
 * OR
 *
 * {CALENDAR:2,main_page.tmpl,de en, href, tag1, tag2 tag2, tag3}
 * [item count,[template[,language(en de - separated by space)[, href, tags, tag, tag, tag]]]]
 *
 **/
 
if(strpos($content['all'], '{CALENDAR:')) {
 
    $GLOBALS['block']['css']['calendar'] = 'specific/calendar.css'; // +kh: including the css file
 
    include('include/inc_module/mod_calendar/inc/calendar.class.php');
 
    $myCal = & new phpwcmsCalendar();
    $myCal->parse($content['all']);
 
}
 
?>


In backend choose → calendar/events and afterwards you should delete (or rename) the setup folder. The database now should contain the calendar tables.

Now again click the module link → calendar/events and enter a new entry. Fill in all fields but the description.
The picture feature will not be working at this time, the content of the calendar class didn't reveal anything, at least.

Now set up a new article and add a content part (CP) → plain text.

The replacement tag (RT) looks like (from V1.42 r348 upwards) this:

Tags of the calendars: http://forum.phpwcms.org/viewtopic.php?p=106796#p106796

{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
}
tag1, tag2, and so on will be entered at calendar: (separated with ,).
This way you can filter different groups for output purposes containing this(these) tag(s).
Tagmode: only OR possible at this time.

The template can be found in /template/calendar/


Deliver the text of the Wysiwyg Editor

→ starting at line 105 /template/inc_script/phpwcmsCalendar.class.php
→ Since V1.42 r348 from line 105 /include/inc_module/mod_calendar/inc/calendar.class.php
$items[$key] = $this->template;
$items[$key] = render_cnt_template($items[$key], 'HREF', $href);
$items[$key] = render_cnt_template($items[$key], 'TITLE', html_specialchars($date['calendar_title']));
$items[$key] = render_cnt_template($items[$key], 'TEXT', plaintext_htmlencode($date['calendar_teaser']));
$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']);

(since V1.42 r348 URL and TARGET are added).

→ insert
 $items[$key] = render_cnt_template($items[$key], 'TEXTLONG', $date['calendar_text']);
TEXTLONG is the placeholder for the template:


Example text for TEXTLONG:

Template

<div class="calendar">
        <div class="date">
                <strong>{STARTDATE:d.m.}</strong><strong class="year">{STARTDATE:Y}</strong>
        </div>[TITLE]
        <h2>{TITLE}</h2>[/TITLE][PLACE]
        <p class="place">location: {PLACE}</p>[/PLACE][TEXT]
        <div class="teaser">
                {TEXT}
        </div>[/TEXT]
        [TEXTLONG]
        <div class="textlong">
                {TEXTLONG}
        </div>[/TEXTLONG]
</div>


Displaying pictures from file center:

http://forum.phpwcms.org/viewtopic.php?p=107230#p107230

→ phpwcmsCalendar.class.php line 105 downwards (/template/inc_script/)
$items[$key] = $this->template;
$items[$key] = render_cnt_template($items[$key], 'HREF', $href);
$items[$key] = render_cnt_template($items[$key], 'TITLE', html_specialchars($date['calendar_title']));
$items[$key] = render_cnt_template($items[$key], 'TEXT', plaintext_htmlencode($date['calendar_teaser']));
$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']);


→ insert

phpwcmsCalendar.class.php

 
            // + KH: 10.09.2010
            /**
            * Get Image ID from DB String
            */
            $image_temp = explode(":", $date['calendar_object']);
            $image_temp = explode(";", $image_temp[9]);
            $image_id_temp = $image_temp[0];
 
            /**
            * Get Image from DB table 'phpwcms_file'
            */
            $sql_hash = _dbQuery('SELECT * FROM '.DB_PREPEND.'phpwcms_file WHERE f_id = '.$image_id_temp.' AND f_trash = 0');
 
            //dumpVar($sql_hash[0][f_hash]);
            if ($sql_hash[0][f_hash]) {
                $image_calendar_name = PHPWCMS_FILES.$sql_hash[0][f_hash].'.'.$sql_hash[0][f_ext];
 
                list($ic_width, $ic_height, $ic_type, $ic_attr) = getimagesize($image_calendar_name);
 
//                $image_calendar = '<img src="'.$image_calendar_name.'" width="'.$ic_width.'" height="'.$ic_height.'" alt="" />';
                $image_calendar = '<img src="img/cmsimage.php/'.$ic_width.'x'.$ic_height.'/'.$image_id_temp.'.'.$sql_hash[0][f_ext].'" alt="" />';
 
            }
            else
                $image_calendar_name = '';
 
            $items[$key] = render_cnt_template($items[$key], 'IMAGE_CALENDAR', $image_calendar);
            // + KH: 10.09.2010  ENDE
Explanation:

The first step will determine the ID of the picture filed under calendar_object of the database.
Afterwards the picture name (hash) is calculated. Replacing the place holder IMAGE_CALENDAR with the appropriate image tag will be the last step then.

Restrictions:

No real picture size scaling - because no picture preview size can be set within calendar backend the picture output is corresponding to the originally uploaded size. At this time you'll have to process the needed picture sizes before uploading the pictures.

No image caption (ALT - TAG) - captions aren't rendered up to now, the ALT-TAG will be empty.

No enlargement / Lightbox - because no preview image is processed for the backend no lightbox link is shown (useless at this time).

Okay, I hope this is working for you. I've tested it under 1.3.9 R240.


Example template with TEXTLONG and IMAGE_CALENDAR:

Template

<div class="calendar">
        <div class="date">
                <strong>{STARTDATE:d.m.}</strong><strong class="year">{STARTDATE:Y}</strong>
        </div>[TITLE]
        <h2>{TITLE}</h2>[/TITLE][PLACE]
        <p class="place">Loction: {PLACE}</p>[/PLACE][TEXT]
        <div class="teaser">
                {TEXT}
        </div>[/TEXT]
        [TEXTLONG]
        <div class="textlong">
                {TEXTLONG}
        </div>[/TEXTLONG][IMAGE_CALENDAR]
                <div class="image_teaser">
                {IMAGE_CALENDAR}
        </div>[/IMAGE_CALENDAR]
</div>


The way of fetching images

http://forum.phpwcms.org/viewtopic.php?p=107258#p107258

Sorry, but this way of fetching images isn't recommended!
The system is providing a universal method to obtain each picture of the needed size(output format.

including images via cmsimage.php

Image Tags

Alternatively you can include pictures into the document by using the img.

Have a look at this TAG: imgx

english/modules/calendar/enhanced-old.txt · Last modified: 2018/06/03 18:09 (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