Events Made Easy › Forums › Generic › ICS / iCal / CalDAV for Full Calendar, Past AND Future?
- This topic has 5 replies, 2 voices, and was last updated 12 years, 1 month ago by Anonymous.
-
AuthorPosts
-
Mon 15 Oct 2012 at 20:37 #43861AnonymousInactive
[ SORRY, DEFAULTED TO WRONG SUBFORUM ]
Hi again Franky. I’m trying out new calendar software and I just noticed that the designated URL and code for eme_public.ics only includes future events. Is there any way to include the entire calendar in an ICS link? (Alternatively, at least some way to export the whole thing offline?)
Also, just FYI, I found I had to replace the “?” with “%3F” to get it to work in my iCal/CalDAV client. So the URL was mysite.com/%3Feme_ical=public
Also, minor bbpress site bug here on this forum, when I searched on “ics”, the datestamps are messed up. Several posts under “Relevant posts” show today’s date even though they are months old… for example:
6. Reminder and import in my gmail calender Posted October 15, 2012 - 22:17
Mon 15 Oct 2012 at 21:03 #49980FrankyKeymasterSince adding past events to a calendar is not very usefull in general, I will not add it to the code. But the way to obtain this:
file eme_ical.php, function eme_ical(): change the call to eme_get_events to specify “all” instead of “future”
Mon 15 Oct 2012 at 22:56 #49981AnonymousInactiveThank you Franky! Very nice. I can do a one-time ICS export and then change it back.
(I’m thinking of trying to copy it and make an alternate function too, in order to be able to create the full feed on demand, but I’ve really hacked around too much with your code / my theme already, and I fear everything falling to pieces when I upgrade. So I probably won’t.)
Mon 15 Oct 2012 at 23:20 #49982AnonymousInactiveHmm, actually, that didn’t work — it still only exports future events… ?
$events = eme_get_events ( 0,"all","ASC",0,"",$_GET ['category'] );
Mon 15 Oct 2012 at 23:28 #49983AnonymousInactiveEDIT: FIXED – SEE NEXT POST
This seemed to be because “future” is hard-coded in eme_events.php. Can/should I change that too?
// main function querying the database event table
function eme_get_events($o_limit, $scope = "future", $order = "ASC", $o_offset = 0, $location_id = "", $category = "", $author = "", $contact_person = "", $show_ongoing=1, $notcategory = "", $extra_conditions = "") {
global $wpdb, $wp_query;Edit: Strange, changing that to “all” doesn’t seem to change the results either. Something being cached somewhere?… Deactivated and reactived EME plugin, but still no change.
Mon 15 Oct 2012 at 23:57 #49984AnonymousInactiveGot it!
The original advice to change “future” to “all” didn’t work for me, because the only original eme_ical.php call to eme_get_events that used “future” was the call when there was a category defined… so I was changing only the category-specific call. So I had to ADD the parameters to the eme_get_events call after the ELSE.
That is, the original code in eme_ical.php read:
$event=eme_get_event(intval($_GET ['event_id']));
echo eme_ical_single_event($event,$title_format,$description_format);
} elseif (isset ( $_GET ['eme_ical'] ) && $_GET ['eme_ical'] == 'public') {
if (isset( $_GET ['category'] )) {
$events = eme_get_events ( 0,"future","ASC",0,"",$_GET ['category'] );
} else {
$events = eme_get_events ( 0 );and my NEW temporary hack is as follows:
$event=eme_get_event(intval($_GET ['event_id']));
echo eme_ical_single_event($event,$title_format,$description_format);
} elseif (isset ( $_GET ['eme_ical'] ) && $_GET ['eme_ical'] == 'public') {
if (isset( $_GET ['category'] )) {
$events = eme_get_events ( 0,"future","ASC",0,"",$_GET ['category'] );
} else {
$events = eme_get_events ( 0,"all","ASC",0,"" );So I think it’s working for me now. Thanks again…
-
AuthorPosts
- The forum ‘Generic’ is closed to new topics and replies.