From: Jim Hu <ji...@ta...> - 2005-02-26 06:53:03
|
I did that patch in the most recent CVS. cpath is a parameter added to several of the files in the CVS...it lets you keep calendars in different subdirectories, and it's unrelated to the patch for date ranges. I think I need to figure out how to handle that - probably the code should test for whether cpath is defined and only add to the $_GET vars passed if it is. I guess I missed it because I never use the links. You should be able to just edit out the &cpath= in line 133. Jim Hu p.s. Here's an example of how I use phpicalendar and magpie to generate a page with a range of events...it's why I did the patch in the first place. Here's the page: http://molbio.tamu.edu/index.php?linkname=Home&content=seminars Here's the key section of the php code: <?php require_once ("magpierss-0.71/rss_fetch.inc"); $thisyear = date("Y") * 10000; $thismonth = date("n"); $fromdate = $thisyear + 101; $todate = $thisyear + 515; if ($thismonth > 4) { $fromdate = $thisyear + 401; $todate = $thisyear + 831; } if ($thismonth > 7) { $fromdate = $thisyear + 801; $todate = $thisyear + 1231; } $url = "http://dimer.tamu.edu/phpicalendar-2.0a/rss/rss.php? cpath=seminars&rssview=range&from=$fromdate&to=$todate"; #print "url:$url<br>\n"; $rss = fetch_rss( $url ); echo "<h2> " . $rss->channel['title'] . "</h2>"; foreach ($rss->items as $item) { $href = $item['link']; $title = $item['title']; #title of the rss feed item - not the seminar title $seminardate = $item['seminardate']; $seminarspeaker = stripslashes(urldecode($item['seminarspeaker'])); $seminartitle = $item['seminartitle']; $time = $item['event_start']; $location = $item['location']; $status = $item['status']; $seminarhost = $item['seminarhost']; $temp = explode('"',$seminarhost); $host = $temp[4]; if (strpos($temp[9],'@') > 0){ $host.=" (".$temp[9].")"; } if ($title == 'No events found'){ print "No Seminars in the Calendar for this period - check back later"; }else{ echo " <tr> <td height='19' bgcolor= '#FFFFFF'><p><font color='#660000' size='2'> <strong>$seminardate $time $status</strong></font>$location<font size='2'><br> Speaker:$seminarspeaker<br> Title: $seminartitle<br> Host: $host</font></p> </td> </tr> "; } } ?> On Feb 25, 2005, at 10:15 PM, php...@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: phpicalendar lite (Ben Francis) > 2. Re: phpicalendar lite (Blaine Cook) > 3. Re: phpicalendar lite (Ben Francis) > 4. Re: phpicalendar lite (Greg Westin) > > --__--__-- > > Message: 1 > Date: Fri, 25 Feb 2005 14:43:40 +0000 > From: Ben Francis <li...@hi...> > To: php...@li... > Subject: Re: [PHPiCalendar-DEV] phpicalendar lite > Reply-To: php...@li... > > Chad Little wrote: > >> It is fairly modular. If you know PHP arrays it is very simple. At the >> end of ical_parser are some comment tags, uncomment the $master_array >> and you will see our structure. Each page (day, week, month, ect) is >> simply a different manipulation of this array. > > ===Aim=== > > I'm also working on a kind of "phpicalendar lite" as mentioned > previously on the list but I called it content management. > > I want to be able to generate a web page showing the next few events > coming up with a title, description, start date and time, end date and > time if applicable and which calendar they've come from. > > ===Problems=== > > I'm struggling a little with manipulating the master_array returned by > ical_parser.php. It would make more sense in my head if I could get > from the multidimensional format of the master_array which is something > like... > > [20050222] => Array > ( > [1600] => Array > ( > [8D69CBD9-8664-11D9-8CFA-000D936C280E-RID] => Array > ( > [event_start] => 1600 > [event_end] => 1700 > [display_end] => > [start_unixtime] => 1109088000 > [end_unixtime] => 1109091600 > [event_text] => Recurring+Event > [event_length] => 3600 > [event_overlap] => 0 > [description] => > [status] => > [class] => > [spans_day] => > [location] => > [organizer] => a:0:{} > [attendee] => a:0:{} > [calnumber] => 1 > [calname] => exhibitions > [url] => > [recur] => Array > ( > [FREQ] => daily > [INTERVAL] => 1 > [UNTIL] => February 25 > ) > > ) > > ) > > > to something more like a flat table.... > > > [8D69CBD9-8664-11D9-8CFA-000D936C280E-RID] => Array > ( > [event_text] => Recurring+Event > [start_date] => 20050222 > [end_date] => 20050225 > [start_time] => 1600 > [end_time] => 1700 > [calname] => exhibitions > ) > > > This might be similar to what the draw_print function in > functions/template.php does, but... well I don't understand it! > > My main problems are: > 1) A recurring event only needs to appear once > 2) I need to get an end date for recurring events > 3) My skills with PHP arrays are very limited. > > > ===Other Questions=== > > 1) What are the dependencies of the ical_parser.php file? Does it rely > on any files other than init.incs.php, date_functions.php, > draw_functions.php, overlapping_events.php and timezones.php? If not, > can I use the functions directory on its own without the rest of > phpicalendar in an entirely separate directory? > > 2) I'd really like to be able to associate images with events and I'm > not sure how to achieve this. Perhaps I could create a directory of > images with the directory name matching the UID of the events. Or > perhaps I should generate a MySQL database from the .ics file with UIDs > and fields for image paths. I could even create a table from the array > I'm trying to create and store all the calendar data in the database to > increase the speed of execution. > > > There's a good chance I'm approaching this in entirely the wrong way. > If > so, please put me out of my misery! > > Thanks > > tola > > -- > Ben "tola" Francis http://hippygeek.co.uk > ---------------------------------------------------- > COMPUTER SUPPORT for small businesses and home users > http://tolatech.co.uk > ---------------------------------------------------- > > > > --__--__-- > > Message: 2 > From: Blaine Cook <la...@us...> > Subject: Re: [PHPiCalendar-DEV] phpicalendar lite > Date: Fri, 25 Feb 2005 10:35:14 -0800 > To: php...@li... > Reply-To: php...@li... > > There was a recently applied patch to the RSS feeds that allows you to > get an arbitrary x days; if you're using PHP (as I assume you are), use > MagpieRSS ( http://magpierss.sf.net ) to fetch the RSS feeds, and you > have exactly what you're looking for, available at almost zero > dependency cost within whatever code you're working on. > > If that still doesn't make sense, let me know and I'll post some > running code. > > b. > > On Feb 25, 2005, at 6:43 AM, Ben Francis wrote: > >> ===Aim=== >> >> I'm also working on a kind of "phpicalendar lite" as mentioned >> previously on the list but I called it content management. >> >> I want to be able to generate a web page showing the next few events >> coming up with a title, description, start date and time, end date and >> time if applicable and which calendar they've come from. >> >> ===Problems=== >> >> I'm struggling a little with manipulating the master_array returned by >> ical_parser.php. It would make more sense in my head if I could get >> from the multidimensional format of the master_array which is >> something like... >> >> [20050222] => Array >> ( >> ... >> to something more like a flat table.... >> >> [8D69CBD9-8664-11D9-8CFA-000D936C280E-RID] => Array >> ( >> ... >> >> ===Other Questions=== >> >> 1) What are the dependencies of the ical_parser.php file? Does it rely >> on any files other than init.incs.php, date_functions.php, >> draw_functions.php, overlapping_events.php and timezones.php? If not, >> can I use the functions directory on its own without the rest of >> phpicalendar in an entirely separate directory? >> >> 2) I'd really like to be able to associate images with events and I'm >> not sure how to achieve this. Perhaps I could create a directory of >> images with the directory name matching the UID of the events. Or >> perhaps I should generate a MySQL database from the .ics file with >> UIDs and fields for image paths. I could even create a table from the >> array I'm trying to create and store all the calendar data in the >> database to increase the speed of execution. >> >> There's a good chance I'm approaching this in entirely the wrong way. >> If so, please put me out of my misery! >> >> Thanks >> >> tola > > > > --__--__-- > > Message: 3 > Date: Fri, 25 Feb 2005 20:44:26 +0000 > From: Ben Francis <li...@hi...> > To: php...@li... > Subject: Re: [PHPiCalendar-DEV] phpicalendar lite > Reply-To: php...@li... > > Blaine Cook wrote: > >> There was a recently applied patch to the RSS feeds that allows you to >> get an arbitrary x days; if you're using PHP (as I assume you are), >> use MagpieRSS ( http://magpierss.sf.net ) to fetch the RSS feeds, and >> you have exactly what you're looking for, available at almost zero >> dependency cost within whatever code you're working on. > > Wow, I really hadn't thought of using RSS, what a good idea! What does > MagpieRSS do with the feed exactly? Does it output an array? > >> >> If that still doesn't make sense, let me know and I'll post some >> running code. > > I'll have a proper look when I get chance but I will probably be back > to > ask for some hints at least! > > Also, can you think of any way of permenantly associating images with > events in this way? Or at least a unique ID for each event so I can use > that to refer to images with. > > Many Thanks for this > > tola > > -- > Ben "tola" Francis http://hippygeek.co.uk > ---------------------------------------------------- > COMPUTER SUPPORT for small businesses and home users > http://tolatech.co.uk > ---------------------------------------------------- > > > > --__--__-- > > Message: 4 > Date: Fri, 25 Feb 2005 17:08:10 -0600 (CST) > From: Greg Westin <php...@gr...> > To: php...@li... > Subject: Re: [PHPiCalendar-DEV] phpicalendar lite > Reply-To: php...@li... > > Running MagpieRSS, I noticed that the 'link' parameters don't seem to > work. They come out ending with cpath= , rather than pointing to a > particular event. Is that a problem with something on my end, or with > PHPiCalendar? Maybe I'm misunderstanding the purpose of the link > parameter. > > Greg Westin > -- > http://www.gregwestin.com > Contact info: http://www.gregwestin.com/contact.php > > On Feb 25, 2005, at 12:35 PM, Blaine Cook wrote: > >> There was a recently applied patch to the RSS feeds that allows you to >> get an arbitrary x days; if you're using PHP (as I assume you are), >> use MagpieRSS ( http://magpierss.sf.net ) to fetch the RSS feeds, and >> you have exactly what you're looking for, available at almost zero >> dependency cost within whatever code you're working on. >> >> If that still doesn't make sense, let me know and I'll post some >> running code. >> >> b. >> >> On Feb 25, 2005, at 6:43 AM, Ben Francis wrote: >> >>> ===Aim=== >>> >>> I'm also working on a kind of "phpicalendar lite" as mentioned >>> previously on the list but I called it content management. >>> >>> I want to be able to generate a web page showing the next few events >>> coming up with a title, description, start date and time, end date >>> and time if applicable and which calendar they've come from. >>> >>> ===Problems=== >>> >>> I'm struggling a little with manipulating the master_array returned >>> by ical_parser.php. It would make more sense in my head if I could >>> get from the multidimensional format of the master_array which is >>> something like... >>> >>> [20050222] => Array >>> ( >>> ... >>> to something more like a flat table.... >>> >>> [8D69CBD9-8664-11D9-8CFA-000D936C280E-RID] => Array >>> ( >>> ... >>> >>> ===Other Questions=== >>> >>> 1) What are the dependencies of the ical_parser.php file? Does it >>> rely on any files other than init.incs.php, date_functions.php, >>> draw_functions.php, overlapping_events.php and timezones.php? If not, >>> can I use the functions directory on its own without the rest of >>> phpicalendar in an entirely separate directory? >>> >>> 2) I'd really like to be able to associate images with events and I'm >>> not sure how to achieve this. Perhaps I could create a directory of >>> images with the directory name matching the UID of the events. Or >>> perhaps I should generate a MySQL database from the .ics file with >>> UIDs and fields for image paths. I could even create a table from the >>> array I'm trying to create and store all the calendar data in the >>> database to increase the speed of execution. >>> >>> There's a good chance I'm approaching this in entirely the wrong way. >>> If so, please put me out of my misery! >>> >>> Thanks >>> >>> tola >> >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real >> users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> Phpicalendar-devel mailing list >> Php...@li... >> https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > > > > --__--__-- > > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel > > > End of Phpicalendar-devel Digest |