|
From: Ben F. <li...@hi...> - 2005-02-25 14:44:20
|
Chad Little wrote:
> It is fairly modular. If you know PHP arrays it is very simple. At the
> end of ical_parser are some comment tags, uncomment the $master_array
> and you will see our structure. Each page (day, week, month, ect) is
> simply a different manipulation of this array.
===Aim===
I'm also working on a kind of "phpicalendar lite" as mentioned
previously on the list but I called it content management.
I want to be able to generate a web page showing the next few events
coming up with a title, description, start date and time, end date and
time if applicable and which calendar they've come from.
===Problems===
I'm struggling a little with manipulating the master_array returned by
ical_parser.php. It would make more sense in my head if I could get
from the multidimensional format of the master_array which is something
like...
[20050222] => Array
(
[1600] => Array
(
[8D69CBD9-8664-11D9-8CFA-000D936C280E-RID] => Array
(
[event_start] => 1600
[event_end] => 1700
[display_end] =>
[start_unixtime] => 1109088000
[end_unixtime] => 1109091600
[event_text] => Recurring+Event
[event_length] => 3600
[event_overlap] => 0
[description] =>
[status] =>
[class] =>
[spans_day] =>
[location] =>
[organizer] => a:0:{}
[attendee] => a:0:{}
[calnumber] => 1
[calname] => exhibitions
[url] =>
[recur] => Array
(
[FREQ] => daily
[INTERVAL] => 1
[UNTIL] => February 25
)
)
)
to something more like a flat table....
[8D69CBD9-8664-11D9-8CFA-000D936C280E-RID] => Array
(
[event_text] => Recurring+Event
[start_date] => 20050222
[end_date] => 20050225
[start_time] => 1600
[end_time] => 1700
[calname] => exhibitions
)
This might be similar to what the draw_print function in
functions/template.php does, but... well I don't understand it!
My main problems are:
1) A recurring event only needs to appear once
2) I need to get an end date for recurring events
3) My skills with PHP arrays are very limited.
===Other Questions===
1) What are the dependencies of the ical_parser.php file? Does it rely
on any files other than init.incs.php, date_functions.php,
draw_functions.php, overlapping_events.php and timezones.php? If not,
can I use the functions directory on its own without the rest of
phpicalendar in an entirely separate directory?
2) I'd really like to be able to associate images with events and I'm
not sure how to achieve this. Perhaps I could create a directory of
images with the directory name matching the UID of the events. Or
perhaps I should generate a MySQL database from the .ics file with UIDs
and fields for image paths. I could even create a table from the array
I'm trying to create and store all the calendar data in the database to
increase the speed of execution.
There's a good chance I'm approaching this in entirely the wrong way. If
so, please put me out of my misery!
Thanks
tola
--
Ben "tola" Francis http://hippygeek.co.uk
----------------------------------------------------
COMPUTER SUPPORT for small businesses and home users
http://tolatech.co.uk
----------------------------------------------------
|