You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(159) |
Nov
(123) |
Dec
(27) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(6) |
Feb
(11) |
Mar
(21) |
Apr
(29) |
May
(13) |
Jun
(2) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(21) |
Nov
(71) |
Dec
|
2004 |
Jan
(18) |
Feb
(12) |
Mar
|
Apr
(6) |
May
(29) |
Jun
(9) |
Jul
(3) |
Aug
(4) |
Sep
(7) |
Oct
(6) |
Nov
|
Dec
(20) |
2005 |
Jan
(6) |
Feb
(27) |
Mar
(4) |
Apr
(16) |
May
(61) |
Jun
(6) |
Jul
(4) |
Aug
(18) |
Sep
(19) |
Oct
(5) |
Nov
(55) |
Dec
(30) |
2006 |
Jan
(11) |
Feb
(9) |
Mar
(9) |
Apr
(26) |
May
(17) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(20) |
Oct
|
Nov
(6) |
Dec
(9) |
2007 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
(8) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
(17) |
Mar
(11) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2009 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(4) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jim Hu <ji...@ta...> - 2005-11-23 08:08:14
|
I think we can do 2.2...I changed the footer and README in CVS. One last bug I worked on tonight is not quite completely squashed... I could use some help (Wes?...was the multiselctor yours?). See: http://phpicalendar.net/forums/viewtopic.php?t=262 And here is a my test site where I've added a German Holidays webcal http://dimer.tamu.edu/phpical-x/month.php? When I try putting a webcal in the config.inc.php, it works in all calendar mode. But when selecting it as an individual calendar, it crashes the parser (at least on my setup). I think that there are a number of problems. First, determining the modification time of the webcal using filemtime doesn't work. I'm not sure if this is important...but there may be unintended consequences Second, the cal_filename has slashes that mess up the directory path for writing the cached parsed calendar. I can get around this by changin line 74 in ical_parser.php to $parsedcal = $tmp_dir.'/parsedcal-'.urlencode($cal_filename).'-'. $this_year; This makes the calendar select and display OK. Then I changed rss.php and rss/index.php to get the correct URLs and calendar display names. For the webcal, the URL is pretty ugly, but I think it has to be that way...it has to include information to allow phpicalendar to find the webcal, right? The display name is underspecified, I think. We can get the short name from the URL but not vice versa, unless we start caching an index for webcals...which probably isn't worth it just to make shorter URLs for the RSS. So far, so good. But I can't get the webcal to work in the multicalendar selector. I can pick multiple calendars, but if one is the webcal, it is the only one that doesn't display. I listed that as a known bug in the README. Anyway, I think that this will deal with many of the frequent issues raised on the bbs. The other thing that may be desirable is to actively suppress warnings, since many people still seem to be sending them to the browser instead of a log...but I didn't do that. ===================================== Jim Hu On Nov 22, 2005, at 10:16 PM, phpicalendar-devel- re...@li... wrote: > Send Phpicalendar-devel mailing list submissions to > php...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > or, via email, send a message with subject or body 'help' to > php...@li... > > You can reach the person managing the list at > php...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Phpicalendar-devel digest..." > > > Today's Topics: > > 1. Re: A bug-fix release? (Chad Little) > > --__--__-- > > Message: 1 > From: Chad Little <ch...@ch...> > Subject: Re: [PHPiCalendar-DEV] A bug-fix release? > Date: Mon, 21 Nov 2005 22:58:44 -0800 > To: php...@li... > Reply-To: php...@li... > > > --Apple-Mail-1--283298011 > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; > charset=US-ASCII; > delsp=yes; > format=flowed > > As long as the README has been updated, change the version # in the > footer to 2.2 and I'll build tag out a release. > > -Chad > > On Nov 21, 2005, at 4:02 PM, Jim Hu wrote: > >> Chad, >> >> Should there be a bug fix release from CVS? Seems like a bunch >> have been taken care of and a lot of the replies I'm giving on the >> bbs are "try the CVS". >> >> Jim >> ===================================== >> Jim Hu >> Associate Professor and Associate Head for Graduate Programs >> Dept. of Biochemistry and Biophysics >> 2128 TAMU >> Texas A&M Univ. >> College Station, TX 77843-2128 >> 979-862-4054 >> > > > --Apple-Mail-1--283298011 > Content-Transfer-Encoding: quoted-printable > Content-Type: text/html; > charset=ISO-8859-1 > > <HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; = > -khtml-line-break: after-white-space; "><DIV>As long as the README > has = > been updated, change the version # in the footer to 2.2 and I'll > build = > tag out a release.</DIV><DIV><BR = > class=3D"khtml-block-placeholder"></DIV><DIV>-Chad</ > DIV><BR><DIV><DIV>On = > Nov 21, 2005, at 4:02 PM, Jim Hu wrote:</DIV><BR = > class=3D"Apple-interchange-newline"><BLOCKQUOTE = > type=3D"cite">Chad,<DIV><BR = > class=3D"khtml-block-placeholder"></DIV><DIV>Should there be a bug > fix = > release from CVS?=A0 Seems like a bunch have been taken care of and > a = > lot of the replies I'm giving on the bbs are "try the = > CVS".</DIV><DIV><BR = > class=3D"khtml-block-placeholder"></DIV><DIV>Jim<BR><DIV><DIV = > style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = > margin-left: 0px; "><FONT face=3D"Helvetica" size=3D"3" > style=3D"font: = > 12.0px > Helvetica">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT></ > DIV><DIV = > style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = > margin-left: 0px; "><FONT face=3D"Helvetica" size=3D"3" > style=3D"font: = > 12.0px Helvetica">Jim Hu</FONT></DIV><DIV style=3D"margin-top: 0px; = > margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT = > face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px > Helvetica">Associate = > Professor and Associate Head for Graduate Programs</FONT></DIV><DIV = > style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = > margin-left: 0px; "><FONT face=3D"Helvetica" size=3D"3" > style=3D"font: = > 12.0px Helvetica">Dept. of Biochemistry and Biophysics</FONT></ > DIV><DIV = > style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; = > margin-left: 0px; "><FONT face=3D"Helvetica" size=3D"3" > style=3D"font: = > 12.0px Helvetica">2128 TAMU</FONT></DIV><DIV style=3D"margin-top: > 0px; = > margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT = > face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px Helvetica">Texas = > A&M Univ.</FONT></DIV><DIV style=3D"margin-top: 0px; margin- > right: = > 0px; margin-bottom: 0px; margin-left: 0px; "><FONT > face=3D"Helvetica" = > size=3D"3" style=3D"font: 12.0px Helvetica">College Station, TX = > 77843-2128</FONT></DIV><DIV style=3D"margin-top: 0px; margin-right: > 0px; = > margin-bottom: 0px; margin-left: 0px; "><FONT face=3D"Helvetica" = > size=3D"3" style=3D"font: 12.0px Helvetica">979-862-4054</FONT></ > DIV> = > </DIV><BR></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>= > > --Apple-Mail-1--283298011-- > > > > --__--__-- > > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > > > End of Phpicalendar-devel Digest |
From: Chad L. <ch...@ch...> - 2005-11-22 06:58:50
|
As long as the README has been updated, change the version # in the footer to 2.2 and I'll build tag out a release. -Chad On Nov 21, 2005, at 4:02 PM, Jim Hu wrote: > Chad, > > Should there be a bug fix release from CVS? Seems like a bunch > have been taken care of and a lot of the replies I'm giving on the > bbs are "try the CVS". > > Jim > ===================================== > Jim Hu > Associate Professor and Associate Head for Graduate Programs > Dept. of Biochemistry and Biophysics > 2128 TAMU > Texas A&M Univ. > College Station, TX 77843-2128 > 979-862-4054 > |
From: Jim Hu <ji...@ta...> - 2005-11-22 00:02:58
|
Chad, Should there be a bug fix release from CVS? Seems like a bunch have been taken care of and a lot of the replies I'm giving on the bbs are "try the CVS". Jim ===================================== Jim Hu Associate Professor and Associate Head for Graduate Programs Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054 |
From: Jim Hu <ji...@ta...> - 2005-11-16 01:19:25
|
I just uploaded a new rss.php to CVS. This fixes several bugs in date calculations and adds an rssview for year. I will also describe this on the bbs. Jim Hu |
From: Wesley M. <we...@we...> - 2005-11-13 05:16:25
|
Hi Jim, I probably didn't take a good enough look at the various places where $calendar_path could get modified, so it is probably still working the wa= y you said. Perhaps you are mirroring he directory structure of your calendars = folder in $tmp_dir in case you had calendars with duplicate names? As for me, my home directory is also on my server, so I've got PHP iCalen= dar pointed at my iCal database under my home directory. That's the reason I = wanted support for iCal's native database format, as I never do any sort of publ= ishing or what-not. Later, Wes Quoting Jim Hu <ji...@ta...>: > Wes, > > Hmm... appending $cpath should happen after $calendar_path gets reset > to "calendars" if blank...but it may have been moved during various > revisions. $tmp_dir is also reset because I put subdirectories in the > tmp directory to mirror the directory structure of my calendars > folder. That way I can find the parsed cals for each one, and I > think it was needed to read the saved parsed cals...that was so long > ago I forget why I did that. > > As for $support_ical, I see why I didn't follow you...my XServe is > headless! So I never manipulate the iCals directly on the server...doh= ! > > Jim > > p.s. I hope by making the reply plain text instead of rtf I'll get > rid of all the junk that's been coming with my replies. > > On Nov 12, 2005, at 10:11 PM, phpicalendar-devel- > re...@li... wrote: > <snip> > > From: Wesley Miaw <we...@we...> > > Subject: Re: [PHPiCalendar-DEV] ics extensions > > Date: Sat, 12 Nov 2005 00:21:50 -0800 > > To: php...@li... > > Reply-To: php...@li... > > > > Hi Jim, > > > > I don't think there's anything to read with $support_ical, but the > > issue is that with one of the newer versions of iCal, Apple changed > > their repository structure. It used to just be a single directory > > with a list of Calendar.ics files in it. Now it has become more > > database-like (no doubt to support a richer feature set) so there is > > a base directory, containing multiple subdirectories of some hashed > > name. Inside each of those subdirectories is the corestorage.ics > > file, a binary index, and an Info.plist file that contains meta > > information. > > > > So that's what led me to include the two new config globals to > > support iCal and recursively search directories. > > > > I remember seeing that $calendar_path .=3D "/$cpath" line. It works i= f > > $calendar_path is not empty, but becomes a problem if $calendar_path > > =3D '' in config.inc.php. What's $tmp_dir used for? I'd propose the > > following for $cpath: > > > > if ($_REQUEST['cpath']) { > > $cpath =3D $_REQUEST['cpath']; > > if (empty $calendar_path) { > > $calendar_path =3D "."; > > } > > $calendar_path .=3D "/$cpath"; > > $tmp_dir .=3D "/$cpath"; > > } > > > > I just checked in the changes we discussed below. Hopefully this will > > fix the issues people have run into from my bad checkin earlier. > > > > Later, > > Wes > <snip> > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. Dow= nload > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > -- Wesley Miaw http://www.wesman.net/ |
From: Jim Hu <ji...@ta...> - 2005-11-13 04:32:43
|
Wes, Hmm... appending $cpath should happen after $calendar_path gets reset to "calendars" if blank...but it may have been moved during various revisions. $tmp_dir is also reset because I put subdirectories in the tmp directory to mirror the directory structure of my calendars folder. That way I can find the parsed cals for each one, and I think it was needed to read the saved parsed cals...that was so long ago I forget why I did that. As for $support_ical, I see why I didn't follow you...my XServe is headless! So I never manipulate the iCals directly on the server...doh! Jim p.s. I hope by making the reply plain text instead of rtf I'll get rid of all the junk that's been coming with my replies. On Nov 12, 2005, at 10:11 PM, phpicalendar-devel- re...@li... wrote: <snip> > From: Wesley Miaw <we...@we...> > Subject: Re: [PHPiCalendar-DEV] ics extensions > Date: Sat, 12 Nov 2005 00:21:50 -0800 > To: php...@li... > Reply-To: php...@li... > > Hi Jim, > > I don't think there's anything to read with $support_ical, but the > issue is that with one of the newer versions of iCal, Apple changed > their repository structure. It used to just be a single directory > with a list of Calendar.ics files in it. Now it has become more > database-like (no doubt to support a richer feature set) so there is > a base directory, containing multiple subdirectories of some hashed > name. Inside each of those subdirectories is the corestorage.ics > file, a binary index, and an Info.plist file that contains meta > information. > > So that's what led me to include the two new config globals to > support iCal and recursively search directories. > > I remember seeing that $calendar_path .= "/$cpath" line. It works if > $calendar_path is not empty, but becomes a problem if $calendar_path > = '' in config.inc.php. What's $tmp_dir used for? I'd propose the > following for $cpath: > > if ($_REQUEST['cpath']) { > $cpath = $_REQUEST['cpath']; > if (empty $calendar_path) { > $calendar_path = "."; > } > $calendar_path .= "/$cpath"; > $tmp_dir .= "/$cpath"; > } > > I just checked in the changes we discussed below. Hopefully this will > fix the issues people have run into from my bad checkin earlier. > > Later, > Wes <snip> |
From: Wesley M. <we...@we...> - 2005-11-12 08:21:58
|
Hi Jim, I don't think there's anything to read with $support_ical, but the issue is that with one of the newer versions of iCal, Apple changed their repository structure. It used to just be a single directory with a list of Calendar.ics files in it. Now it has become more database-like (no doubt to support a richer feature set) so there is a base directory, containing multiple subdirectories of some hashed name. Inside each of those subdirectories is the corestorage.ics file, a binary index, and an Info.plist file that contains meta information. So that's what led me to include the two new config globals to support iCal and recursively search directories. I remember seeing that $calendar_path .= "/$cpath" line. It works if $calendar_path is not empty, but becomes a problem if $calendar_path = '' in config.inc.php. What's $tmp_dir used for? I'd propose the following for $cpath: if ($_REQUEST['cpath']) { $cpath = $_REQUEST['cpath']; if (empty $calendar_path) { $calendar_path = "."; } $calendar_path .= "/$cpath"; $tmp_dir .= "/$cpath"; } I just checked in the changes we discussed below. Hopefully this will fix the issues people have run into from my bad checkin earlier. Later, Wes On Nov 11, 2005, at 8:42 PM, Jim Hu wrote: > Wes, > > Hard for me to evaluate...I confess that I'm lost on what's going > on in the $support_ical setup. Is there a place where I can read > up on that? > What I did on my end to take care of $cpath is to move the code > setting $calendar_path using $cpath in init.inc.php to before > > if($_REQUEST['cpath']){ > $cpath = $_REQUEST['cpath']; > $calendar_path .= "/$cpath"; > $tmp_dir .= "/$cpath"; > } > include_once(BASE.'functions/calendar_functions.php'); > > This sets the $calendar path in function available_calendars > correctly...at least as far as I've been able to check in the past > couple of days. Anyway, I think that the .ics extension problem > may account for some of the other bugs being reported on the bbs, > so if it's OK to append the .ics where I did I'll use it. I could > put that on the CVS but maybe you should just include it when you > make the other changes. > > I've been working on fixing some bugs with rss.php. More on this > later. > > Jim Hu > > > On Nov 11, 2005, at 10:16 PM, phpicalendar-devel- > re...@li... wrote: >> <snip> >> --__--__-- >> >> Message: 3 >> From: Wesley Miaw <we...@we...> >> Subject: Re: [PHPiCalendar-DEV] calendar_functions.php >> Date: Thu, 10 Nov 2005 23:11:30 -0800 >> To: php...@li... >> Reply-To: php...@li... >> >> Hi Jim, >> >> Yeah, I was afraid I'd broken stuff. Placing a .ics at the end seems >> like the correct approach, since the "// Process files." block >> expects the files to be the full path to a real file. I don't think >> it's a kludge, since under normal operation, that's how a calendar >> name would be mapped onto a file, right? >> >> I think then this needs to be combined with a modification to line >> 70: >> >> // Build the list of files we need to check. >> if ($find_all || $recursive_path == 'yes' || $support_ical == >> 'yes') { >> // Open the directory. >> >> This will force it to check other .ics files, such as >> corestorage.ics, in the $search_path for the name pulled out of >> Info.plist, if $support_ical == 'yes' but you still specify the >> calendar name in the request. I imagine that if $recursive_path == >> 'no', at this point you would use $cpath to identify the directory >> containing your iCal directory with the corestorage.ics and >> Info.plist contents. >> >> This seems to work for me in my very brief test. Without your change, >> and the change to line 70, selecting a specific calendar doesn't work >> unless $recursive_path == 'yes'. What do you think? >> >> Later, >> Wes >> >> On Nov 10, 2005, at 10:47 PM, Jim Hu wrote: >> >>> I've seen a problem where calendars aren't showing up when a >>> specific calendar is selected, as opposed to >>> all_calendars_combined...this is using what's in the CVS and not >>> using recursive searching. >>> As far as I can tell, availableCalendars() never pushes the >>> calendar onto the cal_filelist array. I patched my install by >>> forcing a .ics extension onto $filename. >>> >>> } else { >>> foreach ($cal_filename_local as $filename) { >>> array_push($files, "$search_path/$filename".'.ics'); >>> } >>> } >>> ...but that seems very much like a kludge. Any thoughts? >>> >>> ===================================== >>> Jim Hu >> >> -- >> Wesley Miaw >> we...@we... -- Wesley Miaw we...@we... |
From: Jim Hu <ji...@ta...> - 2005-11-12 04:42:15
|
Wes, Hard for me to evaluate...I confess that I'm lost on what's going on in the $support_ical setup. Is there a place where I can read up on that? What I did on my end to take care of $cpath is to move the code setting $calendar_path using $cpath in init.inc.php to before if($_REQUEST['cpath']){ $cpath = $_REQUEST['cpath']; $calendar_path .= "/$cpath"; $tmp_dir .= "/$cpath"; } include_once(BASE.'functions/calendar_functions.php'); This sets the $calendar path in function available_calendars correctly...at least as far as I've been able to check in the past couple of days. Anyway, I think that the .ics extension problem may account for some of the other bugs being reported on the bbs, so if it's OK to append the .ics where I did I'll use it. I could put that on the CVS but maybe you should just include it when you make the other changes. I've been working on fixing some bugs with rss.php. More on this later. Jim Hu On Nov 11, 2005, at 10:16 PM, phpicalendar-devel- re...@li... wrote: > <snip> > --__--__-- > > Message: 3 > From: Wesley Miaw <we...@we...> > Subject: Re: [PHPiCalendar-DEV] calendar_functions.php > Date: Thu, 10 Nov 2005 23:11:30 -0800 > To: php...@li... > Reply-To: php...@li... > > Hi Jim, > > Yeah, I was afraid I'd broken stuff. Placing a .ics at the end seems > like the correct approach, since the "// Process files." block > expects the files to be the full path to a real file. I don't think > it's a kludge, since under normal operation, that's how a calendar > name would be mapped onto a file, right? > > I think then this needs to be combined with a modification to line 70: > > // Build the list of files we need to check. > if ($find_all || $recursive_path == 'yes' || $support_ical == > 'yes') { > // Open the directory. > > This will force it to check other .ics files, such as > corestorage.ics, in the $search_path for the name pulled out of > Info.plist, if $support_ical == 'yes' but you still specify the > calendar name in the request. I imagine that if $recursive_path == > 'no', at this point you would use $cpath to identify the directory > containing your iCal directory with the corestorage.ics and > Info.plist contents. > > This seems to work for me in my very brief test. Without your change, > and the change to line 70, selecting a specific calendar doesn't work > unless $recursive_path == 'yes'. What do you think? > > Later, > Wes > > On Nov 10, 2005, at 10:47 PM, Jim Hu wrote: > >> I've seen a problem where calendars aren't showing up when a >> specific calendar is selected, as opposed to >> all_calendars_combined...this is using what's in the CVS and not >> using recursive searching. >> As far as I can tell, availableCalendars() never pushes the >> calendar onto the cal_filelist array. I patched my install by >> forcing a .ics extension onto $filename. >> >> } else { >> foreach ($cal_filename_local as $filename) { >> array_push($files, "$search_path/$filename".'.ics'); >> } >> } >> ...but that seems very much like a kludge. Any thoughts? >> >> ===================================== >> Jim Hu > > -- > Wesley Miaw > we...@we... > > > > > > --__--__-- > > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > > > End of Phpicalendar-devel Digest |
From: Wesley M. <we...@we...> - 2005-11-11 07:11:38
|
Hi Jim, Yeah, I was afraid I'd broken stuff. Placing a .ics at the end seems like the correct approach, since the "// Process files." block expects the files to be the full path to a real file. I don't think it's a kludge, since under normal operation, that's how a calendar name would be mapped onto a file, right? I think then this needs to be combined with a modification to line 70: // Build the list of files we need to check. if ($find_all || $recursive_path == 'yes' || $support_ical == 'yes') { // Open the directory. This will force it to check other .ics files, such as corestorage.ics, in the $search_path for the name pulled out of Info.plist, if $support_ical == 'yes' but you still specify the calendar name in the request. I imagine that if $recursive_path == 'no', at this point you would use $cpath to identify the directory containing your iCal directory with the corestorage.ics and Info.plist contents. This seems to work for me in my very brief test. Without your change, and the change to line 70, selecting a specific calendar doesn't work unless $recursive_path == 'yes'. What do you think? Later, Wes On Nov 10, 2005, at 10:47 PM, Jim Hu wrote: > I've seen a problem where calendars aren't showing up when a > specific calendar is selected, as opposed to > all_calendars_combined...this is using what's in the CVS and not > using recursive searching. > As far as I can tell, availableCalendars() never pushes the > calendar onto the cal_filelist array. I patched my install by > forcing a .ics extension onto $filename. > > } else { > foreach ($cal_filename_local as $filename) { > array_push($files, "$search_path/$filename".'.ics'); > } > } > ...but that seems very much like a kludge. Any thoughts? > > ===================================== > Jim Hu -- Wesley Miaw we...@we... |
From: Jim Hu <ji...@ta...> - 2005-11-11 06:47:44
|
I've seen a problem where calendars aren't showing up when a specific calendar is selected, as opposed to all_calendars_combined...this is using what's in the CVS and not using recursive searching. As far as I can tell, availableCalendars() never pushes the calendar onto the cal_filelist array. I patched my install by forcing a .ics extension onto $filename. } else { foreach ($cal_filename_local as $filename) { array_push($files, "$search_path/$filename".'.ics'); } } ...but that seems very much like a kludge. Any thoughts? ===================================== Jim Hu |
From: Jim Hu <JI...@ta...> - 2005-11-11 05:52:56
|
Early in the development of 2.0a, I introduced the $cpath variable into phpicalendar. When Chad's site got hacked, the discussion of this on the bbs got lost...I just put some explanation in the new bbs and on the wiki docs. The point of $cpath=$_REQUEST['cpath'] is so that you can point phpicalendar at different subdirectories. This is useful for multiuser installations, like the one I run. I was unable to work on phpicalendar for a while and only got back into it when 2.1 was released recently. Upgrading, I see that many of the changes break support for $cpath. I've put patches for many of these into the CVS. ===================================== Jim Hu Associate Professor and Associate Head for Graduate Programs Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054 |
From: Rasmus V. <oo...@ik...> - 2005-11-09 11:58:56
|
Hi, I'd like to suggest a minor little change in the script for publishing iCal files without webDAV support as iCal suggest to distribute the URL to the publishing script when a user publishes his/ her calendar. If the GET-method would serve the actual ICS-file content then users would be able to let iCal email URL:s directly. Something like this: /* GET requests to output calendar file content */ if($_SERVER['REQUEST_METHOD'] == 'GET') { $calendar_file = urldecode($calendar_path.substr($_SERVER ['REQUEST_URI'] , ( strrpos($_SERVER['REQUEST_URI'], '/') + 1) )) ; // read from file if($fp = fopen($calendar_file,'r')) { $data = fread($fp, filesize($calendar_file)); fclose($fp); header("Content-type: text/calendar"); echo $data; } else { logmsg( 'couldnt open file '.$calendar_file); } return; } Just instead of redirecting the request to the main calendar, this would make phpicalendar completely transparent to iCal users. Also if the calendar name includes a space the filename needs to be urldecoded (unpublishing needs this as well or the filename will not be deleted). Anyway, thanks for an excellent package! .raz |
From: Wesley M. <we...@we...> - 2005-11-02 06:49:27
|
Hi Jim, > I'm also not getting the multiple calendar selector to work if the > calendars are in a directory specified by cpath. Ah. Looks like this is the offending code from init.inc.php. if($_REQUEST['cpath']){ $cpath = $_REQUEST['cpath']; $calendar_path .= "/$cpath"; $tmp_dir .= "/$cpath"; } Seems to me, you shouldn't blindly tack on "/$cpath" because that allows you to point PHP iCalendar at a root directory, if $calendar_path is the default '' in config.inc.php. Is that the reason you aren't finding your calendars? I also have questions as to why there's a bunch of http/https manipulation going on, and blacklisting is checked for in init.inc.php. Maybe I'm the one who put blacklisting checks into there, but I it should get moved into availableCalendars() inside calendar_functions.php. BTW - With the recursive flag turned on, you don't need to use a cpath to find your calendars anymore. But cpath should still be used to perform more restrictive calendar searches, and if a recursive search might be too large. Later, -- Wesley Miaw we...@we... |
From: Jim Hu <ji...@ta...> - 2005-10-30 07:15:28
|
I haen't been checking in as much as I should...It looks like I did the redefinition in 1.24, and looking at the code, I don't remember why...but note that there was a more complex redefinition of $default_path in earlier versions. Note also that to get the correct URL one also has to change line 140 from $rss_link = htmlspecialchars ("$default_path/day.php?getdate= $getdate&cal=$cal&cpath=$cpath"); to $rss_link = htmlspecialchars ("$default_path/day.php?getdate= $thisdate&cal=$cal&cpath=$cpath"); I'm also not getting the multiple calendar selector to work if the calendars are in a directory specified by cpath. Jim Hu On Oct 29, 2005, at 3:14 PM, phpicalendar-devel- re...@li... wrote: > Send Phpicalendar-devel mailing list submissions to > php...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > or, via email, send a message with subject or body 'help' to > php...@li... > > You can reach the person managing the list at > php...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Phpicalendar-devel digest..." > > > Today's Topics: > > 1. Support for iCal Databases (Wesley Miaw) > 2. Patch for 1305320/1304709 (Wesley Miaw) > > --__--__-- > > Message: 1 > To: php...@li... > From: Wesley Miaw <we...@we...> > Date: Fri, 28 Oct 2005 23:00:44 -0700 > Subject: [PHPiCalendar-DEV] Support for iCal Databases > Reply-To: php...@li... > > > --Apple-Mail-6--212894681 > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; > charset=US-ASCII; > delsp=yes; > format=flowed > > Hi People, > > Been a long time since I last participated, but I finally did some > work again. :P > > Attached is a diff of my tree that enables support for the new iCal- > type directory structure and independently support for recursively > finding calendars in subdirectories. > > I'd like people to give it a try and see if everything works for them > still. If so, I'll commit the changes to CVS. I've submitted this > diff file as a patch to SourceForge as a backup. > > I also completely removed the redefinition of $default_path from > rss.php. I removed it because it was generating invalid URLs on my > server. Why was it redefined in 1.24 to begin with? > > Later, > -- > Wesley Miaw > we...@we... > > > --Apple-Mail-6--212894681 > Content-Transfer-Encoding: 7bit > Content-Type: application/octet-stream; > x-mac-type=54455854; > x-unix-mode=0644; > name="ical.diff" > Content-Disposition: attachment; > filename=ical.diff > > Index: config.inc.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/config.inc.php,v > retrieving revision 1.168 > diff -u -r1.168 config.inc.php > --- config.inc.php 14 Sep 2005 20:53:53 -0000 1.168 > +++ config.inc.php 29 Oct 2005 05:49:14 -0000 > @@ -39,6 +39,8 @@ > $show_completed = 'yes'; // Show > completed todos on your todo list. > $allow_login = 'no'; // Set to yes to > prompt for login to unlock calendars. > $login_cookies = 'no'; // Set to yes to > store authentication information via (unencrypted) cookies. Set to > no to use sessions. > +$support_ical = 'no'; // Set to yes to > support the Apple iCal calendar database structure. > +$recursive_path = 'no'; // Set to yes to > recurse into subdirectories of the calendar path. > > // Calendar Caching (decreases page load times) > $save_parsed_cals = 'no'; // Saves a copy > of the cal in /tmp after it's been parsed. Improves performence. > Index: functions/calendar_functions.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ > calendar_functions.php,v > retrieving revision 1.10 > diff -u -r1.10 calendar_functions.php > --- functions/calendar_functions.php 27 Oct 2005 17:41:24 > -0000 1.10 > +++ functions/calendar_functions.php 29 Oct 2005 05:49:14 -0000 > @@ -14,7 +14,7 @@ > // returned. > function availableCalendars($username, $password, $cal_filename, > $admin = false) { > // Import globals. > - global $allow_login, $calendar_path, $blacklisted_cals, > $list_webcals, $locked_cals, $locked_map, $apache_map, $lang, > $ALL_CALENDARS_COMBINED, $_SERVER; > + global $allow_login, $calendar_path, $recursive_path, > $support_ical, $blacklisted_cals, $list_webcals, $locked_cals, > $locked_map, $apache_map, $lang, $ALL_CALENDARS_COMBINED, $_SERVER; > > // Create the list of available calendars. > $calendars = array(); > @@ -30,39 +30,20 @@ > if (isset($locked_map["$username:$password"])) { > $unlocked_cals = $locked_map["$username:$password"]; > } > - > - // Include all local and web calendars if asking for all > calendars > - // combined. > - if ($cal_filename == $ALL_CALENDARS_COMBINED || $admin) { > - // Add local calendars. > - $dir_handle = @opendir($calendar_path) > - or die(error(sprintf($lang['l_error_path'], > $calendar_path), $cal_filename)); > - while (($file = readdir($dir_handle)) != false) { > - // Make sure this is not a dot file and it ends > with .ics, > - // and that it is not blacklisted. > - if (!preg_match("/^[^.].*\.ics$/i", $file)) continue; > - $cal_name = substr($file, 0, -4); > - if (in_array($cal_name, $blacklisted_cals)) continue; > + // Make a local copy of the requested calendars. > + if (!is_array($cal_filename)) > + $cal_filename_local = array($cal_filename); > + else > + $cal_filename_local = $cal_filename; > > - // If HTTP authenticated, make sure this calendar is > available > - // to the user. > - if (isset($http_user)) { > - if (!in_array($cal_name, $apache_map[$http_user])) > continue; > - } > - > - // Otherwise exclude locked calendars. > - else if (!$admin && > - in_array($cal_name, $locked_cals) && > - !in_array($cal_name, $unlocked_cals)) > - { > - continue; > - } > - > - // Add this calendar. > - array_push($calendars, "$calendar_path/$file"); > - } > + // Create the list of available calendars. > + $calendars = array(); > + > + // This array keeps track of paths we need to search. > + $search_paths = array($calendar_path); > > - // Add web calendars. > + // Add web calendars. > + if ($cal_filename == $ALL_CALENDARS_COMBINED || $admin) { > if (!isset($http_user) && !$admin) { > foreach ($list_webcals as $file) { > // Make sure the URL ends with .ics. > @@ -74,55 +55,92 @@ > } > } > > - // Otherwise just include the requested calendar. > - else { > - if(!is_array($cal_filename)) { > - $cal_filename_local = array($cal_filename); > - } > - else { > - $cal_filename_local = $cal_filename; > - } > - > - foreach($cal_filename_local as $c) { > - > - // Make sure this is not a blacklisted calendar. We don't > have > - // to remove a .ics suffix because it would not have been > passed > - // in the argument. > - if (in_array($c, $blacklisted_cals)) > - exit(error($lang['l_error_restrictedcal'], $c)); > - > - // If HTTP authenticated, make sure this calendar is > available > - // to the user. > - if (isset($http_user)) { > - if (!in_array($c, $apache_map[$http_user])) { > - // Use the invalid calendar message so that the > user is > - // not made aware of locked calendars. > - exit(error($lang['l_error_invalidcal'], $c)); > + // Set some booleans that will dictate our search. > + $find_all = ($cal_filename == $ALL_CALENDARS_COMBINED || $admin); > + > + // Process all search paths. > + while (!empty($search_paths)) { > + // Read the next search path. > + $search_path = array_pop($search_paths); > + > + // This array keeps track of filenames we need to look at. > + $files = array(); > + > + // Build the list of files we need to check. > + if ($find_all || $recursive_path == 'yes') { > + // Open the directory. > + $dir_handle = @opendir($search_path) > + or die(error(sprintf($lang['l_error_path'], > $search_path), $cal_filename)); > + if ($dir_handle === false) > + die(error(sprintf($lang['l_error_path'], > $search_path), $cal_filename)); > + > + // Add each file in the directory that does not begin > with a dot. > + while (false !== ($file = readdir($dir_handle))) { > + // Make sure this is not a dot file. > + if (preg_match("/^\./", $file)) continue; > + array_push($files, "$search_path/$file"); > + } > + } else { > + foreach ($cal_filename_local as $filename) { > + array_push($files, "$search_path/$filename"); > } > } > > - // Otherwise make sure this calendar is not locked. > - else if (in_array($c, $locked_cals) && > - !in_array($c, $unlocked_cals)) > - { > - // Use the invalid calendar message so that the user is > - // not made aware of locked calendars. > - exit(error($lang['l_error_invalidcal'], $c)); > - } > + // Process files. > + foreach ($files as $file) { > + // Push directories onto the search paths if recursive > paths is > + // turned on. > + if (is_dir($file)) { > + if ($recursive_path == 'yes') { > + array_push($search_paths, $file); > + } > + continue; > + } > + > + // Make sure the file is real. > + if (!is_file($file)) continue; > + > + // Make sure the file ends in .ics. > + if (!preg_match("/^.*\.ics$/i", $file)) continue; > + > + // Make sure this is not a blacklisted calendar. > + $cal_name = getCalendarName($file); > + if (in_array($cal_name, $blacklisted_cals)) continue; > + > + // If HTTP authenticated, make sure this calendar is > available > + // to the user. > + if (isset($http_user)) { > + if (!in_array($cal_name, $apache_map[$http_user])) > continue; > + } > > - // Add this calendar. > - array_push($calendars, "$calendar_path/$c.ics"); > + // Make sure this calendar is not locked. > + if (!$admin && > + in_array($cal_name, $locked_cals) && > + !in_array($cal_name, $unlocked_cals)) > + { > + continue; > + } > + > + // Add this calendar if we're looking for it, and > remove it's name > + // from the local list because we've found it. > + if ($find_all || in_array($cal_name, > $cal_filename_local)) { > + array_push($calendars, $file); > + $cal_filename_local = array_diff > ($cal_filename_local, array($cal_name)); > + > + // If the local list is empty, we're done. > + if (empty($cal_filename_local)) > + break 2; > + } > } > } > - > + > // Return the sorted calendar list. > natcasesort($calendars); > return $calendars; > } > > // This function returns the result of the availableCalendars > function > -// but only includes the calendar filename (including the .ics) > and not > -// the entire path. > +// but only includes the calendar names. > // > // $username = The username. Empty if no username provided. > // $password = The password. Empty if no password provided. > @@ -136,7 +154,7 @@ > > // Strip the paths off the calendars. > foreach (array_keys($calendars) as $key) { > - $calendars[$key] = basename($calendars[$key]); > + $calendars[$key] = getCalendarName($key); > } > > // Return the sorted calendar names. > @@ -144,6 +162,34 @@ > return $calendars; > } > > +// This function returns the calendar name for the specified calendar > +// path. > +// > +// $cal_path = The path to the calendar file. > +function getCalendarName($cal_path) { > + global $support_ical; > + > + // If iCal is supported, check the directory for an Info.plist. > + if ($support_ical == 'yes') { > + // Look for the Info.plist file. > + $plist_filename = dirname($cal_path)."/Info.plist"; > + if (is_file($plist_filename)) { > + // Read the Info.plist. > + $handle = fopen($plist_filename, 'r'); > + $contents = fread($handle, filesize($plist_filename)); > + fclose($handle); > + > + // Pull out the calendar name. > + $num_matches = preg_match("/<key>Title<\/key>\s*? > <string>(.+?)<\/string>/i", $contents, $matches); > + if ($num_matches > 0) > + return $matches[1]; > + } > + } > + > + // At this point, just pull the name off the file. > + return substr(basename($cal_path), 0, -4); > +} > + > // This function prints out the calendars available to the user, for > // selection. Should be enclosed within a <select>...</select>, which > // is not printed out by this function. > @@ -158,9 +204,8 @@ > // > // Only display the calendar name, replace all instances > of "32" with " ", > // and remove the .ics suffix. > - $cal_displayname_tmp = basename($cal_tmp); > + $cal_displayname_tmp = getCalendarName($cal_tmp); > $cal_displayname_tmp = str_replace("32", " ", > $cal_displayname_tmp); > - $cal_displayname_tmp = substr($cal_displayname_tmp, 0, -4); > > // If this is a webcal, add 'Webcal' to the display name. > if (preg_match("/^(https?|webcal):\/\//i", $cal_tmp)) { > @@ -172,8 +217,7 @@ > // label to the display name. > else { > // Strip path and .ics suffix. > - $cal_tmp = basename($cal_tmp); > - $cal_tmp = substr($cal_tmp, 0, -4); > + $cal_tmp = getCalendarName($cal_tmp); > > // Add calendar label. > $cal_displayname_tmp .= " $calendar_lang"; > @@ -212,4 +256,4 @@ > } > } > return $return; > -} > \ No newline at end of file > +} > Index: functions/ical_parser.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ > ical_parser.php,v > retrieving revision 1.196 > diff -u -r1.196 ical_parser.php > --- functions/ical_parser.php 14 Sep 2005 00:42:32 -0000 1.196 > +++ functions/ical_parser.php 29 Oct 2005 05:49:15 -0000 > @@ -99,8 +99,7 @@ > foreach ($cal_filelist as $filename) { > > // Find the real name of the calendar. > - $actual_calname = str_replace($calendar_path, '', $filename); > - $actual_calname = str_replace('/', '', str_replace('.ics', '', > $actual_calname)); > + $actual_calname = getCalendarName($filename); > > if ($parse_file) { > > Index: functions/list_functions.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ > list_functions.php,v > retrieving revision 1.13 > diff -u -r1.13 list_functions.php > --- functions/list_functions.php 21 Oct 2004 20:15:14 -0000 1.13 > +++ functions/list_functions.php 29 Oct 2005 05:49:15 -0000 > @@ -2,12 +2,13 @@ > > function list_jumps() { > global $second_offset, $lang, $cal; > + $calName = getCalendarName($cal); > $today = date('Ymd', strtotime("now + $second_offset seconds")); > $return = '<option value="#">'.$lang['l_jump'].'</option>'; > - $return .= '<option value="day.php?cal='.$cal.'&getdate='. > $today.'">'.$lang['l_goday'].'</option>'; > - $return .= '<option value="week.php?cal='.$cal.'&getdate='. > $today.'">'.$lang['l_goweek'].'</option>'; > - $return .= '<option value="month.php?cal='. > $cal.'&getdate='.$today.'">'.$lang['l_gomonth'].'</option>'; > - $return .= '<option value="year.php?cal='.$cal.'&getdate='. > $today.'">'.$lang['l_goyear'].'</option>'; > + $return .= '<option value="day.php?cal='. > $calName.'&getdate='.$today.'">'.$lang['l_goday'].'</option>'; > + $return .= '<option value="week.php?cal='. > $calName.'&getdate='.$today.'">'.$lang['l_goweek'].'</option>'; > + $return .= '<option value="month.php?cal='. > $calName.'&getdate='.$today.'">'.$lang['l_gomonth'].'</option>'; > + $return .= '<option value="year.php?cal='. > $calName.'&getdate='.$today.'">'.$lang['l_goyear'].'</option>'; > return $return; > } > > Index: functions/template.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v > retrieving revision 1.75 > diff -u -r1.75 template.php > --- functions/template.php 15 Sep 2005 22:51:27 -0000 1.75 > +++ functions/template.php 29 Oct 2005 05:49:16 -0000 > @@ -21,7 +21,7 @@ > // Print Calendar Checkboxes > $COLUMNS_TO_PRINT = 3; > $column = 1; > - $filelist = availableCalendarNames('', '', '', true); > + $filelist = availableCalendars('', '', '', true); > foreach ($filelist as $file) { > if ($column > $COLUMNS_TO_PRINT) { > $delete_table .= '</tr>'; > @@ -31,7 +31,7 @@ > $delete_table .= '<tr>'; > } > > - $cal_filename_tmp = substr($file,0,-4); > + $cal_filename_tmp = getCalendarName($file); > $cal_tmp = urlencode($file); > $cal_displayname_tmp = str_replace("32", " ", > $cal_filename_tmp); > > Index: rss/index.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/rss/index.php,v > retrieving revision 1.37 > diff -u -r1.37 index.php > --- rss/index.php 7 Sep 2005 04:48:42 -0000 1.37 > +++ rss/index.php 29 Oct 2005 05:49:16 -0000 > @@ -19,12 +19,12 @@ > $current_view = "rssindex"; > $display_date = "RSS Info"; > > -$filelist = availableCalendarNames($username, $password, > $ALL_CALENDARS_COMBINED); > +$filelist = availableCalendars($username, $password, > $ALL_CALENDARS_COMBINED); > foreach ($filelist as $file) { > // $cal_filename is the filename of the calendar without .ics > // $cal is a urlencoded version of $cal_filename > // $cal_displayname is $cal_filename with occurrences of "32" > replaced with " " > - $cal_filename_tmp = substr($file,0,-4); > + $cal_filename_tmp = getCalendarName($file); > $cal_tmp = urlencode($cal_filename_tmp); > $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp); > $rss_list .= '<font class="V12" color="blue"><b>'. > $cal_displayname_tmp.' '. $calendar_lang.'</b></font><br />'; > @@ -75,4 +75,4 @@ > $page->output(); > > > -?> > \ No newline at end of file > +?> > Index: rss/rss.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/rss/rss.php,v > retrieving revision 1.27 > diff -u -r1.27 rss.php > --- rss/rss.php 5 Oct 2005 00:29:13 -0000 1.27 > +++ rss/rss.php 29 Oct 2005 05:49:17 -0000 > @@ -15,9 +15,6 @@ > die ("RSS feeds are not enabled on this site."); > } > > -$default_path = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].':'. > $HTTP_SERVER_VARS['SERVER_PORT'].substr($HTTP_SERVER_VARS > ['PHP_SELF'],0,strpos($HTTP_SERVER_VARS['PHP_SELF'],'/rss/')); > - > - > //set the range of days to return based on the view chosen > $rssview = $_GET['rssview']; > > > --Apple-Mail-6--212894681 > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; > charset=US-ASCII; > format=flowed > > > > --Apple-Mail-6--212894681-- > > > --__--__-- > > Message: 2 > To: php...@li... > From: Wesley Miaw <we...@we...> > Date: Sat, 29 Oct 2005 13:12:51 -0700 > Subject: [PHPiCalendar-DEV] Patch for 1305320/1304709 > Reply-To: php...@li... > > > --Apple-Mail-7--161767004 > Content-Transfer-Encoding: 7bit > Content-Type: text/plain; > charset=US-ASCII; > delsp=yes; > format=flowed > > Hi People, > > I know these bugs were assigned to Jared, but I wanted to get them > fixed. However, there are a few decisions in the previous code that I > could not figure out the purpose of. So please test this patch to see > if my logic changes have broken anything for you. They seem to be > working fine on my calendars. > > Thanks, > -- > Wesley Miaw > we...@we... > > > --Apple-Mail-7--161767004 > Content-Transfer-Encoding: 7bit > Content-Type: application/octet-stream; > x-mac-type=54455854; > x-unix-mode=0644; > name="todo.diff" > Content-Disposition: attachment; > filename=todo.diff > > Index: ical_parser.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ > ical_parser.php,v > retrieving revision 1.196 > diff -u -r1.196 ical_parser.php > --- ical_parser.php 14 Sep 2005 00:42:32 -0000 1.196 > +++ ical_parser.php 29 Oct 2005 20:12:18 -0000 > @@ -805,101 +804,17 @@ > // Start VTODO Parsing > // > case 'DUE': > - $data = str_replace ('/softwarestudio.org/ > Olson_20011030_5/', '', $data); > - $zulu_time = false; > - if (substr($data,-1) == 'Z') $zulu_time = > true; > - $data = str_replace('T', '', $data); > - $data = str_replace('Z', '', $data); > - if (preg_match("/^DUE;VALUE=DATE/i", > $field)) { > - $allday_start = $data; > - $start_date = $allday_start; > - $start_unixtime = strtotime($data); > - $due_date = date('Ymd', $start_unixtime); > - } else { > - if (preg_match("/^DUE;TZID=/i", > $field)) { > - $tz_tmp = explode('=', $field); > - $tz_due = $tz_tmp[1]; > - unset($tz_tmp); > - } elseif ($zulu_time) { > - $tz_due = 'GMT'; > - } > - > - ereg ('([0-9]{4})([0-9]{2})([0-9]{2}) > ([0-9]{0,2})([0-9]{0,2})', $data, $regs); > - $due_date = $regs[1] . $regs[2] . $regs > [3]; > - $due_time = $regs[4] . $regs[5]; > - $start_unixtime = mktime($regs[4], > $regs[5], 0, $regs[2], $regs[3], $regs[1]); > - > - $dlst = date('I', $start_unixtime); > - $server_offset_tmp = chooseOffset > ($start_unixtime); > - if (isset($tz_due)) { > - if (array_key_exists($tz_due, > $tz_array)) { > - $offset_tmp = $tz_array > [$tz_due][$dlst]; > - } else { > - $offset_tmp = '+0000'; > - } > - } elseif (isset($calendar_tz)) { > - if (array_key_exists($calendar_tz, > $tz_array)) { > - $offset_tmp = $tz_array > [$calendar_tz][$dlst]; > - } else { > - $offset_tmp = '+0000'; > - } > - } else { > - $offset_tmp = $server_offset_tmp; > - } > - $start_unixtime = calcTime > ($offset_tmp, $server_offset_tmp, $start_unixtime); > - $due_date = date('Ymd', $start_unixtime); > - $due_time = date('Hi', $start_unixtime); > - unset($server_offset_tmp); > - } > + $datetime = extractDateTime($data, > $property, $field); > + $due_date = $datetime[1]; > + $due_time = $datetime[2]; > break; > > case 'COMPLETED': > - $data = str_replace ('/softwarestudio.org/ > Olson_20011030_5/', '', $data); > - $zulu_time = false; > - if (substr($data,-1) == 'Z') $zulu_time = > true; > - $data = str_replace('T', '', $data); > - $data = str_replace('Z', '', $data); > - if (preg_match("/^COMPLETED;VALUE=DATE/i", > $field)) { > - $allday_start = $data; > - $start_date = $allday_start; > - } else { > - if (preg_match("/^COMPLETED;TZID=/i", > $field)) { > - $tz_tmp = explode('=', $field); > - $tz_completed = $tz_tmp[1]; > - unset($tz_tmp); > - } elseif ($zulu_time) { > - $tz_completed = 'GMT'; > - } > - > - ereg ('([0-9]{4})([0-9]{2})([0-9]{2}) > ([0-9]{0,2})([0-9]{0,2})', $data, $regs); > - $completed_date = $regs[1] . $regs > [2] . $regs[3]; > - $completed_time = $regs[4] . $regs[5]; > - $start_unixtime = mktime($regs[4], > $regs[5], 0, $regs[2], $regs[3], $regs[1]); > - > - $dlst = date('I', $start_unixtime); > - $server_offset_tmp = chooseOffset > ($start_unixtime); > - if (isset($tz_completed)) { > - if (array_key_exists > ($tz_completed, $tz_array)) { > - $offset_tmp = $tz_array > [$tz_completed][$dlst]; > - } else { > - $offset_tmp = '+0000'; > - } > - } elseif (isset($calendar_tz)) { > - if (array_key_exists($calendar_tz, > $tz_array)) { > - $offset_tmp = $tz_array > [$calendar_tz][$dlst]; > - } else { > - $offset_tmp = '+0000'; > - } > - } else { > - $offset_tmp = $server_offset_tmp; > - } > - $start_unixtime = calcTime > ($offset_tmp, $server_offset_tmp, $start_unixtime); > - $completed_date = date('Ymd', > $start_unixtime); > - $completed_time = date('Hi', > $start_unixtime); > - unset($server_offset_tmp); > - } > - break; > - > + $datetime = extractDateTime($data, > $property, $field); > + $completed_date = $datetime[1]; > + $completed_time = $datetime[2]; > + break; > + > case 'PRIORITY': > $vtodo_priority = "$data"; > break; > @@ -914,111 +829,24 @@ > > case 'CATEGORIES': > $vtodo_categories = "$data"; > - break; > + break; > // > // End VTODO Parsing > > case 'DTSTART': > - $data = str_replace ('/softwarestudio.org/ > Olson_20011030_5/', '', $data); > - $zulu_time = false; > - if (substr($data,-1) == 'Z') $zulu_time = > true; > - $data = str_replace('T', '', $data); > - $data = str_replace('Z', '', $data); > - $field = str_replace(';VALUE=DATE-TIME', > '', $field); > - if ((preg_match("/^DTSTART;VALUE=DATE/i", > $field)) || (ereg ('^([0-9]{4})([0-9]{2})([0-9]{2})$', $data))) { > - ereg ('([0-9]{4})([0-9]{2})([0-9] > {2})', $data, $dtstart_check); > - if ($dtstart_check[1] < 1970) { > - $data = '1971'.$dtstart_check[2]. > $dtstart_check[3]; > - } > - $allday_start = $data; > - $start_date = $allday_start; > - $start_unixtime = strtotime($data); > - } else { > - if (preg_match("/^DTSTART;TZID=/i", > $field)) { > - $tz_tmp = explode('=', $field); > - $tz_dtstart = $tz_tmp[1]; > - unset($tz_tmp); > - } elseif ($zulu_time) { > - $tz_dtstart = 'GMT'; > - } > - > - preg_match ('/([0-9]{4})([0-9]{2}) > ([0-9]{2})([0-9]{0,2})([0-9]{0,2})/', $data, $regs); > - if ($regs[1] < 1970) { > - $regs[1] = '1971'; > - } > - $start_date = $regs[1] . $regs[2] . > $regs[3]; > - $start_time = $regs[4] . $regs[5]; > - $start_unixtime = mktime($regs[4], > $regs[5], 0, $regs[2], $regs[3], $regs[1]); > - > - $dlst = date('I', $start_unixtime); > - $server_offset_tmp = chooseOffset > ($start_unixtime); > - if (isset($tz_dtstart)) { > - if (array_key_exists($tz_dtstart, > $tz_array)) { > - $offset_tmp = $tz_array > [$tz_dtstart][$dlst]; > - } else { > - $offset_tmp = '+0000'; > - } > - } elseif (isset($calendar_tz)) { > - if (array_key_exists($calendar_tz, > $tz_array)) { > - $offset_tmp = $tz_array > [$calendar_tz][$dlst]; > - } else { > - $offset_tmp = '+0000'; > - } > - } else { > - $offset_tmp = $server_offset_tmp; > - } > - $start_unixtime = calcTime > ($offset_tmp, $server_offset_tmp, $start_unixtime); > - $start_date = date('Ymd', > $start_unixtime); > - $start_time = date('Hi', > $start_unixtime); > - unset($server_offset_tmp, $offset_tmp, > $tz_dtstart); > - } > + $datetime = extractDateTime($data, > $property, $field); > + $start_unixtime = $datetime[0]; > + $start_date = $datetime[1]; > + $start_time = $datetime[2]; > + $allday_start = $datetime[3]; > break; > > case 'DTEND': > - $data = str_replace ('/softwarestudio.org/ > Olson_20011030_5/', '', $data); > - $zulu_time = false; > - if (substr($data,-1) == 'Z') $zulu_time = > true; > - $data = str_replace('T', '', $data); > - $data = str_replace('Z', '', $data); > - $field = str_replace(';VALUE=DATE-TIME', > '', $field); > - if (preg_match("/^DTEND;VALUE=DATE/i", > $field)) { > - preg_match ('/([0-9]{4})([0-9]{2}) > ([0-9]{2})/', $data, $dtend_check); > - if ($dtend_check[1] < 1970) { > - $data = '1971'.$dtend_check[2]. > $dtend_check[3]; > - } > - $allday_end = $data; > - } else { > - if (preg_match("/^DTEND;TZID=/i", > $field)) { > - $tz_tmp = explode('=', $field); > - $tz_dtend = $tz_tmp[1]; > - unset($tz_tmp); > - } elseif ($zulu_time) { > - $tz_dtend = 'GMT'; > - } > - > - preg_match ('/([0-9]{4})([0-9]{2}) > ([0-9]{2})([0-9]{0,2})([0-9]{0,2})/', $data, $regs); > - if ($regs[1] < 1970) { > - $regs[1] = '1971'; > - } > - $end_date = $regs[1] . $regs[2] . $regs > [3]; > - $end_time = $regs[4] . $regs[5]; > - $end_unixtime = mktime($regs[4], $regs > [5], 0, $regs[2], $regs[3], $regs[1]); > - > - $dlst = date('I', $end_unixtime); > - $server_offset_tmp = chooseOffset > ($end_unixtime); > - if (isset($tz_dtend)) { > - $offset_tmp = $tz_array[$tz_dtend] > [$dlst]; > - } elseif (isset($calendar_tz)) { > - $offset_tmp = $tz_array > [$calendar_tz][$dlst]; > - } else { > - $offset_tmp = $server_offset_tmp; > - } > - $end_unixtime = calcTime($offset_tmp, > $server_offset_tmp, $end_unixtime); > - $end_date = date('Ymd', $end_unixtime); > - $end_time = date('Hi', $end_unixtime); > - unset($server_offset_tmp, $offset_tmp, > $tz_dtend); > - > - } > + $datetime = extractDateTime($data, > $property, $field); > + $end_unixtime = $datetime[0]; > + $end_date = $datetime[1]; > + $end_time = $datetime[2]; > + $allday_end = $datetime[3]; > break; > > case 'EXDATE': > @@ -1042,6 +870,7 @@ > $data = str_replace("\\t", " ", $data); > $data = str_replace("\\r", "<br />", $data); > $data = str_replace('$', '$', $data); > + $data = stripslashes($data); > $data = htmlentities(urlencode($data)); > if ($valarm_set == FALSE) { > $summary = $data; > @@ -1055,6 +884,7 @@ > $data = str_replace("\\t", " ", $data); > $data = str_replace("\\r", "<br />", $data); > $data = str_replace('$', '$', $data); > + $data = stripslashes($data); > $data = htmlentities(urlencode($data)); > if ($valarm_set == FALSE) { > $description = $data; > @@ -1141,17 +971,18 @@ > case 'ATTENDEE': > $field = str_replace > ("ATTENDEE;CN=", "", $field); > $data = str_replace ("mailto:", > "", $data); > - $attendee[] = array ('name' => $field, > 'email' => $data); > + $attendee[] = array ('name' => stripslashes > ($field), 'email' => stripslashes($data)); > break; > case 'ORGANIZER': > $field = str_replace > ("ORGANIZER;CN=", "", $field); > $data = str_replace ("mailto:", > "", $data); > - $organizer[] = array ('name' => $field, > 'email' => $data); > + $organizer[] = array ('name' => > stripslashes($field), 'email' => stripslashes($data)); > break; > case 'LOCATION': > $data = str_replace("\\n", "<br />", $data); > $data = str_replace("\\t", " ", $data); > $data = str_replace("\\r", "<br />", $data); > + $data = stripslashes($data); > $location = $data; > break; > case 'URL': > Index: date_functions.php > =================================================================== > RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ > date_functions.php,v > retrieving revision 1.29 > diff -u -r1.29 date_functions.php > --- date_functions.php 15 Sep 2005 22:51:27 -0000 1.29 > +++ date_functions.php 29 Oct 2005 20:12:18 -0000 > @@ -206,4 +206,91 @@ > > return $return; > } > + > +// Returns an array of the date and time extracted from the data > +// passed in. This array contains (unixtime, date, time, allday). > +// > +// $data = A string representing a date-time per RFC2445. > +// $property = The property being examined, e.g. DTSTART, DTEND. > +// $field = The full field being examined, e.g. > DTSTART;TZID=US/Pacific > +function extractDateTime($data, $property, $field) { > + global $tz_array; > + > + // Initialize values. > + unset($unixtime, $date, $time, $allday); > + > + // What the heck is this doing in here? > + $data = str_replace ('/softwarestudio.org/Olson_20011030_5/', > '', $data); > + > + // Check for zulu time. > + $zulu_time = false; > + if (substr($data,-1) == 'Z') $zulu_time = true; > + $data = str_replace('Z', '', $data); > + > + // Remove some substrings we don't want to look at. > + $data = str_replace('T', '', $data); > + $field = str_replace(';VALUE=DATE-TIME', '', $field); > + > + // Extract date-only values. > + if ((preg_match('/^'.$property.';VALUE=DATE/i', $field)) || > (ereg ('^([0-9]{4})([0-9]{2})([0-9]{2})$', $data))) { > + // Pull out the date value. Minimum year is 1970. > + ereg ('([0-9]{4})([0-9]{2})([0-9]{2})', $data, $dt_check); > + if ($dt_check[1] < 1970) { > + $data = '1971'.$dt_check[2].$dt_check[3]; > + } > + > + // Set the values. > + $unixtime = strtotime($data); > + $date = date('Ymd', $unixtime); > + $allday = $data; > + } > + > + // Extract date-time values. > + else { > + // Pull out the timezone, or use GMT if zulu time was > indicated. > + if (preg_match('/^'.$property.';TZID=/i', $field)) { > + $tz_tmp = explode('=', $field); > + $tz_dt = $tz_tmp[1]; > + unset($tz_tmp); > + } elseif ($zulu_time) { > + $tz_dt = 'GMT'; > + } > + > + // Pull out the date and time values. Minimum year is 1970. > + preg_match ('/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{0,2}) > ([0-9]{0,2})/', $data, $regs); > + if ($regs[1] < 1970) { > + $regs[1] = '1971'; > + } > + $date = $regs[1] . $regs[2] . $regs[3]; > + $time = $regs[4] . $regs[5]; > + $unixtime = mktime($regs[4], $regs[5], 0, $regs[2], $regs > [3], $regs[1]); > + > + // Check for daylight savings time. > + $dlst = date('I', $unixtime); > + $server_offset_tmp = chooseOffset($unixtime); > + if (isset($tz_dt)) { > + if (array_key_exists($tz_dt, $tz_array)) { > + $offset_tmp = $tz_array[$tz_dt][$dlst]; > + } else { > + $offset_tmp = '+0000'; > + } > + } elseif (isset($calendar_tz)) { > + if (array_key_exists($calendar_tz, $tz_array)) { > + $offset_tmp = $tz_array[$calendar_tz][$dlst]; > + } else { > + $offset_tmp = '+0000'; > + } > + } else { > + $offset_tmp = $server_offset_tmp; > + } > + > + // Set the values. > + $unixtime = calcTime($offset_tmp, $server_offset_tmp, > $unixtime); > + $date = date('Ymd', $unixtime); > + $time = date('Hi', $unixtime); > + } > + > + // Return the results. > + return array($unixtime, $date, $time, $allday); > +} > ?> > > --Apple-Mail-7--161767004-- > > > > --__--__-- > > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > > > End of Phpicalendar-devel Digest > |
From: Chad L. <ch...@ch...> - 2005-10-30 00:05:33
|
You should have access to submit into CVS and I'd be happy to look at them then. I'm pretty poor using diffs. :) -C On Oct 29, 2005, at 1:12 PM, Wesley Miaw wrote: > Hi People, > > I know these bugs were assigned to Jared, but I wanted to get them > fixed. However, there are a few decisions in the previous code that > I could not figure out the purpose of. So please test this patch to > see if my logic changes have broken anything for you. They seem to > be working fine on my calendars. > > Thanks, > -- > Wesley Miaw > we...@we... > > > <todo.diff> > |
From: Wesley M. <we...@we...> - 2005-10-29 20:13:13
|
Hi People, I know these bugs were assigned to Jared, but I wanted to get them fixed. However, there are a few decisions in the previous code that I could not figure out the purpose of. So please test this patch to see if my logic changes have broken anything for you. They seem to be working fine on my calendars. Thanks, -- Wesley Miaw we...@we... |
From: Wesley M. <we...@we...> - 2005-10-29 06:00:51
|
Hi People, Been a long time since I last participated, but I finally did some work again. :P Attached is a diff of my tree that enables support for the new iCal- type directory structure and independently support for recursively finding calendars in subdirectories. I'd like people to give it a try and see if everything works for them still. If so, I'll commit the changes to CVS. I've submitted this diff file as a patch to SourceForge as a backup. I also completely removed the redefinition of $default_path from rss.php. I removed it because it was generating invalid URLs on my server. Why was it redefined in 1.24 to begin with? Later, -- Wesley Miaw we...@we... |
From: Chad L. <ch...@ch...> - 2005-10-28 04:23:11
|
Hello, We recently had a security hole announced and fixed. I highly urge all users of PHP iCalendar 2.0a - 2.0.1 to update immediately to PHP iCalendar 2.1 (released today). Please see our forums for the specific exploit. -C |
From: Chad L. <ch...@ch...> - 2005-09-16 00:54:11
|
Yeah its what I was thinking as well, go ahead and commit it and I'll come behind and style it a bit. I couldn't get the All Combined link to work inside the selector though, looked like an href formatting issue. -C On Sep 15, 2005, at 5:36 PM, David Fallon wrote: >> It might make sense to get rid of the single selector altogether >> and replace it with the multi-select. And then add a javascript >> button to toggle on all the calendars. >> > > If chad buys off on this, I'll do this. > > dave > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or > your very > own Sony(tm)PSP. Click here to play: http://sourceforge.net/ > geronimo.php > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > |
From: David F. <da...@d2...> - 2005-09-16 00:36:21
|
> It might make sense to get rid of the single selector altogether and > replace it with the multi-select. And then add a javascript button to > toggle on all the calendars. If chad buys off on this, I'll do this. dave |
From: Leon A. <leo...@cl...> - 2005-09-16 00:02:47
|
David Fallon wrote: > one (debatable) issue with the patch - the debatable part being why > I'm posting rather than just fixing. The selection box lists "all > combined", which is meaningless in that context. I can see an argument > for it being there, but since the pulldown to go to a specific > calendar or all is still there, it seems better to not have it. thoughts? > > I agree that it's meaningless there. If I remember correctly, it wasn't immediately obvious how to exclude it, so I left it for someone else to figure out. My goal was to put the framework in there and allow someone more intimate with the code to smooth out the rough edges. It might make sense to get rid of the single selector altogether and replace it with the multi-select. And then add a javascript button to toggle on all the calendars. Thanks, Leon |
From: David F. <da...@d2...> - 2005-09-15 23:32:38
|
one (debatable) issue with the patch - the debatable part being why I'm posting rather than just fixing. The selection box lists "all combined", which is meaningless in that context. I can see an argument for it being there, but since the pulldown to go to a specific calendar or all is still there, it seems better to not have it. thoughts? dave |
From: David F. <da...@d2...> - 2005-09-15 22:54:30
|
fixed, I just had to pass the right time through the openevent call. Makes the code not quite as nice, but it works. ;) Eventually, we should fix master_array to just be an array of cal+uids, and have some sort of schedule_array that has the rendered out time info, but this will work for now. dave Chad Little wrote: > Hi David, just a quick look at this its really great and lightens up > the code -- which is a big plus. Small bug though, it seems to fail on > the popup when the event doesn't start at 00 or 30. I've attached an > example, should be an easy fix if you have the time. If not let me know > and I can take a crack next week. > > Thanks! > -Chad > > > ------------------------------------------------------------------------ > > BEGIN:VCALENDAR > VERSION > :2.0 > PRODID > :-//Mozilla.org/NONSGML Mozilla Calendar V1.0//EN > BEGIN:VEVENT > UID > :bb1dfd22-2010-11da-b0c5-a1d3cf6ca8c3 > SUMMARY > :somthing here > LOCATION > :home > STATUS > :TENTATIVE > CLASS > :PRIVATE > X-MOZILLA-ALARM-DEFAULT-LENGTH > :0 > DTSTART > :20050909T223500 > DTEND > :20050909T233500 > DTSTAMP > :20050908T023152Z > END:VEVENT > BEGIN:VEVENT > UID > :dd728244-25a1-11da-ac6f-b813383d47aa > SUMMARY > :Welcome to somthing new > STATUS > :TENTATIVE > CLASS > :PUBLIC > X-MOZILLA-ALARM-DEFAULT-LENGTH > :0 > DTSTART > :20050916T003500 > DTEND > :20050916T013500 > DTSTAMP > :20050915T043318Z > END:VEVENT > BEGIN:VEVENT > UID > :c1fc0b42-25a2-11da-a540-96b008ecd756 > SUMMARY > :fafsdffffffffffffffff > DESCRIPTION > :asdffffffffffffffffffffffffffffffffffa\nasdffffffffffffffffffffffffffffffff > ffaasdffffffffffffffffffffffffffffffffffa\nasdfffffffffffffffffffffffffffff > fffffa\nasdffffffffffffffffffffffffffffffffffa\nasdfffffffffffffffffffffff > fffffffffffav\nv\nasdffffffffffffffffffffffffffffffffffa\nasdffffffffffff > ffffffffffffffffffffffa > LOCATION > :asdfffffffffffffffffffffffffff > STATUS > :CONFIRMED > CLASS > :PUBLIC > X-MOZILLA-ALARM-DEFAULT-LENGTH > :0 > DTSTART > :20050915T004000 > DTEND > :20050915T014000 > DTSTAMP > :20050915T043936Z > END:VEVENT > END:VCALENDAR > > > ------------------------------------------------------------------------ > > > > On May 5, 2005, at 12:54 PM, David Fallon wrote: > >> Attached is a borderline-2.0 worthy cleanup of openevent/event.php. >> It simplifies the function by changing the data-passing to use the >> date/time/uid to then lookup the event info in $master_array in >> event.php, instead of passing the raw data. It's possibly a precursor >> to even more cleanup of that whole process, by turning the popups >> into simple links instead of using the hidden form to pass data >> around. Note this assumes that the UIDs are unique across calendars, >> which seems to be a valid assumption given how $master_array is >> structured (if it's a bogus assumption, then events with the same >> $uid are going to be overwriting each other anyways). If this is >> valid, I should also clean up how todo.php works (amusingly, in a >> totally different fashion, using a base64- encoded get string. lends >> more validity to "the right way" being removing the hidden form stuff >> completely, but it's a big enough structure change I want to make >> sure there wasn't some other valid reason I just don't know about for >> doing it). >> >> This patch also fixes an actual bug - the event.php popup should have >> had the title be "$calname $lang['l_calendar']" - i.e., "US Holidays >> Calendar" - it was using the old translation syntax, and thus was >> just showing up as "US Holidays". >> >> Actually, this is probably worth going into 2.0, as I realized it's a >> decently-smaller HTML render, as now all the event info isn't >> included in the page for every event (twice). >> >> called openevent.patch >> >> look, diffstat says it's good! :) >> >> davef@rake-l:phpicalendar-working 539 > diffstat openevent.patch >> functions/date_functions.php | 38 ++++------- >> functions/draw_functions.php | 2 >> functions/event.js | 30 ++------ >> functions/ical_parser.php | 14 ++-- >> functions/template.php | 148 +++++++++++++++++ >> +------------------------- >> includes/event.php | 45 +++++-------- >> templates/default/event.tpl | 2 >> templates/default/header.tpl | 15 +--- >> 8 files changed, 118 insertions(+), 176 deletions(-) >> >> I'm also working on a post-2.0 enhancement that adds human-readable >> recurrence info to event.php. Cool feature, needs a decent amount >> more work to support all the various ways recurrence info could >> exist. I stuck the function that does this in ical_parser.php, which >> probably isn't right. Please let me know if you'd like to see the >> work-in-progress. >> >> dave >> Index: functions/date_functions.php >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ >> date_functions.php,v >> retrieving revision 1.26 >> diff -u -r1.26 date_functions.php >> --- functions/date_functions.php 26 Oct 2004 19:12:29 -0000 1.26 >> +++ functions/date_functions.php 5 May 2005 19:48:53 -0000 >> @@ -162,44 +162,38 @@ >> return $offset; >> } >> >> -function openevent($calendar_name, $start, $end, $arr, $lines, >> $wrap, $pre_text, $post_text, $link_class, $url) { >> +function openevent($event_date, $uid, $arr, $lines = 0, $length = 0, >> $link_class = '', $pre_text = '', $post_text = '') { >> + >> $event_text = stripslashes(urldecode($arr["event_text"])); >> if (empty($start)) { >> $title = $event_text; >> } else { >> - $title = $start.' - '.$end.': '.$event_text; >> + $title = $arr['event_start'].' - '.$arr['event_end'].': '. >> $event_text; >> } >> # for iCal pseudo tag <http> comptability >> - if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>",$event_text, >> $matches)) { >> - $full_event_text = $matches[1] . $matches[2]; >> + if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>",$event_text, >> $matches)) { >> + $full_event_text = $matches[1] . $matches[2]; >> $event_text = $matches[2]; >> - } else { >> + } else { >> $full_event_text = $event_text; >> $event_text = strip_tags($event_text, '<b><i><u>'); >> } >> >> - if (isset($arr["organizer"])) $organizer = addslashes($arr >> ["organizer"]); >> - if (isset($arr["attendee"])) $attendee = addslashes($arr >> ["attendee"]); >> - if (isset($arr["location"])) $location = addslashes($arr >> ["location"]); >> - if (isset($arr["status"])) $status = addslashes($arr["status"]); >> - if (isset($arr["description"])) $description = addslashes >> (stripslashes(urldecode($arr["description"]))); >> - if (isset($arr["url"])) $url = addslashes(stripslashes >> (urldecode($arr["url"]))); >> - >> - if (!empty($event_text)) { >> + if (!empty($event_text)) { >> if ($lines > 0) { >> - $event_text = word_wrap($event_text, $wrap, $lines); >> + $event_text = word_wrap($event_text, $length, $lines); >> } >> >> - if ((!(ereg("([[:alpha:]]+://[^<>[:space:]]+)", >> $full_event_text, $res))) || ($description)) { >> - $escaped_event = addslashes($full_event_text); >> - $escaped_calendar = addslashes($calendar_name); >> - $escaped_start = addslashes($start); >> - $escaped_end = addslashes($end); >> + if ((!(ereg("([[:alpha:]]+://[^<>[:space:]]+)", >> $full_event_text, $res))) || ($arr['description'])) { >> + $escaped_date = addslashes($event_date); >> + $escaped_time = addslashes($arr['event_start']); >> + if (!$escaped_time) $escaped_time = -1; >> + $escaped_uid = addslashes($uid); >> // fix for URL-length bug in IE: populate and submit a >> hidden form on click >> static $popup_data_index = 0; >> $return = " >> <script language=\"Javascript\" type=\"text/javascript\"><!-- >> - var eventData = new EventData('$escaped_event', >> '$escaped_calendar', '$escaped_start', '$escaped_end', >> '$description', '$status', '$location', '$organizer', '$attendee', >> '$url'); >> + var eventData = new EventData('$escaped_date', '$escaped_time', >> '$escaped_uid'); >> document.popup_data[$popup_data_index] = eventData; >> // --></script>"; >> >> @@ -210,9 +204,7 @@ >> } >> $return .= $pre_text.$event_text.$post_text.'</a>'."\n"; >> } >> - >> + >> return $return; >> } >> - >> - >> ?> >> Index: functions/draw_functions.php >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ >> draw_functions.php,v >> retrieving revision 1.5 >> diff -u -r1.5 draw_functions.php >> --- functions/draw_functions.php 20 May 2004 06:04:14 -0000 1.5 >> +++ functions/draw_functions.php 5 May 2005 19:48:53 -0000 >> @@ -46,4 +46,4 @@ >> } >> return $str; >> } >> -?> >> \ No newline at end of file >> +?> >> Index: functions/event.js >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/functions/event.js,v >> retrieving revision 1.13 >> diff -u -r1.13 event.js >> --- functions/event.js 12 Aug 2004 20:32:50 -0000 1.13 >> +++ functions/event.js 5 May 2005 19:48:53 -0000 >> @@ -4,16 +4,9 @@ >> // populate the hidden form >> var data = document.popup_data[num]; >> var form = document.forms.eventPopupForm; >> - form.elements.event.value = data.event; >> - form.elements.cal.value = data.cal; >> - form.elements.start.value = data.start; >> - form.elements.end.value = data.end; >> - form.elements.description.value = data.description; >> - form.elements.status.value = data.status; >> - form.elements.location.value = data.location; >> - form.elements.organizer.value = data.organizer; >> - form.elements.attendee.value = data.attendee; >> - form.elements.url.value = data.url; >> + form.elements.date.value = data.date; >> + form.elements.time.value = data.time; >> + form.elements.uid.value = data.uid; >> >> // open a new window >> var w = window.open('', 'Popup', >> 'scrollbars=yes,width=460,height=275'); >> @@ -21,17 +14,10 @@ >> form.submit(); >> } >> >> -function EventData(event, cal, start, end, description, status, >> location, organizer, attendee, url) { >> - this.event = event; >> - this.cal = cal; >> - this.start = start; >> - this.end = end; >> - this.description = description; >> - this.status = status; >> - this.location = location; >> - this.organizer = organizer; >> - this.attendee = attendee; >> - this.url = url; >> +function EventData(date, time, uid) { >> + this.date = date; >> + this.time = time; >> + this.uid = uid; >> } >> >> function openTodoInfo(vtodo_array) { >> @@ -45,4 +31,4 @@ >> >> document.popup_data = new Array(); >> //--> >> -</script> >> \ No newline at end of file >> +</script> >> Index: functions/ical_parser.php >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ ical_parser.php,v >> retrieving revision 1.186 >> diff -u -r1.186 ical_parser.php >> --- functions/ical_parser.php 9 Nov 2004 20:53:11 -0000 1.186 >> +++ functions/ical_parser.php 5 May 2005 19:48:54 -0000 >> @@ -462,7 +462,9 @@ >> $master_array[($start_date)] >> [($hour.$minute)][$uid]['recur'][$key] = $wkst; >> break; >> case 'END': >> - >> + >> + $recur = $master_array[($start_date)] >> [($hour.$minute)][$uid]['recur']; >> + >> // Modify the COUNT based on BYDAY >> if ((is_array($byday)) && (isset >> ($count))) { >> $blah = sizeof($byday); >> @@ -669,7 +671,7 @@ >> $end_time2 = >> strtotime('+'.$diff_allday_days.' days', $recur_data_time); >> while >> ($start_time2 < $end_time2) { >> $start_date2 >> = date('Ymd', $start_time2); >> - >> $master_array[($start_date2)][('-1')][] = array ('event_text' => >> $summary, 'description' => $description, 'location' => $location, >> 'organizer' => serialize($organizer), 'attendee' => serialize >> ($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname, >> 'url' => $url, 'status' => $status, 'class' => $class ); >> + >> $master_array[($start_date2)][('-1')][$uid] = array ('event_text' => >> $summary, 'description' => $description, 'location' => $location, >> 'organizer' => serialize($organizer), 'attendee' => >> serialize($attendee), 'calnumber' => $calnumber, 'calname' => >> $actual_calname, 'url' => $url, 'status' => $status, 'class' => >> $class, 'recur' => $recur ); >> $start_time2 >> = strtotime('+1 day', $start_time2); >> } >> } else { >> @@ -699,7 +701,7 @@ >> >> $until_check = $start_date_tmp.$time_tmp.'00'; >> if >> ($abs_until > $until_check) { >> >> $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, >> $end_time_tmp, $uid); >> - >> $master_array[$start_date_tmp][$time_tmp][$uid] = array >> ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, >> 'display_end' => $display_end_tmp, 'start_unixtime' => >> $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, >> 'event_text' => $summary, 'event_length' => $length, 'event_overlap' >> => $nbrOfOverlaps, 'description' => $description, 'status' => >> $status, 'class' => $class, 'spans_day' => true, 'location' => >> $location, 'organizer' => serialize($organizer), 'attendee' => >> serialize($attendee), 'calnumber' => $calnumber, 'calname' => >> $actual_calname, 'url' => $url) ; >> + >> $master_array[$start_date_tmp][$time_tmp][$uid] = array >> ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, >> 'display_end' => $display_end_tmp, 'start_unixtime' => >> $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, >> 'event_text' => $summary, 'event_length' => $length, 'event_overlap' >> => $nbrOfOverlaps, 'description' => $description, 'status' => >> $status, 'class' => $class, 'spans_day' => true, 'location' => >> $location, 'organizer' => serialize($organizer), 'attendee' => >> serialize($attendee), 'calnumber' => $calnumber, 'calname' => >> $actual_calname, 'url' => $url, 'recur' => $recur) ; >> } >> >> $start_tmp = strtotime('+1 day',$start_tmp); >> } >> @@ -715,7 +717,7 @@ >> $until_check >> = $recur_data_date.$hour.$minute.'00'; >> if >> ($abs_until > $until_check) { >> >> $nbrOfOverlaps = checkOverlap($recur_data_date, $start_time, >> $end_time_tmp1, $uid); >> - >> $master_array[($recur_data_date)][($hour.$minute)][$uid] = array >> ('event_start' => $start_time, 'event_end' => $end_time_tmp1, >> 'display_end' => $display_end_tmp, 'start_unixtime' => >> $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, >> 'event_text' => $summary, 'event_length' => $length, 'event_overlap' >> => $nbrOfOverlaps, 'description' => $description, 'status' => >> $status, 'class' => $class, 'spans_day' => false, 'location' => >> $location, 'organizer' => serialize($organizer), 'attendee' => >> serialize($attendee), 'calnumber' => $calnumber, 'calname' => >> $actual_calname, 'url' => $url); >> + >> $master_array[($recur_data_date)][($hour.$minute)][$uid] = array >> ('event_start' => $start_time, 'event_end' => $end_time_tmp1, >> 'display_end' => $display_end_tmp, 'start_unixtime' => >> $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, >> 'event_text' => $summary, 'event_length' => $length, 'event_overlap' >> => $nbrOfOverlaps, 'description' => $description, 'status' => >> $status, 'class' => $class, 'spans_day' => false, 'location' => >> $location, 'organizer' => serialize($organizer), 'attendee' => >> serialize($attendee), 'calnumber' => $calnumber, 'calname' => >> $actual_calname, 'url' => $url, 'recur' => $recur); >> } >> } >> } >> @@ -1176,7 +1178,7 @@ >> //print_r($overlap_array); >> //print_r($day_array); >> //print_r($rrule_array); >> -//print_r($recurrence_delete); >> +//print_r($recurrence_delete); >> //print '</pre>'; >> >> // Set a calender name for all calenders combined >> @@ -1185,5 +1187,5 @@ >> } >> >> $template_started = getmicrotime(); >> - >> + >> ?> >> Index: functions/template.php >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v >> retrieving revision 1.68 >> diff -u -r1.68 template.php >> --- functions/template.php 5 May 2005 07:07:50 -0000 1.68 >> +++ functions/template.php 5 May 2005 19:48:54 -0000 >> @@ -264,17 +264,15 @@ >> $loop_ad = trim($match1[1]); >> $loop_begin = trim($match2[1]); >> $loop_end = trim($match3[1]); >> - foreach ($weekarray as $key => $get_date) { >> + foreach ($weekarray as $get_date) { >> $replace = $loop_begin; >> $colspan = 'colspan="'.$nbrGridCols[$get_date].'"'; >> $replace = str_replace('{COLSPAN}', $colspan, >> $replace); >> if (is_array($master_array[$get_date]['-1'])) { >> - foreach ($master_array[$get_date]['-1'] as $allday) { >> + foreach ($master_array[$get_date]['-1'] as $uid => >> $allday) { >> $event_calno = $allday['calnumber']; >> - $event_calna = $allday['calname']; >> - $event_url = $allday['url']; >> if ($event_calno > $unique_colors) $event_calno >> = ($event_calno - $unique_colors); >> - $event = openevent($event_calna, '', >> '', $allday, 1, 11, '', '', 'psf', $event_url); >> + $event = openevent($get_date, $uid, >> $allday, 1, 11, 'psf'); >> $loop_tmp = str_replace('{ALLDAY}', >> $event, $loop_ad); >> $loop_tmp = str_replace('{CALNO}', >> $event_calno, $loop_tmp); >> $replace .= $loop_tmp; >> @@ -365,7 +363,7 @@ >> $thisday = date("Ymd", $thisdate); >> $dayborder = 0; >> unset($this_time_arr); >> - >> + >> if ($day_start == $cal_time && isset($master_array >> [$thisday]) && is_array($master_array[$thisday])) { >> foreach($master_array[$thisday] as $time_key => >> $time_arr) { >> if ((int)$time_key <= (int)$cal_time) { >> @@ -424,18 +422,17 @@ >> } else { >> $emptyWidth = $nbrGridCols[$thisday]; >> for ($i=0;$i<sizeof($event_length[$thisday]);$i >> ++) { >> - >> + >> $drawWidth = $nbrGridCols[$thisday] / >> ($event_length[$thisday][$i]["overlap"] + 1); >> $emptyWidth = $emptyWidth - $drawWidth; >> switch ($event_length[$thisday][$i] ["state"]) { >> case "begin": >> $event_length[$thisday][$i] ["state"] >> = "started"; >> - $event_start = $this_time_arr >> [($event_length[$thisday][$i]["key"])]['start_unixtime']; >> + $uid = $event_length[$thisday][$i] >> ["key"]; >> + $event_start = $this_time_arr >> [$uid]['start_unixtime']; >> $event_start = date >> ($timeFormat_small, $event_start); >> - $event_calno = $this_time_arr >> [($event_length[$thisday][$i]['key'])]['calnumber']; >> - $event_calna = $this_time_arr >> [($event_length[$thisday][$i]['key'])]['calname']; >> - $event_url = $this_time_arr >> [($event_length[$thisday][$i]['key'])]['url']; >> - $event_status = strtolower >> ($this_time_arr[($event_length[$thisday][$i]['key'])]['status']); >> + $event_calno = $this_time_arr >> [$uid]['calnumber']; >> + $event_status = strtolower >> ($this_time_arr[$uid]['status']); >> if ($event_calno > $unique_colors) >> $event_calno = ($event_calno - $unique_colors); >> if ($event_status != '') { >> $confirmed = '<img >> src="images/'.$event_status.'.gif" width="9" height="9" alt="" >> border="0" hspace="0" vspace="0" /> '; >> @@ -443,13 +440,9 @@ >> $colspan_width = round((80 / >> $nbrGridCols[$thisday]) * $drawWidth); >> $weekdisplay .= '<td width="'. >> $colspan_width.'" rowspan="' . $event_length[$thisday][$i] ['length'] >> . '" colspan="' . $drawWidth . '" align="left" valign="top" >> class="eventbg2_'.$event_calno.'">'."\n"; >> >> - $event_end = $this_time_arr >> [($event_length[$thisday][$i]["key"])]["end_unixtime"]; >> - if (isset($this_time_arr >> [($event_length[$thisday][$i]["key"])]['display_end'])) $event_end = >> strtotime ($this_time_arr[($event_length[$thisday][$i]["key"])] >> ['display_end']); >> - $event_end = date ($timeFormat, >> $event_end); >> - >> // Start drawing the event >> - $event_temp = $loop_event; >> - $event = openevent >> ($event_calna, $event_start, $event_end, $this_time_arr >> [($event_length[$thisday][$i]["key"])], $week_events_lines, 25, '', >> '', 'ps', $event_url); >> + $event_temp = $loop_event; >> + $event = openevent >> ($thisday, $uid, $this_time_arr[$uid], $week_events_lines, 25, 'ps'); >> $event_temp = str_replace >> ('{EVENT}', $event, $event_temp); >> $event_temp = str_replace >> ('{EVENT_START}', $event_start, $event_temp); >> $event_temp = str_replace >> ('{CONFIRMED}', $confirmed, $event_temp); >> @@ -457,7 +450,7 @@ >> $weekdisplay .= $event_temp; >> $weekdisplay .= '</td>'; >> // End event drawing >> - >> + >> break; >> case "started": >> break; >> @@ -482,34 +475,30 @@ >> } >> $weekdisplay .= "</tr>\n"; >> } >> - >> + >> $this->page = preg_replace('!<\!-- loop row on -->(.*)< \!-- >> loop event off -->!is', $weekdisplay, $this->page); >> - >> - >> - >> + >> } >> - >> + >> function draw_day($template_p) { >> global $template, $getdate, $cal, $master_array, >> $unique_colors, $daysofweek_lang, $week_start_day, >> $dateFormat_week_list, $current_view, $day_array, $timeFormat, >> $gridLength, $day_start; >> - >> + >> // Replaces the allday events >> $replace = ''; >> if (is_array($master_array[$getdate]['-1'])) { >> preg_match("!<\!-- loop allday on -->(.*)<\!-- loop >> allday off -->!is", $this->page, $match1); >> $loop_ad = trim($match1[1]); >> - foreach ($master_array[$getdate]['-1'] as $allday) { >> + foreach ($master_array[$getdate]['-1'] as $uid => >> $allday) { >> $event_calno = $allday['calnumber']; >> - $event_calna = $allday['calname']; >> - $event_url = $allday['url']; >> if ($event_calno > $unique_colors) $event_calno = >> ($event_calno - $unique_colors); >> - $event = openevent($event_calna, '', '', >> $allday, 0, '', '', '', '', $event_url); >> + $event = openevent($getdate, $uid, >> $allday); >> $loop_tmp = str_replace('{ALLDAY}', $event, >> $loop_ad); >> $loop_tmp = str_replace('{CALNO}', >> $event_calno, $loop_tmp); >> $replace .= $loop_tmp; >> } >> } >> $this->page = preg_replace('!<\!-- loop allday on -->(.*)< >> \!-- loop allday off -->!is', $replace, $this->page); >> - >> + >> // Replaces the daysofweek >> preg_match("!<\!-- loop daysofweek on -->(.*)<\!-- loop >> daysofweek off -->!is", $this->page, $match1); >> $loop_dof = trim($match1[1]); >> @@ -588,12 +577,12 @@ >> } >> } >> } else { >> - // add events that overlap the start time >> - if (isset($master_array[$getdate][$cal_time]) && sizeof >> ($master_array[$getdate][$cal_time]) > 0) { >> - $this_time_arr = $master_array[$getdate][$cal_time]; >> + // add events that overlap the start time >> + if (isset($master_array[$getdate][$cal_time]) && >> sizeof($master_array[$getdate][$cal_time]) > 0) { >> + $this_time_arr = $master_array[$getdate] >> [$cal_time]; >> + } >> } >> - } >> - >> + >> // check for eventstart >> if (isset($this_time_arr) && sizeof($this_time_arr) > 0) { >> foreach ($this_time_arr as $eventKey => $loopevent) { >> @@ -642,14 +631,15 @@ >> switch ($event_length[$i]['state']) { >> case 'begin': >> $event_length[$i]['state'] = 'started'; >> - $event_start = strtotime >> ($this_time_arr[($event_length[$i]['key'])]['event_start']); >> - $event_end = strtotime ($this_time_arr >> [($event_length[$i]['key'])]['event_end']); >> - if (isset($this_time_arr[($event_length >> [$i]['key'])]['display_end'])) $event_end = strtotime >> ($this_time_arr[($event_length[$i]['key'])]['display_end']); >> + $uid = $event_length[$i]['key']; >> + $event_start = strtotime >> ($this_time_arr[$uid]['event_start']); >> + $event_end = strtotime ($this_time_arr >> [$uid]['event_end']); >> + if (isset($this_time_arr[$uid] >> ['display_end'])) $event_end = strtotime ($this_time_arr[$uid] >> ['display_end']); >> $event_start = date ($timeFormat, >> $event_start); >> $event_end = date ($timeFormat, >> $event_end); >> - $event_calno = $this_time_arr >> [($event_length[$i]['key'])]['calnumber']; >> - $event_recur = $this_time_arr >> [($event_length[$i]['key'])]['recur']; >> - $event_status = strtolower($this_time_arr >> [($event_length[$i]['key'])]['status']); >> + $event_calno = $this_time_arr[$uid] >> ['calnumber']; >> + $event_recur = $this_time_arr[$uid] >> ['recur']; >> + $event_status = strtolower($this_time_arr >> [$uid]['status']); >> if ($event_calno > $unique_colors) >> $event_calno = ($event_calno - $unique_colors); >> if ($event_status != '') { >> $confirmed = '<img src="images/'. >> $event_status.'.gif" width="9" height="9" alt="" border="0" >> hspace="0" vspace="0" /> '; >> @@ -661,14 +651,12 @@ >> >> // Start drawing the event >> $event_temp = $loop_event; >> - $event_calna = $this_time_arr >> [($event_length[$i]['key'])]['calname']; >> - $event_url = $this_time_arr >> [($event_length[$i]['key'])]['url']; >> - $event = openevent($event_calna, >> $event_start, $event_end, $this_time_arr[($event_length[$i] ['key'])], >> '', 0, '', '', 'ps', $event_url); >> - $event_temp = str_replace('{EVENT}', >> $event, $event_temp); >> - $event_temp = str_replace >> ('{EVENT_START}', $event_start, $event_temp); >> - $event_temp = str_replace ('{EVENT_END}', >> $event_end, $event_temp); >> - $event_temp = str_replace ('{CONFIRMED}', >> $confirmed, $event_temp); >> - $event_temp = str_replace >> ('{EVENT_CALNO}', $event_calno, $event_temp); >> + $event = openevent($getdate, $uid, >> $this_time_arr[$uid], 0, 0, 'ps'); >> + $event_temp = str_replace('{EVENT}', >> $event, $event_temp); >> + $event_temp = str_replace >> ('{EVENT_START}', $event_start, $event_temp); >> + $event_temp = str_replace ('{EVENT_END}', >> $event_end, $event_temp); >> + $event_temp = str_replace ('{CONFIRMED}', >> $confirmed, $event_temp); >> + $event_temp = str_replace >> ('{EVENT_CALNO}', $event_calno, $event_temp); >> $daydisplay .= $event_temp; >> $daydisplay .= '</td>'; >> // End event drawing >> @@ -711,40 +699,34 @@ >> $loop_t_e = trim($match2[1]); >> $return_adtmp = ''; >> $return_etmp = ''; >> - >> + >> if (is_array($master_array[$next_day]) && sizeof >> ($master_array[$next_day]) > 0) { >> foreach ($master_array[$next_day] as $event_times) { >> - foreach ($event_times as $val) { >> + foreach ($event_times as $uid => $val) { >> $event_text = stripslashes(urldecode($val >> ["event_text"])); >> $event_text = strip_tags($event_text, '<b><i><u>'); >> - if ($event_text != "") { >> - $event_calna = $val["calname"]; >> - $event_url = $val["url"]; >> - $event_start = date ($timeFormat, $val >> ["start_unixtime"]); >> - $event_end = date ($timeFormat, >> $val["end_unixtime"]); >> - if (!isset($val["event_start"])) { >> - $event_start = $lang['l_all_day']; >> - $event_end = ''; >> - $return_adtmp = openevent ($event_calna, >> $event_start, $event_end, $val, $tomorrows_events_lines, 21, '', '', >> 'psf', $event_url); >> - $replace_ad .= str_replace >> ('{T_ALLDAY}', $return_adtmp, $loop_t_ad); >> - } else { >> - $return_etmp = openevent >> ($event_calna, $event_start, $event_end, $val, >> $tomorrows_events_lines, 21, '', '', 'ps3', $event_url); >> - $replace_e .= str_replace >> ('{T_EVENT}', $return_etmp, $loop_t_e); >> + if ($event_text != "") { >> + if (!isset($val["event_start"])) { >> + $return_adtmp = openevent($next_day, >> $uid, $val, $tomorrows_events_lines, 21, 'psf'); >> + $replace_ad .= str_replace >> ('{T_ALLDAY}', $return_adtmp, $loop_t_ad); >> + } else { >> + $return_etmp = openevent($next_day, >> $uid, $val, $tomorrows_events_lines, 21, 'ps3'); >> + $replace_e .= str_replace ('{T_EVENT}', >> $return_etmp, $loop_t_e); >> } >> } >> } >> } >> - >> + >> $this->page = preg_replace('!<\!-- switch t_allday on >> -->(.*)<\!-- switch t_allday off -->!is', $replace_ad, $this->page); >> $this->page = preg_replace('!<\!-- switch t_event on -- >> >(.*)<\!-- switch t_event off -->!is', $replace_e, $this->page); >> - >> + >> } else { >> - >> + >> $this->page = preg_replace('!<\!-- switch >> tomorrows_events on -->(.*)<\!-- switch tomorrows_events off -->! is', >> '', $this->page); >> - >> + >> } >> } >> - >> + >> function get_vtodo() { >> global $template, $getdate, $master_array, $next_day, >> $timeFormat, $tomorrows_events_lines, $show_completed, $show_todos; >> >> @@ -891,28 +873,22 @@ >> if ($master_array[$daylink]) { >> if ($type != 'small') { >> foreach ($master_array[$daylink] as $event_times) { >> - foreach ($event_times as $val) { >> + foreach ($event_times as $uid => $val) { >> $event_calno = $val['calnumber']; >> if ($event_calno > $unique_colors) >> $event_calno = ($event_calno - $unique_colors); >> - $event_calna = $val['calname']; >> - $event_url = $val['url']; >> if (!isset($val['event_start'])) { >> if ($type == 'large') { >> $switch['ALLDAY'] .= '<div >> class="V10"><img src="templates/'.$template.'/images/monthdot_'. >> $event_calno.'.gif" alt="" width="9" height="9" border="0" />'; >> - $switch['ALLDAY'] .= openevent >> ($event_calna, '', '', $val, $month_event_lines, 15, '', '', 'psf', >> $event_url); >> + $switch['ALLDAY'] .= openevent >> ($daylink, $uid, $val, $month_event_lines, 15, 'psf'); >> $switch['ALLDAY'] .= '</div>'; >> } else { >> $switch['ALLDAY'] .= '<img >> src="templates/'.$template.'/images/allday_dot.gif" alt=" " >> width="11" height="10" border="0" />'; >> } >> } else { >> - $event_start = $val ['start_unixtime']; >> - $event_end = (isset($val >> ['display_end'])) ? $val['display_end'] : $val["event_end"]; >> - $event_start = date($timeFormat, >> $val['start_unixtime']); >> $start2 = date >> ($timeFormat_small, $val['start_unixtime']); >> - $event_end = date($timeFormat, >> @strtotime ($event_end)); >> if ($type == 'large') { >> $switch['EVENT'] .= '<div >> class="V9"><img src="templates/'.$template.'/images/monthdot_'. >> $event_calno.'.gif" alt="" width="9" height="9" border="0" />'; >> - $switch['EVENT'] .= openevent >> ($event_calna, $event_start, $event_end, $val, $month_event_lines, >> 10, "$start2 ", '', 'ps3', $event_url).'<br />'; >> + $switch['EVENT'] .= openevent >> ($daylink, $uid, $val, $month_event_lines, 10, 'ps3', "$start2 >> ").'<br />'; >> $switch['EVENT'] .= '</div>'; >> } else { >> $switch['EVENT'] = '<img >> src="templates/'.$template.'/images/event_dot.gif" alt=" " width="11" >> height="10" border="0" />'; >> @@ -971,22 +947,22 @@ >> foreach ($master_array[$m_start] as $event_times) { >> $switch['CAL'] = $cal; >> $switch['START_DATE'] = localizeDate >> ($dateFormat_week_list, $u_start); >> - foreach ($event_times as $val) { >> + foreach ($event_times as $uid => $val) { >> $switch['CALNAME'] = $val['calname']; >> - $switch['URL'] = $val['url']; >> if (!isset($val['event_start'])) { >> $switch['START_TIME'] = $lang >> ['l_all_day']; >> + $switch['EVENT_TEXT'] = openevent >> ($m_start, $uid, $val, $month_event_lines, 15, 'psf'); >> $switch['DESCRIPTION'] = urldecode >> ($val['description']); >> - $switch['EVENT_TEXT'] = openevent >> ($switch['CALNAME'], '', '', $val, $month_event_lines, 15, '', '', >> 'psf', $switch['URL']); >> - } else { >> + } else { >> $event_start = $val['start_unixtime']; >> $event_end = (isset($val >> ['display_end'])) ? $val['display_end'] : $val["event_end"]; >> $event_start = date($timeFormat, $val >> ['start_unixtime']); >> $event_end = date($timeFormat, >> @strtotime ($event_end)); >> $switch['START_TIME'] = $event_start >> . ' - ' . $event_end; >> - $switch['EVENT_TEXT'] = openevent >> ($switch['CALNAME'], $event_start, $event_end, $val, 0, 15, '', '', >> 'psf', $switch['URL']); >> + $switch['EVENT_TEXT'] = openevent >> ($m_start, $uid, $val, 0, 15, 'psf'); >> $switch['DESCRIPTION'] = urldecode >> ($val['description']); >> } >> + >> if ($switch['EVENT_TEXT'] != '') { >> $switch['DAYLINK'] = $m_start; >> $temp = $loop[$i]; >> @@ -1004,11 +980,11 @@ >> $check_month = date('m', $u_start); >> unset ($switch); >> } while ($this_month == $check_month); >> - >> + >> $this->page = preg_replace('!<\!-- loop showbottomevents_odd >> on -->(.*)<\!-- loop showbottomevents_even off -->!is', $middle, >> $this->page); >> - >> + >> } >> - >> + >> function Page($template = 'std.tpl') { >> if (file_exists($template)) >> $this->page = join('', file($template)); >> Index: includes/event.php >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/includes/event.php,v >> retrieving revision 1.30 >> diff -u -r1.30 event.php >> --- includes/event.php 2 Sep 2004 18:41:13 -0000 1.30 >> +++ includes/event.php 5 May 2005 19:48:54 -0000 >> @@ -1,6 +1,8 @@ >> <?php >> define('BASE', '../'); >> +$getdate = $_POST['date']; >> include_once(BASE.'functions/init.inc.php'); >> +include_once(BASE.'functions/ical_parser.php'); >> require_once(BASE.'functions/template.php'); >> >> function decode_popup ($item) { >> @@ -9,29 +11,20 @@ >> return $item; >> } >> >> -$event = (isset($_POST['event'])) ? decode_popup($_POST >> ['event']) : (''); >> -$description = (isset($_POST['description'])) ? decode_popup >> ($_POST['description']) : (''); >> -$cal = (isset($_POST['cal'])) ? decode_popup($_POST >> ['cal']) : (''); >> -$start = (isset($_POST['start'])) ? decode_popup($_POST >> ['start']) : (''); >> -$end = (isset($_POST['end'])) ? decode_popup($_POST >> ['end']) : (''); >> -$status = (isset($_POST['status'])) ? decode_popup >> ($_POST['status']) : (''); >> -$location = (isset($_POST['location'])) ? decode_popup >> ($_POST['location']) : (''); >> -$url = (isset($_POST['url'])) ? decode_popup($_POST >> ['url']) : (''); >> -$organizer = (isset($_POST['organizer'])) ? ($_POST >> ['organizer']) : (''); >> -$organizer = unserialize (decode_popup ($organizer)); >> -$attendee = (isset($_POST['attendee'])) ? ($_POST >> ['attendee']) : (''); >> -$attendee = unserialize (decode_popup ($attendee)); >> -$cal_title_full = $cal.' '.$calendar_lang; >> +$event = $master_array[$_POST['date']][$_POST['time']] >> [decode_popup($_POST['uid'])]; >> +$organizer = unserialize($event['organizer']); >> +$attendee = unserialize($event['attendee']); >> >> // Format event time >> -if (($start) && ($end)) { >> - $event_times = $start . ' - ' . $end; >> -} >> -if ($start == '' && $end == '' && (isset($start) && isset($end))) { >> +// All day >> +if ($_POST['time'] == -1) { >> $event_times = $lang['l_all_day']; >> +} else { >> + $event_times = date($timeFormat, $event['start_unixtime']) . ' - >> ' . date($timeFormat, $event['end_unixtime']); >> } >> >> -if ($description) $description = ereg_replace("[[:alpha:]]+://[^<> >> [:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>', >> $description); >> +if ($event['description']) $event['description'] = ereg_replace >> ("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" >> href="\0">\0</a>',$event['description']); >> + >> if (is_array($organizer)) { >> $i=0; >> $display .= $organizer_lang . ' - '; >> @@ -51,8 +44,8 @@ >> $attendee = substr($attendees,0,-2); >> } >> >> -if ($location) { >> - if ($url != '') $location = '<a href="'.$url.'" >> target="_blank">'.$location.'</a>'; >> +if ($event['location']) { >> + if ($event['url'] != '') $event['location'] = '<a href="'. >> $event['url'].'" target="_blank">'.$event['location'].'</a>'; >> } >> >> if (sizeof($attendee) == 0) $attendee = ''; >> @@ -61,15 +54,15 @@ >> $page = new Page(BASE.'templates/'.$template.'/event.tpl'); >> > >> $page->replace_tags(array( >> - 'cal' => $cal, >> - 'event' => $event, >> + 'cal' => $event['calname'], >> + 'event_text' => urldecode($event['event_text']), >> 'event_times' => $event_times, >> - 'description' => $description, >> + 'description' => $event['description'], >> 'organizer' => $organizer, >> 'attendee' => $attendee, >> - 'status' => $status, >> - 'location' => $location, >> - 'cal_title_full' => $cal_title_full, >> + 'status' => $event['status'], >> + 'location' => $event['location'], >> + 'cal_title_full' => $event['calname'].' '.$lang['l_calendar'], >> 'template' => $template, >> 'l_organizer' => $lang['l_organizer'], >> 'l_attendee' => $lang['l_attendee'], >> Index: templates/default/event.tpl >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/templates/default/ >> event.tpl,v >> retrieving revision 1.8 >> diff -u -r1.8 event.tpl >> --- templates/default/event.tpl 31 Oct 2004 19:50:15 -0000 1.8 >> +++ templates/default/event.tpl 5 May 2005 19:48:54 -0000 >> @@ -15,7 +15,7 @@ >> <tr> >> <td align="left" class="V12"> >> <div style="margin-left: 10px; margin-bottom:10px;"> >> - <p>{EVENT} - <span class="V9">(<i>{EVENT_TIMES} >> </i>)</span></p> >> + <p>{EVENT_TEXT} - <span class="V9">(<i> >> {EVENT_TIMES}</i>)</span></p> >> <!-- switch description on --> >> <p>{DESCRIPTION}</p> >> <!-- switch description off --> >> Index: templates/default/header.tpl >> =================================================================== >> RCS file: /cvsroot/phpicalendar/phpicalendar/templates/default/ >> header.tpl,v >> retrieving revision 1.10 >> diff -u -r1.10 header.tpl >> --- templates/default/header.tpl 12 Aug 2004 20:32:50 -0000 1.10 >> +++ templates/default/header.tpl 5 May 2005 19:48:54 -0000 >> @@ -12,14 +12,7 @@ >> </head> >> <body> >> <form name="eventPopupForm" id="eventPopupForm" method="post" >> action="includes/event.php" style="display: none;"> >> - <input type="hidden" name="event" id="event" value="" /> >> - <input type="hidden" name="cal" id="cal" value="" /> >> - <input type="hidden" name="start" id="start" value="" /> >> - <input type="hidden" name="end" id="end" value="" /> >> - <input type="hidden" name="description" id="description" value="" /> >> - <input type="hidden" name="status" id="status" value="" /> >> - <input type="hidden" name="location" id="location" value="" /> >> - <input type="hidden" name="organizer" id="organizer" value="" /> >> - <input type="hidden" name="attendee" id="attendee" value="" /> >> - <input type="hidden" name="url" id="url" value="" /> >> -</form> >> \ No newline at end of file >> + <input type="hidden" name="date" id="date" value="" /> >> + <input type="hidden" name="time" id="time" value="" /> >> + <input type="hidden" name="uid" id="uid" value="" /> >> +</form> >> > |
From: Chad L. <ch...@ch...> - 2005-09-15 22:00:39
|
Hi David, just a quick look at this its really great and lightens up the code -- which is a big plus. Small bug though, it seems to fail on the popup when the event doesn't start at 00 or 30. I've attached an example, should be an easy fix if you have the time. If not let me know and I can take a crack next week. Thanks! -Chad |
From: Richard B. <ra...@xs...> - 2005-09-14 21:20:15
|
Op woensdag 14 september 2005 23:19, schreef Richard Bos: > That is could news :)) Ahum, that should be "good news"... -- Richard Bos Without a home the journey is endless |