Originally developed by Michael Svarrer in 2005, modified by Tory and Bob, revised and enlarged by Svasti and Holger and again by Svasti
Calendar produces calendars with marked event days, which are linked to an event list.
New in Version 1.4.3: Up to version 1.4.2 for saving the complete event list was send to the server. Unfortunately some users reported data loss in long lists. In version 1.4.3 now only the one actually changed event is sent to the server to prevent data loss. Don't edit more than one event before saving, as only one event can be saved at a time. Version 1.4.4 & 1.4.5: Bug fixes
Exchange: admin.php, additionally version.nfo, changelog.txt, the help folder, readme.txt
1.4.0 –> 1.4.5
Exchange: admin.php, index.php, the editorconfigs, includes and language folders, additionally version.nfo, changelog.txt, the help folder, readme.txt
1.4 beta –> 1.4.5
Save old settings through Presets>backup for both Event-list and also Calendar.
Keep calendar/content folder + calendar/templates/ folder, and calendar/config/config.php in case you have changed config settings. Replace all other files.
Activate your old presets by choosing Presets>backupname for both event-list and calendar. If you have kept your old config file, you need to add the line: $plugin_cf['calendar']['eventlist_start_moves_with_clicked_event']="1";
1.1 –> 1.4.5
Re-use old content files
Old function calls usually still work (except calls which include the event page; the way to enter the event page has been changed).
The method of entering links and birthdays has changed.
Extract zip-file and put the calendar folder into your CMSimple plugins folder. Websites on shared hosting servers may require writing permissions (646 usually works) for config.php, config2.php, stylesheet.php, templates and content folders with all files, and language file.
You can change some paths (but don't have to!):
You may want to put your calendar event data in a subfolder under userfiles. In config > filepath data enter ./userfiles/calendar/ and move all content files to that folder.
You may want to put the calendar background images in a subfolder under images. In config > filepath calendar background images enter ../../../images/calendar/ and move the provided backgrounds to that folder.
Choose your Date Delimiter before you start entering events. Enter in config if you want "." or "-" or "/" to deliminate the numerals in dates, i.e. 01.01.2011 or 01-01-2011 or 01/01/2011. If you change this setting later, exceptions, additional days and provisional dates will be erased and your event list will not show anything. After saving the event file, the event list will work again, however the above mentioned date entries will be lost. American style date month/day/year is not possible, only day/month/year is supported.
If you have selected this page in the event-list config, clicking on any event-day in the calendar will lead to this page. The page should contain the function call {{{PLUGIN:events();}}} to show the event-list. If you don't want an event-list, select no event-list page in event-list config.
The time period for events to be shown in the event list is set in event-list config. Present month is minimum. Past events can also be shown, either normal or in gray. You can choose that no past events, not even from the present month, will be shown. If past events in gray is selected, the "additional descriptions" of past event will also not be shown (this is a setting of the css-file and could easily be changed).
Clicking on an event-day which is not in the present month, may have some effect to the period of shown events in the list:
In default setting the event-list displays the standard period of events, which will be enlarged to the future or past if the clicked event is outside the standard period
Entering "1" in the config field eventlist start moves with clicked event makes the shown period shift to the month of the clicked event instead of getting enlarged. The advantage is that the clicked event is usually at the beginning of the list. A link to reset the event list is added at the beginning. (As the list may also shift to the past, settings "show no past events" and "past events in gray" are overridden in the shifted list.)
The event-list page can also directly be entered in the plugin language settings under event page. You can enter just the name of the event page or the relative URL-address starting with "?" or the relative URL-address of a page of a subsite starting with "./".
The event list shows your events in chronological order, either in spreadsheet table style or in template driven style. Spreadsheet table style is preset. Effect of templates can be tested in Event List.
If you enter in Plugin Config under eventlist template the name of the template file, this template will be used as standard in your event-list.
Templates can be edited via Backup > Presets. They are written in HTML with placeholders between %…% in place of variables. The templates contain 12 output cases, separated by "===". If cases are empty, there will be no output for that case.
All variables are simple unstyled texts, except %description%, which is fully formatted html-text (by the editor). So don't use <p>%description%</p>, but rather <div>%description%</div>.
The desired template of an event list can also directly be set in the event list function call, making differently styled event lists on the same site possible: {{{PLUGIN:events('','','','','','','Name of the template file');}}}
(Template file name = 7th place in the function call. If you put 1 instead of a file name the spreadsheet table style is used, without value the standard as set in config is used.)
Set holidays via the Holiday menu. Holidays are saved in the language file. Each holiday entry consist of date description and holiday-name. You can enter fixed holidays as day.month, movable holidays depending on the Easter date as easter +/- x day (x = number of days before or after Easter) and movable holidays occuring on a fixed weekday following or preceding a fixed date as n days m Weekday day.month, meaning n days before or after the mth weekday before or after the fixed date. Weekday names must be entered in English, the words "day" or "days" work both, negative numbers mean "before".
Marquee is run either by the jQuery plugin or uses the Microsoft marquee function and does not validate.
To display next coming event inside a page enter: {{{PLUGIN:nextevent();}}}
To display next coming event via the template use: <?php echo nextevent();?>.
If you want the marquee in the template to be activated on certain pages only, use: <?php echo calendar(); if ($nextevent) echo nextevent(); ?>. The marquee will be shown under the calendar. To activate the marquee, write into the page #CMSimple $nextevent="show";#.
Often it is practical to have the event list more space than for usual text. You may use for this page a special template. The backend has the possibility to select different templates just for backend testing.
Available icons for links and "info" are shown on mouse over in front of the icon setting options. You can add your own icons (gif or png) and put them in a new folder under plugins>calendar>images>. The icon sets go in pairs; the set for past events is in another folder with the same name and "past" added. Added sets will automatically be listed in the setting options.
Background images for big month calendar are jpg-images in the folder given in config > filepath calendar background images, which in the delivery state of the plugin is ../backgroundimages. All jpg-images of that folder are selectable in the option list for calendar background images.
The same folder also contains the gif-symbols used for marking birthdays in small calendars. You can freely add your own symbols. All gif-images of that folder are selectable in the small calendar birthday option list.
In Backup you can copy your event list under a new name, e.g. the name "archive". If you delete afterwards in your normal event file some event entries, they will still be there in your "archive". You can add to this archived list from time to time your standard list with the merge function (which has automatic duplicate avoidance), thus building up a list of past events.
This archived list can be shown on a page with the function call: {{{PLUGIN:events('starting month','starting year','duration in months','0','name of archive file','','',1);}}}
(The last "1" prevents that past events will be shown in gray).
You can use two independent calendars! To activate a second calendar enter a name as filename (i.e. "extracalendar") for the events of this second calendar in config under second-calendar filename (no spaces, only english letters). If the file doesn't exist, the plugin will create it. This second calendar can have its own event page. Enter the pagename where you put this list under second-calendar_eventpage. (Either just the pagename or starting with ?
If you have thus activated a second Calendar, the backend menu gets enlarged (after clicking on a menu item) with new items for editing and viewing this second calendar, and the following additional function calls will become available:
Function Call
Result
Used for
editevents2()
event input table for second calendar
password protected pages
calendar2()
one month small second calendar
template
calendar12()
one month small combined calendar of standard and second calendar
"
multicalendar2()
2 or more months second calendar
template + pages
multicalendar12()
2 or more months combined calendar of standard and second calendar
"
year2()
year view of second calendar
pages
year12()
year view of combined calendar of standard and second calendar
"
bigcalendar2()
big one month of second calendar
pages
bigcalendar12()
big one month of combined calendar of standard and second calendar
"
events2()
list of events of second calendar
pages
events12()
list of events of combined calendar of standard and second calendar
"
nextevent12()
marquee of next coming events based on the standard and second calendar
template
In these function calls the same variables (mostly) can be added as in the standard function calls (e.g. {{{PLUGIN:multicalendar2(3,4);}}} etc.)
All calendars based on the second calendar will link to the second event-page set in plugin config.
All combined calendars however will link to the standard event-page set in event-list config. When using a combined calendar it is recommanded to use a combined event-list on the standard event-list page.
More complex setups are possible, e.g. two different calendars with separate event-lists plus a combined calendar with combined event-list. However to force the calendar to link to a different list than the standard list, you have to take advantage of the full function call. Calls like calendar12() are only shortcuts based on the full calls.
You may want to offer selected visitors to your site the possibility to enter events. Just put {{{PLUGIN:editevents();}}} on the page. For security reasons the filebrowser is disabled so that visitors are prevented from deleting or uploading files.
If you want only a special event file to be edited by visitors, use the function call: {{{PLUGIN:editevents('extraevents');}}}
If you want your secondary calendar to be edited by visitors, the function call would be: {{{PLUGIN:editevents2();}}}
A different calendar for each language or subsite is the standard setting. If you want to have the same calendar for different languages or subsites, you can enable same-event-calendar_for_all_subsites.
With this setting calendar will not use language-related event files, e.g. eventcalendar_en.txt, but create new eventfiles without a language suffix, namely eventcalendar.txt. (You can change file names in Backup menu.)
As relative links have different paths from subsites than from the main site, you should enter images in this case only from your main site. Calendar adjusts the image path when viewed from a subsite, but not otherwise. If images are entered from the subsite, they will not show on the main site.
Internal Links only work, when entered from the main site, and they can only direct to pages of the main site.
If you want to use calendar2 with links to an event list in subsites, create an event list page with the same name as the secondary event list page in the main page.
Other Plugins may lay their pop-ups on top of calendar's pop-ups. This can be prevented by giving calendar a higher z-index value in config. You have to experiment to find a fitting value. There seems to be no upper limit to z-index, so you may start with 10 and if this doesn't give the wanted result, try 100, 1000, 10000.
If you don't need it, don't use z-index.
There can be a small problem with year or months in columns and using z-index. In the case of pop-ups, which extend to the right above the next month to the right, the event days of that month shine through the pop-up. This happens because the following month is created later and if z-index is used this month is strangely automatically regarded as being on top of the preceding month. By programming one could give a lower z-index to that month on the right, but then a similar problem would occur with pop-ups to the left, because then the month to the left will have a higher z-index, which makes its event days shine through. The easy solution is to set in config > calendar popup class to left so that pop-ups always open to the left side.
[ ] means some entry specified in the brackets. The square brackets are not to be entered.
Template calls: <?php echo [function call];?>
Old method to call a function inside a page: #CMSimple $output.=[function call];#
New method to call a function inside a page: {{{PLUGIN:[function call];}}}
editevents(["filename"])
creates the event editing table
(without filename => standard event file is taken)
editevents2() the same for the 2nd calendar.
calendar ([year],[month],["special_eventpage"],["size"].[number],[columns],
["file"],["additional_file"],[use_eventpage_of_calendar2])
creates the calendar
without year/month => present year/month is used
without special eventpage => eventpage as set in language file is used
The "special eventpage" can be entered as
simple pagename (must not occur more than once!) exactly as the pagename is, e.g.: Dětské letní tábory 2012
urlencoded pagename with all pagenames of superior level separated by your URI-separator (set in CMS-config), preceeded by "?", with all spaces replace by "_", e.g.: ?Start:Latest_News:Hot or ?Anfang:Neu_hier%3F
using urlencoded pagenames you can even link to a page on a subsite. Than start with ./ followed by the subsite abbreviation, e.g.: ./de/?Willkomen:Neu_hier%3F:Weiter
size can be set to "big" and creates a big calendar
number gives the number of months to be displayed, preset to 1
columns give the number of columns to display
file name of the eventfile which you want to show in the calendar, if not set, the standard file will be used
additional file name of an additional event file to be used
use eventpage of calendar2, value 1 or 0, this setting is used for the second calendar
calendar2 ([year],[month],["special_eventpage"],["size"].[number],[columns])
The same for the 2nd calendar.
calendar12 ([year],[month],["special_eventpage"],["size"].[number],[columns])
The same for the combination of standard and 2nd calendar.
multicalendar([number],[columns],["file"],["additional_file"])
creates calendars with several months.
This is a shortcut function to avoid complicated entries in calendar()
function multicalendar2([number],[columns])
The same for the 2nd calendar.
function multicalendar12([number],[columns])
The same for the combination of standard and 2nd calendar.
year([year],[columns],["file"],["special_eventpage"])
Another shortcut to avoid complicated entries in calendar()
In year you can enter the year which you want to show. Left empty the present year is shown.
columns left empty will produce a 3 column layout.
file takes the name of the eventfile which you want to show in the calendar, if empty, the standard eventfile will be used.
special eventpage is useful, if you want a different eventpage from the standard event page.
year2([year],[columns])
The same for the 2nd calendar.
year12([year],[columns])
The same for the combination of standard and 2nd calendar.
bigcalendar()
creates a big monthly calendar useful for a whole page
Also a short cut for complicated entries in calendar()
bigcalendar2()
The same for the 2nd calendar.
bigcalendar12()
The same for the combination of standard and 2nd calendar.
events([month],[year],[future_months],[past_months],["filename"],["additional_file"],[style],[past_events])
creates the event list
without month/year => present month/year used
without future/past month => setting taken from event-list config
without filename => standard event file is used
additional file name of an additional event file to be used
style takes 3 settings:
empty or 0 -> style as set in config,
1 -> spreadsheet table style,
filename -> template driven style with this file
past events decides how to handle past events:
empty or
0 -> standard treatment of past events as set in event-list config,
1 -> past events are neither marked nor shown in gray,
2 -> past events are shown in gray,
3 -> no past events are shown
events2([month],[year],[future_months],[past_months])
The same for the 2nd calendar.
events12([month],[year],[future_months],[past_months])
The same for the combination of standard and 2nd calendar.
nextevent([number],["file"],["additional_file"])
creates marquee of next coming event
([number] = number of events to be announced,
without number, number is taken from config) file –> name of the eventfile which you want to use as source, if not set, the standard event-file will be used additional file –> name of an additional event file to be used as source
nextevent12()
creates marquee of next coming event(s) based on the combination of standard and 2nd calendar