Control Data in iCal Feed

Home Forums Calendar Products Events Calendar PRO Control Data in iCal Feed

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #29180
    Grec
    Member

    I 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?

    #29181
    Andy Fragen
    Moderator

    Salvador, 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.

    #29557
    Grec
    Member

    Thanks 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?

    #29558
    Andy Fragen
    Moderator

    Salvador, 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 );

    #29573
    Grec
    Member

    So does you original function just limit the DESCRIPTION to 1000 characters? Just checking… Been a while since I coded.

    #29574
    Andy Fragen
    Moderator

    Yes

    #29575
    Grec
    Member

    Looks 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;
    }

    #29576
    Grec
    Member

    Andy: 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.

    Widget – Separate Date and Time

    Bullets in Advanced Widget

    I’ve seen some mentions of an override files but I need to get caught up on that.

    #29579
    Andy Fragen
    Moderator

    Salvador, 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.

    #29629
    Barry
    Member

    Thanks 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.

    #978333
    Support Droid
    Keymaster

    This 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.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Control Data in iCal Feed’ is closed to new replies.