Calendar

Installation

Part of the program to enable the calendar in the FE: 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_en.html
 *    lang=en
 *    tag=tag1, tag2
 *    tagmode=OR
 *    date_start=TODAY|01.01.2009
 *     date_end=TODAY|31.12.2010
 *    href=index.php?calendar
 *    WxHxCxQ=150x100x0x80       (since V1.1)
 * }
 *
 * 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]]]]
 *
 * (Please use the first Replacement Tag method)
 *
 **/
 
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']);
 
}
 
?>


Click in backend MODULES → calendar/events and then delete the setup directory if not yet done. Now the appropriate calendar tables are created in the database. (In newer versions of CMS, the “_Setup” directory not be deleted).

Then back on modules → calendar/events and put in a new entry. Except for the “Description”and “image” please fill out everything and make a test.
In the original version “Description”and “image” does not work yet as implemented → See Advanced Wysiwyg-Text & image (V1.2) / Advanced Wysiwyg-Text & image (V1.3).
Then create a new article with CP → Simple Text.

The RT currently (since V1.42 r348) looks like this:

TAGs of the calendar:

Forum: http://forum.phpwcms.org/viewtopic.php?p=106796#p106796

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

WxHxCxQ until Advanced Wysiwyg-Text & image (V1.2) / Advanced Wysiwyg-Text & image (V1.3).

Put in tag1, tag2, etc. is in the events calendar at “calendar:”, comma separated.
With these TAGs e.g. “tag1” you can filter the output for different groups.
Tagmode: At the moment only OR possible.

The template can be found in /template/calendar/


The integration in the /frontend_render/ has changed since v1.3.9, as the PHP class has been pushed to another place.

From
- template/inc_script/calendar.class.php
to
- include/inc_module/mod_calendar/inc/calendar.class.php

This determination is done in the file template/inc_script/frontend_render/init_calendar.php (see above).


If the calendar is called for example with the values ​​shown above, the filter should match, if anything is to be displayed. (This call principle replaces a CP, which would deliver this assumption).

E.g. In the period the language “en” is specified, it must also be specified in the TAG (lang =en).

If no language is specified in the Schedule, in the tag may also be entered no language, nothing else is shipped. Because “de” is not included in the empty set from the date - so no output is generated.

The same goes for the “tag” in the call, the date corresponds to the field “calendar:”.

At first I would like this call

lang=
tag=
  • The template file must be exist in the directory template/calendar/, otherwise no output is generated (template=MyCalendarTemplate.htm).
  • Number of issues must be greater than 0 (items=100).
  • At this time the tagmode is inactive, it is always “OR” (tagmode=OR).
  • Ab welchem Termindatum sollen Einträge ausgeliefert werden (date_start=01.01.2009 or date_start=TODAY).
  • Up to which date are entries to be delivered? (date_end=31.12.2010 or date_end=TODAY).
  • The remuneration of the fields in the date entry to the tags in the Template see graphic above.


CSS:

File: template/inc_css/specific/calendar.css

calendar.css

/* Calendar V1.1/2 */
.calendar {
    padding: 10px 0 5px 0;
    margin: 0;
    clear: left;
    margin: 0;
    border-top: 1px solid #888;
    width: 600px;
    margin-bottom:10px;
}
 
.calendar div.left {
    float:left;
    position: relativ;
    text-align: left;
    line-height: 100%;
    width: 150px;
    margin: 0;
    padding: 0 0 10px 0;
    font-size: 1.0em;
}
 
.calendar div.left .date {
    position: relativ;
    background-color: lightgrey;
    text-align: left;
    line-height: 100%;
    width: 150px;
    height: 60px;
    margin: 0;
    padding: 5px 0 10px 0;
    font-size: 1.0em;
}
 
 
 
.calendar div.detail {
    position: relativ;
    background-color: transparent;
    width: auto;
    line-height: 100%;
/*    float: left; */
    margin: 0 0 0 170px;
    padding: 0 0 10px 20px;
    font-size: 0.9em;
    border-left: 1px solid #ccc;
}
 
 
.calendar div.detail .image {
    float: left;
    margin: 0;
    padding:0;
    position: relativ;
}
 
.calendar div.detail .teaser {
    line-height: 140%;
    margin: 0 0 0 160px;
    padding: 0;
}
 
 
 
.calendar div.date p {
    width: 135px;
    text-align: left;
    margin: 5px 0 0 5px;
}
 
 
.calendar div.date strong {
    letter-spacing: .06em;
}
 
 
.calendar div.date div.day,
.calendar div.date div.day-short_month {
    float: none;
    padding: 0 0 10px 0;
    font-weight: bold;
    letter-spacing: .1em;
    line-height: 108%;
    font-size: 30px;
    color: #888;
}
.calendar div.date div.day-short_month {
    letter-spacing: .01em;
}
 
.calendar div.date div.day-word {
    float: none;
    padding: 0 0 4px 0;
    margin: 0;
    font-weight: bold;
    letter-spacing: .1.5em;
    line-height: 108%;
}
.calendar div.date div.day-month-year {
    float: none;
    padding: 0;
    font-weight: normal;
    letter-spacing: .05em;
    line-height: 100%;
}
.calendar div.date div.year {
    float: none;
    width: auto;
    padding: 0;
    font-weight: normal;
    letter-spacing: .1em;
    line-height: 108%;
}
 
.calendar div.detail h2 {
/*    padding: 1px 0 2px 120px; */
    margin: 0;
    padding: 0 0 10px 0;
    font-size: 1.5em;
    font-family: "HelveticaNeue Condensed", "Arial Narrow", "Helvetica Condensed", Arial, Helvetica, sans-serif;
    font-weight: bold;
    line-height: 100%;
    color: #666;
}
.calendar div.detail p {
    padding: 0 0 0 0;
    margin: 0;
    font-size: 1.0em;
}
.calendar div.detail p.place {
    font-weight: normal;
    color: #666;
    padding-bottom: 3px;
}
 
.calendar div.detail .textshort {
    font-weight: normal;
    color: #666;
    padding-bottom: 3px;
    font-size: 1.0em;
}
.calendar div.detail .other {
    font-weight: normal;
    color: #666;
    padding-bottom: 3px;
    font-size: 0.9em;
}
.calendar div.detail .textlong {
    font-weight: normal;
    color: #666;
    padding-bottom: 3px;
    font-size: 1.0em;
}
 
.calendar div.detail a {
    text-decoration: none;
}
.calendar div.detail h2 a {
    color: #7C8084;
}
.calendar div.detail a:hover {
    color: #000000;
    text-decoration: underline;
}

(Since V1.42 r348 the entries URL and TARGET are added ).


Example template

File: template/calendar/TemplateFile.html

template/calendar/TemplateDatei.html

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


Date formatting:

Parameters see: Formats a specified time / date

Z.B.

{STARTDATE:l lang=en} the {STARTDATE:d.m.Y}

Output: Saturday the 22.01.2011


english/modules/calendar.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