Support named WebCals

Questions on the code and inner workings of PHP iCalendar.

Support named WebCals

Postby AlexH » Mon Sep 21, 2009 2:46 pm

Hi!

My University provides iCals via a URL which basically is a GET-string. The Name of the calendar results in a very ugly string being placed everywhere.

The easiest way to name a webcal would be using a named Array. I tried to hack phpicalendar and came up with the following solution which works for me. Please do only see this as a suggestion. I'm SURE it is full of mistakes/errors ;-)!!

It applies to 2.31 btw. Please discuss this idea.

named-webcals.diff.tar.gz

Edit: Ahhh, nearly no file exts allowed make Alex go crazy... :lol:
You do not have the required permissions to view the files attached to this post.
AlexH
Member
 
Posts: 5
Joined: Mon Sep 21, 2009 2:40 pm

Re: Support named WebCals

Postby Parasyte » Tue Dec 29, 2009 3:07 pm

Hi AlexH,

I'm looking at your github fork. I remember working on the code you've modified. I recognize it's for the webcal support. But what does it actually do? Do you have an example I could look at online somewhere?

Thanks!
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: Support named WebCals

Postby AlexH » Wed Dec 30, 2009 6:35 am

No online example, but here's how to use it:

config.inc.php:

Code: Select all
$list_webcals = array(
   'MyName' => 'http://blablabla.com/calendar.php?type=student&uid=1234567&someid=12&sem=1&morevalues=2&lovelongurls=0&short=&begin=1251669600&ende=1265238000&format=ical&version=2&target=ical'
);



Normally the name of the webcal would include the complete GET-string, because it's no file and doesn't have any file-extension. But by using a key ("MyName") and my patch, the detection of the file-name is overridden and the key is used instead. I'm not completely sure what I've done though, the phpicalendar code is very hard to read (don't dare to write "spaghetti" :D).
AlexH
Member
 
Posts: 5
Joined: Mon Sep 21, 2009 2:40 pm

Re: Support named WebCals

Postby Parasyte » Mon Jan 04, 2010 11:15 am

It sounds like a patch we'll want to accept. At least, the idea of giving remote webcals a local name! They are typically given an md5 hash as an identifier, and the name is generated automagically with the ICS filename. In your use case, there is no filename. I don't know what kind of fallbacks we use for that case.
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm

Re: Support named WebCals

Postby AlexH » Mon Jan 04, 2010 12:09 pm

The "fallback" seemed to be a completely messed up web-interface. :lol:

No, to be serious:
It took the file-part of the URL, "blablabla.php?blablabla?ert&asd=234....".



By the way: I know I initially had problems using the file cache with my mod, but I don't know if I was able to resolve that, I really can't remember. But judging by the speed of the test-setup on my webhost I corrected it.
AlexH
Member
 
Posts: 5
Joined: Mon Sep 21, 2009 2:40 pm

Re: Support named WebCals

Postby Parasyte » Mon Jan 25, 2010 2:14 pm

Mostly for my own reference, but here is a link to AlexH's branch on github: http://github.com/aleho/phpicalendar
Parasyte
Member
 
Posts: 165
Joined: Thu Jan 15, 2009 4:31 pm


Return to Developer Questions

Who is online

Users browsing this forum: No registered users and 1 guest