Home › Forums › Calendar Products › Events Calendar PRO › Control Data in iCal Feed
- This topic has 10 replies, 4 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
December 9, 2012 at 7:21 pm #29180
Grec
MemberI had previously used the 1.3.2 and 1.3.3 premium versions of this plugin and had commented out the description data provided to the iCal feed. My fix in the prior versions was to modify the events-calendar-pro.class.php file as follows.
Comment out: $events .= “DESCRIPTION:” . str_replace(“,”,’\,’,$description) . “\n”;
Create new line: $events .= “DESCRIPTION:Please visit the following link for all of the details on this event: ” . get_permalink( $eventPost->ID ) . “\n”;
Unfortunately, this file doesn’t appear in the new version of the plugin. Where can I find the file that controls the output of the iCal feed in the updated plugin?
December 9, 2012 at 8:32 pm #29181Andy Fragen
ModeratorSalvador, there’s a much better way that will survive any new updates.
I’ve already written some code to modify the ‘DESCRIPTION’ line. All that you should have to do is to comment out the line in my code that does the following.
$item[] = $mod;that’s line 13 in the gist.This should remove the DESCRIPTION line entirely. You can find the code at https://gist.github.com/2649910
Let me know if this doesn’t do as you expect.
December 14, 2012 at 5:27 pm #29557Grec
MemberThanks for the reference… Sorry for being a n00b … but here do I add this? Also I’d like to include a description but I’d like it to just be a link to the event in the calendar instead. Any suggestions there?
December 14, 2012 at 6:16 pm #29558Andy Fragen
ModeratorSalvador, you put this in your theme’s functions.php file. As for just making the DESCRIPTION a link. You could probably just alter line 11 from
$mod = substr($key[0], 0, 1000);
to something like
$mod = get_permalink( $eventPost->ID );December 15, 2012 at 10:36 am #29573Grec
MemberSo does you original function just limit the DESCRIPTION to 1000 characters? Just checking… Been a while since I coded.
December 15, 2012 at 10:37 am #29574Andy Fragen
ModeratorYes
December 15, 2012 at 10:52 am #29575Grec
MemberLooks like it’s doing what I wanted… Thanks Andy! For everyone else wanting to do the same thing, the following is the code I used. It’s a slight modification of Andy’s function and follow-up suggestions. Specifically, I needed to include “DESCRIPTION” right before the get_permalink function.
function tribe_ical_modify_event( $item, $eventPost ) {
$searchValue = “DESCRIPTION”;
$fl_array = preg_grep(‘/^’ . “$searchValue” . ‘.*/’, $item);
$key = array_values($fl_array);
$keynum = key($fl_array);
$mod = “DESCRIPTION:Please visit for more information: ” .get_permalink( $eventPost->ID );
unset($item[$keynum]);
$item[] = $mod;
return $item;
}December 15, 2012 at 11:02 am #29576Grec
MemberAndy: Do you happen to know a way I can use use my theme’s properties so I don’t have to update the EVP code after each upgrade for the following items.
I’ve seen some mentions of an override files but I need to get caught up on that.
December 15, 2012 at 11:17 am #29579Andy Fragen
ModeratorSalvador, glad you got this little function working. It will survive ECP updates. As for your other questions, I think it’s time for a new thread. I’m not sure about those.
December 17, 2012 at 1:28 pm #29629Barry
MemberThanks for jumping in there Andy.
Salvador: as Andy suggests it might be better to create a new thread if you have further questions – apart from anything else it makes it a lot easier for other users to find relevant topics that might help them in the future.
July 7, 2015 at 6:26 am #978333Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Control Data in iCal Feed’ is closed to new replies.
