Getting Started with ApPHP Calendar (for version 3.0.0 or above)

Common Notices


We use

## for comments
// for lines, that must be uncommented
/// for lines, that may be uncommented (optional)

Common notes.

Please, use a $debug_mode = true; before you say "Why Nothing Works ?!"

Starting with version 2.0.0 only PHP5 is supported!

Do not put ApPHP Calendar code into another HTML Form: <form>...</form>

Getting Started

(for version 2.0.0 or above)

Step 1. Creating & Calling.

Define a relative (virtual) path to ApPHP Calendar folder.
For example: '', 'calendar/' or '../calendar/'

// include calendar class and other files
// Ex.: '', 'calendar/' or '../calendar/'
define('CALENDAR_DIR', '');                     

Now we can create new instance of Calendar object

## *** create calendar object
## *** 2 optional parameters: $calendar_type ('small' or 'normal') and $prefix
## *** Ex.: Calendar('normal', 'abc_');
$objCalendar = new Calendar();        

Step 2. General Settings.

Submission Settings & Debug Mode

In this section you have to define a method for data submission type (PostBack type). You may write 'get' or 'post' (recommended).

## *** set PostBack method: 'get' or 'post'

This method defines whether to run Calendar in Debug Mode or not.

## *** show debug info - false|true

Passing Parameters

To save http request parameters between calls of calendar (for ex.: index?page=products&cat=events etc.) you have to pass them as array into SaveHttpRequestVars() method and Calendar will store them.

$http_request_vars = array('param1', 'param2')

Cache Settings

Cache gives possibility to improve work of the script and reduce execution time

## *** define caching parameters:
## *** 1st - allow caching or not, 2nd - caching lifetime in minutes
## *** default cache folder: tmp/cache/
$objCalendar->SetCachingParameters(false, 15);

If you want to delete all cache, you may do it by calling following method:

## *** delete all pages in cache


ApPHP Calendar is Multy-Language control, so you can easy switch interface language of your calendar.

## *** set interface language (default - English)
## *** (en) - English  (es) - Spanish     (de) - German  (fr) - French  
## *** (it) - Italian  (pt) - Portuguese  (he) - Hebrew  (nl) - Netherlands

Week Settings

This group of methods related to the weeks settings of calendar

You may define whether to use long or short names of week day name.

## *** set week day name length - 'short' or 'long'

Next method defines first day of week: from Sunday (default) to Saturday.

## *** set a start day of the week: from 1 (Sunday) to 7 (Saturday)

If you want to disable certain day of week - uncomment this section and pass into SetDisabledDay() method a number of such week day (or some days).

## *** disable certain days of the week: from 1 (Sunday) to 7 (Saturday). 
Ex.: 1,2 or 7

Show a week number of year: display on not week number at the left side of calendar in Yearly and Monthly View

## *** define showing a week number of year

Step 3. Events & Categories Settings.

Events Actions & Operations

Allow multiple occurrences for events in the same time slot

## *** false|true - default

This method defines whether editing of events in the Past is allowed or not.

## *** allow editing events in the past

This method defines whether deleting of events in the Past is allowed or not.

## *** allow deleting of events in the past

Block deleting events before certain period of time

## *** in hours

You may allow carrying out events operations: adding, editing or deleting of existing etc.

## *** set (allow) calendar events operations

Categories Actions & Operations

You may allow operations with categories: adding new category, editing or deleting existing category etc.

## *** set (allow) using categories
## *** allow only defined categories by ID (parameter must be a numeric value)
## *** set (allow) calendar categories operations

Locations Actions & Operations

You may allow operations with locations: adding new location, editing or deleting existing location etc.

## *** set (allow) using locations
## *** set (allow) calendar locations operations

Step 4. Participants Settings.

Participants Settings

This method allows participant to work with his own events. Calendar will show only events for certain participants

## *** set participant ID (the value must be numeric)
$participant_id = 0;

This method allows creating and assigning participants to events

## *** set (allow) calendar participants operations

You may allow operations with participants: add, edit, delete etc.

## *** set (allow) calendar categories operations

Step 5. Time Settings and Formatting.

TimeZone Settings

Set timezone for your calendar. Full list of supported Timezones can be found here:

## *** set timezone

This method returns timezone, defined in Calendar

## *** get current timezone
echo $objCalendar->GetCurrentTimeZone();

Time Format & Settings

ApPHP Calendar gives you possibility to display time in different formats: 24 hours or AP/PM.

## *** define time format - 24|AM/PM

You may define certain timeframe by using SetAllowedHours() method.

## *** define allowed hours frame (from, to). Possible values: 0...24
$objCalendar->SetAllowedHours(0, 24);

This method defines a size of time slot. Possible values: 10 min., 15 min., 30 min., 45 min., 60 min. or 120 min (60 min - default)

## *** define time slot - 10|15|30|45|60 minutes

You may define showing of time for some views

## *** set showing times in Daily, Weekly and List views

Step 6. Visual Settings.

Calendar Views

## *** set (allow) calendar Views

Set default calendar view. Possible values: 'daily', 'weekly', 'monthly', 'yearly' or 'list_view'; 'monthly' is default.

## *** set default calendar view 
## *** 'daily'|'weekly'|'monthly'|'yearly'|'list_view'
## *** 'monthly_small'|'monthly_double'

You may define links for small monthly view

## *** Set action link for monthly small view - file2.php or ../file3.php etc.

Calendar Actions

## *** set (allow) calendar Views
## *** default exporting folder: tmp/export/
## *** set (allow) calendar export types

Calendar supports embedded CSS styles: 'green', 'brown', 'blue' or your own style. Select appropriate style to suit your needs.

## *** set CSS style: 'green'|'brown'|'blue' - default

Using of WYSIWYG editor.

## *** specify using of WYSIWYG editor

Calendar width and height.

## *** set calendar width and height
$objCalendar->SetCalendarDimensions('800px', '500px');

Define view type of events for Monthly, Weekly and Daily views. The 'inline' means show all events in calendar cell, 'tooltip' means show them in tooltip.

## *** set type of displaying for events
## *** possible values for daily   - 'inline'|'block'
## *** possible values for weekly  - 'inline'|'tooltip'
## *** possible values for monthly - 'inline'|'list'|'tooltip'

If you want to set special color for Sunday, you can do it with following method.

## *** set Sunday color - true|false

This method allows to display text for calendar caption.

## *** set calendar caption
$objCalendar->SetCaption('ApPHP Calendar v'.Calendar::Version());

Step 7. Drawing Calendar.

Now you can draw calendar on the screen.

## *** drawing calendar

Non Documented


[Private] Disable hours before selected time in dropdown box in Add New Event popup.

private $disableEarlierHours = 'false';

[Private] Defines whether to hide (not display) empty slots in Weekly View or not.

private $hideWeekEmptySlots = false;

[Private] Defines whether to allow working with event parts (slots).

private $isEventPartsAllowed = false;

[Private] Defines how to save data with session variables or cookie ('session' or 'cookie').

private $dataSaveType = 'session';

[Private] Used to separate events for GROUP_CONCAT() function in SELECT SQL.

private $separator = '$$';

[Private] Defines a view type of Views Changer ('dropdownlist' or 'tabs').

private $viewChangerType = 'dropdownlist';

[Private] Specifies whether to allow automatically created anchor to the top of calendar (true or false - default).

private $isAnchorAllowed = false;

[Private] Specifies calendar layout direction ('rtl' or 'ltr' - default).

private $direction = 'ltr';

[Private] Used to define calendar date format ('yyyy/mm/dd', 'dd/mm/yyyy' or 'mm/dd/yyyy'(default)).

private $dateFormat = 'dd/mm/yyyy';

[Private] Used to force deletion of category events when category is removing (true or false - default).

private $removeCategoryEvents = false;

[Private] Specifies target for event links: _new, _blank, _parent, _self etc.

private $eventsLinkTarget = '';

[Private] Specifies whether to allow creating events with the same name.

private $allowEventsWithSameName = false;

[Private] Used to highlight selected day.

private $highlightSelectedDay = false;

[Private] Used to show/hide empty time slots.

private $showEmptyTimeSlots = false;

[Private] Used to allow color for Saturday.

private $saturdayColor = false;
Create Your Free Account
Please remember that this information is essential to use our services correctly.
After creating the account you will be able to download all of our FREE products.
Fields marked with * are mandatory

Please send me information about updates, new products, specials and discounts from ApPHP!
We recommend that your password should be at least 6 characters long and should be different from your username/email. Please use only letters of the English alphabet to enter your name.

Your e-mail address must be valid. We use e-mail for communication purposes (order notifications, etc). Therefore, it is essential to provide a valid e-mail address to be able to use our services correctly.

All your private data is confidential. We will never sell, exchange or market it in any way. Please refer to Privacy Policy.

By clicking "Create Account", you are indicating that you have read and agree to the ApPHP Terms & Conditions.