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


Common Notices

Syntax.


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', '');                     
require_once(CALENDAR_DIR.'inc/connection.inc.php');
require_once(CALENDAR_DIR.'calendar.class.php');        

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'
$objCalendar->SetPostBackMethod('post');

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

## *** show debug info - false|true
$objCalendar->Debug(false);

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')
$objCalendar->SaveHttpRequestVars($http_request_vars);

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
$objCalendar->DeleteCache();

Languages

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  (nl) - Netherlands
$objCalendar->SetInterfaceLang('en');

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'
$objCalendar->SetWeekDayNameLength('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)
$objCalendar->SetWeekStartedDay('1');

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
$objCalendar->SetDisabledDays(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
$objCalendar->ShowWeekNumberOfYear(true);

Step 3. vents & Categories Settings.


Events Actions & Operations

Allow multiple occurrences for events in the same time slot

## *** false|true - default
$objCalendar->SetEventsMultipleOccurrences(true);

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

##  *** allow editing events in the past
$objCalendar->EditingEventsInPast(false);

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

##  *** allow deleting of events in the past
$objCalendar->DeletingEventsInPast(false);

Block deleting events before certain period of time

##  *** in hours
$objCalendar->BlockEventsDeletingBefore(24);

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

##  *** set (allow) calendar events operations
$events_operations = array(
    'add'=>true,
    'edit'=>true,
    'details'=>true,
    'delete'=>true,
    'delete_by_range'=>true,
    'manage'=>true,
);

$objCalendar->SetEventsOperations($events_operations);

Categories Actions & Operations

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

##  *** set (allow) calendar categories operations
$cat_operations = array(
    'add'=>true, 
    'edit'=>true,
    'details'=>true,
    'delete'=>true,
    'manage'=>true,
    'allow_colors'=>true
);

$objCalendar->SetCategoriesOperations($cat_operations);

Step 4. Users Settings.


Users Settings

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

## *** set user ID (the value must be numeric)
$user_id = 0;
$objCalendar->SetUserID($user_id);

This method allows creating and assigning users to events

## *** set (allow) calendar users operations
$objCalendar->AllowUsers(true);

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

##  *** set (allow) calendar categories operations
$users_operations = array(
    'add'=>true,
    'edit'=>true,
    'details'=>true,
    'delete'=>true,
    'manage'=>true,
    'assign_to_events'=>true
);

$objCalendar->SetUsersOperations($users_operations);

Step 5. Time Settings and Formatting.


TimeZone Settings

Set timezone for your calendar. Full list of supported Timezones can be found here: http://us3.php.net/manual/en/timezones.php)

## *** set timezone
$objCalendar->SetTimeZone('America/Los_Angeles');

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
$objCalendar->SetTimeFormat('24');

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: 15 min., 30 min., 45 min., 60 min. or 120 min (60 min - default)

## *** define time slot - 15|30|45|60 minutes
SetTimeSlot('60');

You may define showing of time for some views

## *** set showing times in Daily, Weekly and List views
$objCalendar->ShowTime('true');

Step 6. Visual Settings.


Calendar Views

## *** set (allow) calendar Views
$views = array(
    'daily'=>true,
    'weekly'=>true,
    'monthly'=>true,
    'monthly_double'=>true,
    'yearly'=>true,
    'list_view'=>true
);
$objCalendar->SetCalendarViews($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'
$objCalendar->SetDefaultView('monthly');

You may define links for small monthly view

## *** Set action link for monthly small view - file2.php or ../file3.php etc.
$objCalendar->SetMonthlySmallLinks('');

Calendar Actions

## *** set (allow) calendar Views
## *** default exporting folder: tmp/export/
$calendar_actions = array(
    'statistics'=>true,
    'exporting'=>true,
    'printing'=>true
);
$objCalendar->SetCalendarActions($calendar_actions);

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

## *** set CSS style: 'green'|'brown'|'blue' - default
$objCalendar->SetCssStyle('blue');

Using of WYSIWYG editor.

## *** specify using of WYSIWYG editor
$objCalendar->AllowWYSIWYG(true);

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'
$objCalendar->SetEventsDisplayType($events_display_type);

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

## *** set Sunday color - true|false
$objCalendar->SetSundayColor(true);

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
$objCalendar->Show();        



Non Documented

Properties.


[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 user data with session variables or cookie ('session' or 'cookie').

private $userDataSaveType = 'session';        

[Private] Specifies whether to allow using of stored procedures (must be installed before). This property was deprecated starting with v3.5.0.

private $useStoredProcedures = false;        

[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 whether to allow using of location feature for events (true or false - default).

private $allowLocations = 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.