|
|
 |
LXXIV. MCAL functions
MCAL stands for Modular Calendar Access Library.
Libmcal is a C library for accessing calendars. It's written to be
very modular, with plugable drivers. MCAL is the calendar
equivalent of the IMAP module for mailboxes.
With mcal support, a calendar stream can be opened much like the
mailbox stream with the IMAP support. Calendars can be local file
stores, remote ICAP servers, or other formats that are supported
by the mcal library.
Calendar events can be pulled up, queried, and stored. There is
also support for calendar triggers (alarms) and reoccuring events.
With libmcal, central calendar servers can be accessed and used,
removing the need for any specific database or local file
programming.
To get these functions to work, you have to compile PHP with
--with-mcal. That requires the
mcal library to be installed. Grab the latest version from http://mcal.chek.com/ and
compile and install it.
The following constants are defined when using the MCAL module:
MCAL_SUNDAY,
MCAL_MONDAY,
MCAL_TUESDAY,
MCAL_WEDNESDAY,
MCAL_THURSDAY,
MCAL_FRIDAY,
MCAL_SATURDAY,
MCAL_RECUR_NONE,
MCAL_RECUR_DAILY,
MCAL_RECUR_WEEKLY,
MCAL_RECUR_MONTHLY_MDAY,
MCAL_RECUR_MONTHLY_WDAY,
MCAL_RECUR_YEARLY,
MCAL_JANUARY,
MCAL_FEBRUARY,
MCAL_MARCH,
MCAL_APRIL,
MCAL_MAY,
MCAL_JUNE,
MCAL_JULY,
MCAL_AUGUGT,
MCAL_SEPTEMBER,
MCAL_OCTOBER,
MCAL_NOVEMBER, and
MCAL_DECEMBER.
Most of the functions use an internal event structure that is
unique for each stream. This alleviates the need to pass around
large objects between functions. There are convenience functions
for setting, initializing, and retrieving the event structure
values.
verdy_p at wanadoo dot fr
12-May-2002 11:55
Correction to previous extensive note:
ANDing distinct bit values will always result in zero, so your weekly events won't ever be raised. You must use the bitwise-or operator (|) to combine several week days.
mcal_event_set_recur_weekly takes an additional integer parameter
"weekdays" which is basicly a binary mask created by bitwise
ORing together integers representing the days of the week.
Sunday = 1
Monday = 2
Tuesday = 4
Wednesday = 8
Thursday = 16
Friday = 32
Saturday = 64
So if I wanted the value needed to raise the event every "Monday, Wednesday, and Friday" I would do this:
$weekdays = 2 | 8 | 32;
jeff at univrel dot pr dot uconn dot edu
03-Jul-2001 12:03
As of 7/3/2001, libmcal can be built shared (libmcal.so), which should get rid of the linking problem with the MySQL driver. Check the latest version out of the repository if you're planning on building it this way.
lurker at shadowtech dot org
23-Dec-2000 01:04
After a thorough search of the web for documentation of how recurence works in MCAL, or even for documentation of the recurence function parameters, I found nothing. So, I gave up and dove into the MCAL source code for answers, and this is what I have found. Please keep in mind that this is all "As far as I can tell" information.
First of all, I believe that mcal_list_events DOES return events that recur in the range being searched.
The mcal_event_set_recur_* functions take in an mcal stream, and date for the event to stop recuring by (given by day, month, year), and an "interval".
mcal_event_set_recur_weekly takes an additional integer parameter "weekdays" which is basicly a binary mask created by bitwise ANDing together integers representing the days of the week.
Sunday = 1
Monday = 2
Tuesday = 4
Wednesday = 8
Thursday = 16
Friday = 32
Saturday = 64
So if I wanted the value that represented "Monday, Wednesday, and Friday" I would do this:
$weekdays = 2 & 8 & 32;
Here is how to interpret "interval" and "weekdays".
For mcal_event_set_recur_daily:
This event should recur every "interval" days.
For mcal_event_set_recur_weekly:
This event should recur on every day specified in "weekdays", and should do so every "interval" weeks.
For mcal_event_set_recur_monthly_mday:
This event should recur on the "interval" day of every month.
For mcal_event_set_recur_monthly_wday:
This event should recur every on every Xday of the Yth week of the month, every "interval" months. (Where Xday is a day of the week, e.g. Monday, Tuesday, etc. Note: This is the one I am the least sure about though it seems to be the logical assumption for how it should work based on the fact that there are two monthly functions and the other one's operation is intuitive.)
For mcal_event_set_recur_yearly:
This event should recur every "interval" years.
inan at canada dot com
25-Mar-2000 03:59
MCAL is a great little package, but has changed quite a bit since the documentation has been updated. If you're having trouble stop by mcal.chek.com and pop a question onto the mcal users mailing list and we'll be happy to help you out.
| |
| | Citas célebres | Los padres son las últimas personas del mundo que deberían tener hijos. Samuel Butler Compositor y novelista inglés (1835-1902) | | Citas en tu mail | | ©Contenidos Gratis |
| Chiste de... Relaciones laborales | | Nuevo chófer | El presidente de la compañía entra por la mañana en su limousina y ve que hay un chofer nuevo.
- Hombre, conductor nuevo. Y dígame, ¿cómo se llama?
- Carlos, señor.
- Bueno, verá, es que yo no acostumbro a llamar a mis empleados por el nombre de pila, ¿me podría decir cual es su apellido?
- Esto... me llamo Carlos Cielo Querido.
- Ya... bueno, pues empiece a conducir, Carlos. | | Chistes en tu mail | | ©ContenidosGratis |
| Inicio | Acción | Estrategia | Palabras | Puzzles | Solitarios | Foro Trucos |  | Cake Mania Jugadores: 6835 Categoría del juego: Acción Objetivo del juego: Ayuda a Jill a recuperar la pastelería de su abuela llevando su propia pastelería; consigue clientes y gana dinero. |
|  | Rainbow Web Jugadores: 2199 Categoría del juego: Puzzles Objetivo del juego: Rompe un pegajoso hechizo y salva un reino de fantasía en Rainbow Web. Tendrás toneladas de diversión mientras juegas a este mágico desafío para la mente. |
|  | Mahjongg Fortuna Jugadores: 12462 Categoría del juego: Solitarios Objetivo del juego: Velocidad y habilidad mental son las armas más importantes en esta versión de un antiguo juego asiático. Despeja el tablero lo antes posible haciendo clic en las fichas iguales y gánate la fama eterna de la puntuación más alta. |
|  | Chainz 2 Jugadores: 6955 Categoría del juego: Puzzles Objetivo del juego: Entra en el mundo de las combinaciones con Chainz 2: Relinked, emocionante secuela del exitazo del año pasado, Chainz. Gira eslabones y crea combinaciones de 3 ó más. |
|  | Delicious Jugadores: 4405 Categoría del juego: Acción Objetivo del juego: ¿Eres un as de la multitarea? ¿Quieres que tus clientes estén contentos? ¡Pues Delicious es tu juego! Sacia el apetito de los clientes y tenlos contentos; ¡no te arriesgues! |
|  | Bookworm Jugadores: 4568 Categoría del juego: Palabras Objetivo del juego: Junta las letras para formar palabras. ¡Las palabras más largas valen más puntos! |
|  | Zuma Jugadores: 4976 Categoría del juego: Acción Objetivo del juego: Controla el ídolo de la rana de piedra de los antiguos Zuma en este intrigante enigma de acción. ¡Dispara bolas para formar conjuntos de tres, pero si dejas que lleguen a la calavera dorada morirás! |
|  | Jewel of Atlantis Jugadores: 3798 Categoría del juego: Puzzles Objetivo del juego: Descubre la ciudad hundida de la Atlántida y busca valiosos tesoros. Viaja más allá de las profundidades del mar y vive trepidantes aventuras en Jewel of Atlantis. |
|  | Jewel Quest Jugadores: 3727 Categoría del juego: Puzzles Objetivo del juego: Convierte la arena de la antigua selva en oro tan rápido como puedas juntando grupos de 3 elementos. ¡Los grupos más grandes valen más puntos! |
|  | Bejeweled 2 Jugadores: 3659 Categoría del juego: Puzzles Objetivo del juego: Con cuatro modos de juego únicos y fascinantes, nuevas piezas de juego explosivas e imponentes fondos planetarios, Bejeweled 2 es mucho más adictivo que nunca. |
|
|